qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
25,353,460
I have set up a query and a cursor. My problem is my cursor seems to be moving 1 column at a time. my table is set up with first column as the description string, second column is the grade value and the third column is the weight value. this is my query: ``` String[] columns = {Calc_db.COLUMN_GRADE_VALUE, Calc_db.C...
2014/08/17
['https://Stackoverflow.com/questions/25353460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943131/']
I see some bugs in your code. **First bug**: ``` cursor.moveToFirst(); while (cursor.moveToNext()) { ... } ``` This code will skip the first row. You are moving to the first row with `moveToFirst`, then you are moving to the second row with `moveToNext` when the `while` loop condition is evaluated. In general, ...
You first go in to the first row by `moveToFirst` and then in the if statement you move the cursor to the second row. You should do something like this: ``` if(cursor.moveToFirst) { do { // Your Code } while (cursor.moveToNext()) } ```
25,353,460
I have set up a query and a cursor. My problem is my cursor seems to be moving 1 column at a time. my table is set up with first column as the description string, second column is the grade value and the third column is the weight value. this is my query: ``` String[] columns = {Calc_db.COLUMN_GRADE_VALUE, Calc_db.C...
2014/08/17
['https://Stackoverflow.com/questions/25353460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943131/']
I see some bugs in your code. **First bug**: ``` cursor.moveToFirst(); while (cursor.moveToNext()) { ... } ``` This code will skip the first row. You are moving to the first row with `moveToFirst`, then you are moving to the second row with `moveToNext` when the `while` loop condition is evaluated. In general, ...
For those of interested this is how I fixed my problem: (Thanks for the advice Karakuri) ``` public List<Entry> populateList(){ List<Entry> gradeWeightList = new ArrayList<Entry>(); Cursor cursor = data.getBd().query(Calc_db.TABLE_NAME, null, null, null, null, null, null); for (cursor.moveToFirst(); !cu...
25,353,460
I have set up a query and a cursor. My problem is my cursor seems to be moving 1 column at a time. my table is set up with first column as the description string, second column is the grade value and the third column is the weight value. this is my query: ``` String[] columns = {Calc_db.COLUMN_GRADE_VALUE, Calc_db.C...
2014/08/17
['https://Stackoverflow.com/questions/25353460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943131/']
You first go in to the first row by `moveToFirst` and then in the if statement you move the cursor to the second row. You should do something like this: ``` if(cursor.moveToFirst) { do { // Your Code } while (cursor.moveToNext()) } ```
For those of interested this is how I fixed my problem: (Thanks for the advice Karakuri) ``` public List<Entry> populateList(){ List<Entry> gradeWeightList = new ArrayList<Entry>(); Cursor cursor = data.getBd().query(Calc_db.TABLE_NAME, null, null, null, null, null, null); for (cursor.moveToFirst(); !cu...
61,611,313
I have a dropdown and a button, how would I go on about making the dropdown the same size as the button? ```css :root { --navbarbgc: rgb(83, 79, 79); --dropwidth: 100px; } body { margin: 0; } ul { list-style: none; } .navbar { background-color: var(--navbarbgc); } .navbar>ul>li>button { width: var(--dr...
2020/05/05
['https://Stackoverflow.com/questions/61611313', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13124037/']
What I did Added class `button-li` to the `li` element which has `button` And added this css ``` #navdrop { position: absolute; background-color: var(--navbarbgc); justify-content: center; padding: 0; width: 100%; } .button-li { display: inline-block; position: relative; } ``` Fiddle <https://jsfidd...
Here I gave **button** **width** of **100px**, removed **padding** from **#navdrop** and gave **width** of **100px** to **#navdrop** (same as button) then I just centered the text using **text-align**. you should **NOT** be using **justify-content** because it does nothing for you right now. use **justify-content** wit...
61,611,313
I have a dropdown and a button, how would I go on about making the dropdown the same size as the button? ```css :root { --navbarbgc: rgb(83, 79, 79); --dropwidth: 100px; } body { margin: 0; } ul { list-style: none; } .navbar { background-color: var(--navbarbgc); } .navbar>ul>li>button { width: var(--dr...
2020/05/05
['https://Stackoverflow.com/questions/61611313', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13124037/']
What I did Added class `button-li` to the `li` element which has `button` And added this css ``` #navdrop { position: absolute; background-color: var(--navbarbgc); justify-content: center; padding: 0; width: 100%; } .button-li { display: inline-block; position: relative; } ``` Fiddle <https://jsfidd...
you can add w-100 to the dropdown-menu class part ``` <div class="dropdown" style="margin-right: 5px;width: 23%;"> <button class="btn btn-block btn-warning dropdown-toggle btn-lg" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> OPERAZIONI </button> <div cla...
61,611,313
I have a dropdown and a button, how would I go on about making the dropdown the same size as the button? ```css :root { --navbarbgc: rgb(83, 79, 79); --dropwidth: 100px; } body { margin: 0; } ul { list-style: none; } .navbar { background-color: var(--navbarbgc); } .navbar>ul>li>button { width: var(--dr...
2020/05/05
['https://Stackoverflow.com/questions/61611313', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13124037/']
Here I gave **button** **width** of **100px**, removed **padding** from **#navdrop** and gave **width** of **100px** to **#navdrop** (same as button) then I just centered the text using **text-align**. you should **NOT** be using **justify-content** because it does nothing for you right now. use **justify-content** wit...
you can add w-100 to the dropdown-menu class part ``` <div class="dropdown" style="margin-right: 5px;width: 23%;"> <button class="btn btn-block btn-warning dropdown-toggle btn-lg" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> OPERAZIONI </button> <div cla...
424,696
I need to write a very simple shell script that will check if the system is configured to enforce multi-factor authentication. To verify that the system is configured to enforce multi-factor authentication, run the following commands: ``` /usr/sbin/system_profiler SPConfigurationProfileDataType | /usr/bin/grep enforc...
2021/07/27
['https://apple.stackexchange.com/questions/424696', 'https://apple.stackexchange.com', 'https://apple.stackexchange.com/users/219530/']
This might be a little more elegant, not necessarily *simpler*: I'm wrapping the parts of the pipeline in their own functions ```bsh profile () { /usr/sbin/system_profiler SPConfigurationProfileDataType; } enforces2fa () { /usr/bin/grep -F -q 'enforceSmartCard=1'; } if profile | enforces2fa; then echo "The system...
I'd be inclined to read the value of the **`enforceSmartCard`** key directly from the *`com.apple.security.smartcard.plist`* file located in the *`/Library/Preferences`* folder. This can be done using the `defaults` command-line tool, which will be significantly faster than the `system_profiler`, and you won't need to...
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
Try this: ``` $("#textbox").bind('paste',function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/3/).
Reading your comments took me to a dirty fix. This is not a right way, I know, but can be a work around. ``` $(function() { $( "#inputFieldId" ).autocomplete({ source: function( event, ui ) { alert("do your functions here"); return false; } }); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
On modern browsers, you can use [the `input` event](https://developer.mozilla.org/en-US/docs/Web/Events/input): [DEMO](http://jsfiddle.net/K682b/6/) ``` $("#textbox").on('input',function() {alert("Change detected!");}); ```
``` if you write anything in your textbox, the event gets fired. code as follows : ``` HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` <script type="text/javascript"> $(function () { $("#textbox").bind('input', function() { alert("letter entered"); }); }); </script> ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
On modern browsers, you can use [the `input` event](https://developer.mozilla.org/en-US/docs/Web/Events/input): [DEMO](http://jsfiddle.net/K682b/6/) ``` $("#textbox").on('input',function() {alert("Change detected!");}); ```
Try this: ``` $("#textbox").bind('paste',function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/3/).
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
On modern browsers, you can use [the `input` event](https://developer.mozilla.org/en-US/docs/Web/Events/input): [DEMO](http://jsfiddle.net/K682b/6/) ``` $("#textbox").on('input',function() {alert("Change detected!");}); ```
Try the below Code: ``` $("#textbox").on('change keypress paste', function() { console.log("Handler for .keypress() called."); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
``` $(this).bind('input propertychange', function() { //your code here }); ``` This is works for typing, paste, right click mouse paste etc.
Try the below Code: ``` $("#textbox").on('change keypress paste', function() { console.log("Handler for .keypress() called."); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
Binding to both events is the typical way to do it. You can also bind to the paste event. You can bind to multiple events like this: ``` $("#textbox").on('change keyup paste', function() { console.log('I am pretty sure the text box changed'); }); ``` If you wanted to be pedantic about it, you should also bind t...
Reading your comments took me to a dirty fix. This is not a right way, I know, but can be a work around. ``` $(function() { $( "#inputFieldId" ).autocomplete({ source: function( event, ui ) { alert("do your functions here"); return false; } }); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
``` if you write anything in your textbox, the event gets fired. code as follows : ``` HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` <script type="text/javascript"> $(function () { $("#textbox").bind('input', function() { alert("letter entered"); }); }); </script> ```
Try the below Code: ``` $("#textbox").on('change keypress paste', function() { console.log("Handler for .keypress() called."); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
Binding to both events is the typical way to do it. You can also bind to the paste event. You can bind to multiple events like this: ``` $("#textbox").on('change keyup paste', function() { console.log('I am pretty sure the text box changed'); }); ``` If you wanted to be pedantic about it, you should also bind t...
``` if you write anything in your textbox, the event gets fired. code as follows : ``` HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` <script type="text/javascript"> $(function () { $("#textbox").bind('input', function() { alert("letter entered"); }); }); </script> ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
``` if you write anything in your textbox, the event gets fired. code as follows : ``` HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` <script type="text/javascript"> $(function () { $("#textbox").bind('input', function() { alert("letter entered"); }); }); </script> ```
Reading your comments took me to a dirty fix. This is not a right way, I know, but can be a work around. ``` $(function() { $( "#inputFieldId" ).autocomplete({ source: function( event, ui ) { alert("do your functions here"); return false; } }); }); ```
17,317,465
I found that jQuery change event on a textbox doesn't fire until I click outside the textbox. HTML: ``` <input type="text" id="textbox" /> ``` JS: ``` $("#textbox").change(function() {alert("Change detected!");}); ``` See [demo on JSFiddle](http://jsfiddle.net/K682b/) My application requires the event to be fir...
2013/06/26
['https://Stackoverflow.com/questions/17317465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/979621/']
On modern browsers, you can use [the `input` event](https://developer.mozilla.org/en-US/docs/Web/Events/input): [DEMO](http://jsfiddle.net/K682b/6/) ``` $("#textbox").on('input',function() {alert("Change detected!");}); ```
Reading your comments took me to a dirty fix. This is not a right way, I know, but can be a work around. ``` $(function() { $( "#inputFieldId" ).autocomplete({ source: function( event, ui ) { alert("do your functions here"); return false; } }); }); ```
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've finally discovered why this isn't working. It's not an issue of errors in the implementing code or Laravel, but one of either: (i). writing good PHP code to handle the self-evident result, which clearly I didn't do; (ii). insufficient documentation within Laravel on how to actually use the validation error respons...
Your messages should be validation rules, so instead of: ``` 'name.required' => 'Name is required', 'name.string' => 'Name must be alphanumeric', 'user_id.required' => 'Curator User Id is required', 'user_id.required' => 'Curator User Id must be an integer', ``` you should have: ``` 'name.required' => 'Name is requ...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
The problem is probably that Laravel's default Exception handler is not prepared to relay detailed validation info back to the user. Instead, it hides Exception details from the user, which is normally the right thing to do because it might form a security risk for other Exceptions than validation ones. In other words...
Your messages should be validation rules, so instead of: ``` 'name.required' => 'Name is required', 'name.string' => 'Name must be alphanumeric', 'user_id.required' => 'Curator User Id is required', 'user_id.required' => 'Curator User Id must be an integer', ``` you should have: ``` 'name.required' => 'Name is requ...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've only just seen this but all you need to do is move the validate call **before** the try/catch ``` $p_oRequest->validate( [ 'name' => 'required|alpha_num', 'user_id' => 'required|integer', ], [ 'name.required' => 'Name is required', 'name.string' => 'Name mus...
Your messages should be validation rules, so instead of: ``` 'name.required' => 'Name is required', 'name.string' => 'Name must be alphanumeric', 'user_id.required' => 'Curator User Id is required', 'user_id.required' => 'Curator User Id must be an integer', ``` you should have: ``` 'name.required' => 'Name is requ...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've finally discovered why this isn't working. It's not an issue of errors in the implementing code or Laravel, but one of either: (i). writing good PHP code to handle the self-evident result, which clearly I didn't do; (ii). insufficient documentation within Laravel on how to actually use the validation error respons...
The problem is probably that Laravel's default Exception handler is not prepared to relay detailed validation info back to the user. Instead, it hides Exception details from the user, which is normally the right thing to do because it might form a security risk for other Exceptions than validation ones. In other words...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've finally discovered why this isn't working. It's not an issue of errors in the implementing code or Laravel, but one of either: (i). writing good PHP code to handle the self-evident result, which clearly I didn't do; (ii). insufficient documentation within Laravel on how to actually use the validation error respons...
I've only just seen this but all you need to do is move the validate call **before** the try/catch ``` $p_oRequest->validate( [ 'name' => 'required|alpha_num', 'user_id' => 'required|integer', ], [ 'name.required' => 'Name is required', 'name.string' => 'Name mus...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've finally discovered why this isn't working. It's not an issue of errors in the implementing code or Laravel, but one of either: (i). writing good PHP code to handle the self-evident result, which clearly I didn't do; (ii). insufficient documentation within Laravel on how to actually use the validation error respons...
Put the response in a variable and use dd() to print it. You will find it on the "messages" method. Worked for me. `dd($response);`
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
The problem is probably that Laravel's default Exception handler is not prepared to relay detailed validation info back to the user. Instead, it hides Exception details from the user, which is normally the right thing to do because it might form a security risk for other Exceptions than validation ones. In other words...
I've only just seen this but all you need to do is move the validate call **before** the try/catch ``` $p_oRequest->validate( [ 'name' => 'required|alpha_num', 'user_id' => 'required|integer', ], [ 'name.required' => 'Name is required', 'name.string' => 'Name mus...
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
The problem is probably that Laravel's default Exception handler is not prepared to relay detailed validation info back to the user. Instead, it hides Exception details from the user, which is normally the right thing to do because it might form a security risk for other Exceptions than validation ones. In other words...
Put the response in a variable and use dd() to print it. You will find it on the "messages" method. Worked for me. `dd($response);`
46,257,191
I'm not getting the response I expect. This is the controller code for a Location web-service request: ``` <?php namespace App\Http\Controllers; use App\Location; use Illuminate\Http\Request; class LocationController extends Controller { /** * Action method to add a location with the supplied Data * ...
2017/09/16
['https://Stackoverflow.com/questions/46257191', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3125602/']
I've only just seen this but all you need to do is move the validate call **before** the try/catch ``` $p_oRequest->validate( [ 'name' => 'required|alpha_num', 'user_id' => 'required|integer', ], [ 'name.required' => 'Name is required', 'name.string' => 'Name mus...
Put the response in a variable and use dd() to print it. You will find it on the "messages" method. Worked for me. `dd($response);`
38,156,908
I am working on windows Universal platform(Universal app-UWP). I have issue regarding Responsiveness of the Grid Control. How to design a grid which is responsive for all view. I am designed a grid this way: Code: ``` <ListView Margin="30,0,0,1" MaxHeight="160" Visibility="Visible" ScrollViewer.VerticalScrollMode=...
2016/07/02
['https://Stackoverflow.com/questions/38156908', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5997390/']
We can provide a width of listview in code behind (c#) through the managing all visual state. Code: ``` if (PageSizeStatesGroup.CurrentState == WideState) //Desktop Devie { } else if (PageSizeStatesGroup.CurrentState == MediumState) // // //tablate state { ...
Please tell more about your current problem (at which view size it has problem ? What is your desired result ?). Depend on your view port / device requirements, you can chose one or combine the following solutions: * Use difference XAML for each device family * Use VisualState to change the size/flow of content of th...
38,156,908
I am working on windows Universal platform(Universal app-UWP). I have issue regarding Responsiveness of the Grid Control. How to design a grid which is responsive for all view. I am designed a grid this way: Code: ``` <ListView Margin="30,0,0,1" MaxHeight="160" Visibility="Visible" ScrollViewer.VerticalScrollMode=...
2016/07/02
['https://Stackoverflow.com/questions/38156908', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5997390/']
We can provide a width of listview in code behind (c#) through the managing all visual state. Code: ``` if (PageSizeStatesGroup.CurrentState == WideState) //Desktop Devie { } else if (PageSizeStatesGroup.CurrentState == MediumState) // // //tablate state { ...
The best thing you could do is to use State Triggers which automatically resize based on the Screen size. Check this [example](http://www.wintellect.com/devcenter/jprosise/using-adaptivetrigger-to-build-adaptive-uis-in-windows-10)
40,935,127
I am getting an error when executing following `.prototxt` and I have absolutely no idea why I get an error there: ``` layer { name: "conv" type: "Convolution" bottom: "image" top: "conv" convolution_param { num_output: 2 kernel_size: 5 pad: 2 stride: 1 weigh...
2016/12/02
['https://Stackoverflow.com/questions/40935127', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
AFAIK, this error comes from the `"Xavier"` filler: this filler computes the ratio between the input and output channels. If you replace it with a different filler you should be Okay with ND blob.
When I remove the check in `line 140 blob.hpp` it does work. This is one way to solve it, not the best one though. (But this cannot be the proper solution. Is there anything else?)
40,935,127
I am getting an error when executing following `.prototxt` and I have absolutely no idea why I get an error there: ``` layer { name: "conv" type: "Convolution" bottom: "image" top: "conv" convolution_param { num_output: 2 kernel_size: 5 pad: 2 stride: 1 weigh...
2016/12/02
['https://Stackoverflow.com/questions/40935127', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
As a complement of [Shai's answer](https://stackoverflow.com/a/40956354/6281477), in order to be compatible with the `ND Convolution` and `InnerProduct` layer, the "`Xavier`" filler [code](https://github.com/BVLC/caffe/blob/master/include/caffe/filler.hpp#L144) ``` virtual void Fill(Blob<Dtype>* blob) { ... int fan_in...
When I remove the check in `line 140 blob.hpp` it does work. This is one way to solve it, not the best one though. (But this cannot be the proper solution. Is there anything else?)
40,935,127
I am getting an error when executing following `.prototxt` and I have absolutely no idea why I get an error there: ``` layer { name: "conv" type: "Convolution" bottom: "image" top: "conv" convolution_param { num_output: 2 kernel_size: 5 pad: 2 stride: 1 weigh...
2016/12/02
['https://Stackoverflow.com/questions/40935127', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
AFAIK, this error comes from the `"Xavier"` filler: this filler computes the ratio between the input and output channels. If you replace it with a different filler you should be Okay with ND blob.
As a complement of [Shai's answer](https://stackoverflow.com/a/40956354/6281477), in order to be compatible with the `ND Convolution` and `InnerProduct` layer, the "`Xavier`" filler [code](https://github.com/BVLC/caffe/blob/master/include/caffe/filler.hpp#L144) ``` virtual void Fill(Blob<Dtype>* blob) { ... int fan_in...
9,104,620
I have this code to check if a span is hidden or visible depending on the value it will show or hide, the event is triggered when a user clicks a button: ``` $('form').on('click', '#agregar', function(){ // var p = $('#panel'); //var a = $('#agregar'); if($('#panel').is(':visible')){ $('#panel').hide(); $('#ag...
2012/02/01
['https://Stackoverflow.com/questions/9104620', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1079232/']
try doing this if( $("#panel").css("display") != "none" )
Try this extension to see if this helps you. ``` jQuery.extend( jQuery.expr[ ":" ], { reallyvisible : function (a) { return !(jQuery(a).is(':hidden') || jQuery(a).parents(':hidden').length); }} ); ```
7,923,033
I am running some unit tests on my code, and for this I had to download the selenium server. Now, one of the examples selenium includes is called GoogleTest. I had this copied to my C:\ folder, and tried to run it. At first, i had an error trying to open firefox. Seems that selenium hasn't been updated for quite some...
2011/10/27
['https://Stackoverflow.com/questions/7923033', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/775205/']
Did you tried with [QAF formerly ISFW](https://qmetry.github.io/qaf/)? It internally waits for element as well as provides wait functionality for ajax to complete for may of the js toolkit like dojo, extjs, prototype etc for example if the AUT uses extjs then you can use like ``` waitService.waitForAjaxToComplete(JsT...
There is no waitforajaxtoreturn function in Selenium. The way AJAX changes are handled are by using the `WebDriverWait` class to wait for a specific condition to become true when the AJAX call returns. So for example, for the Google test, the `WebDriverWait` could wait for the search container to appear. In essence, ...
7,923,033
I am running some unit tests on my code, and for this I had to download the selenium server. Now, one of the examples selenium includes is called GoogleTest. I had this copied to my C:\ folder, and tried to run it. At first, i had an error trying to open firefox. Seems that selenium hasn't been updated for quite some...
2011/10/27
['https://Stackoverflow.com/questions/7923033', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/775205/']
Did you tried with [QAF formerly ISFW](https://qmetry.github.io/qaf/)? It internally waits for element as well as provides wait functionality for ajax to complete for may of the js toolkit like dojo, extjs, prototype etc for example if the AUT uses extjs then you can use like ``` waitService.waitForAjaxToComplete(JsT...
I am testing some ajax and JS heavy pages and I have been facing exactly the same problem. I have used implicit waits to to pause for the ajax code to execute and load the new content to DOM . Here is a python sample from my code : ``` from selenium import webdriver browserHandle = webdriver.Firefox() browserHandle.im...
12,851,933
when i try to run this code : ``` <?php $str = "Patty O'Furniture"; if(get_magic_quotes_gpc()) echo stripslashes($str); ?> ``` the output is `Patty O'Furniture` but when i try to run this code(upload data into database table) ``` <?php if ($_FILES[csv][size] > 0) { //get the csv file $file = $_FILES[cs...
2012/10/12
['https://Stackoverflow.com/questions/12851933', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1530536/']
Because you're undoing what [magic\_quotes](http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc) is trying to do. > > When magic\_quotes are on, all ' (single-quote), " (double quote), \ > (backslash) and NUL's are escaped with a backslash automatically. > > > So you're removing the backslas...
use [`mysql_real_escape_string()`](http://php.net/manual/en/function.mysql-real-escape-string.php) function instead of `stripslashes()` or Try to avoid `mysql_*` functions, Try to use [`mysqli`](http://www.php.net/manual/en/book.mysqli.php) or `PDO`
12,851,933
when i try to run this code : ``` <?php $str = "Patty O'Furniture"; if(get_magic_quotes_gpc()) echo stripslashes($str); ?> ``` the output is `Patty O'Furniture` but when i try to run this code(upload data into database table) ``` <?php if ($_FILES[csv][size] > 0) { //get the csv file $file = $_FILES[cs...
2012/10/12
['https://Stackoverflow.com/questions/12851933', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1530536/']
Because you're undoing what [magic\_quotes](http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc) is trying to do. > > When magic\_quotes are on, all ' (single-quote), " (double quote), \ > (backslash) and NUL's are escaped with a backslash automatically. > > > So you're removing the backslas...
What you are seeing is the basis for [SQL Injection](http://en.wikipedia.org/wiki/SQL_injection). Your input is not escaped at all once you remove the slashes. Imagine what would happen if an attacker provided an input string that closed your query and began a new one with `'; UPDATE users SET password WHERE username="...
24,359,324
This is my php code to get user information using google plus api. I had unset the access token in case user click logout but still logout don't works. Once i got the information of any user, then after logging out and connecting again i still got the same user information and no option to sign in with different email ...
2014/06/23
['https://Stackoverflow.com/questions/24359324', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/734371/']
How about this? ``` if (isset($_REQUEST['logout'])) { unset($_SESSION['access_token']); header('Location: https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); } ```
And how about this? ``` if (isset($_REQUEST['logout'])) { $client->revokeToken($_SESSION['access_token']); unset($_SESSION['access_token']); } ```
15,535,398
Im trying to add a checkbox to a specific datagridview column header, I found some code online to help but it's not aligning properly and I'm not really sure how to fix it. Below is an image of the problem and the code, any help would be greatly appreciated! P.S. I think it might be something to do with properties b...
2013/03/20
['https://Stackoverflow.com/questions/15535398', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2058444/']
This is my first entry, but I think this is what youre looking for. I tested it and it worked on my datagrid. You were using the width for the rectangle, youll need it for the column width instead. I set the column header to 4, but you would replace the 4 with your column you want to use I put it in two ways, one with ...
``` Private headerBox As CheckBox Private Sub show_checkBox() Dim checkboxHeader As CheckBox = New CheckBox() Dim rect As Rectangle = PendingApprovalServiceListingDataGridView.GetCellDisplayRectangle(4, -1, True) rect.X = 20 rect.Y = 12 With checkboxHeader .BackColor ...
73,963,231
I know that `document.getElementById()` won't work with several ids. So I tried this: ``` document.getElementsByClassName("circle"); ``` But that also doesn't work at all. But if I use just the `document.getElementById()` it works with that one id. Here is my code: ```js let toggle = () => { let circle = document...
2022/10/05
['https://Stackoverflow.com/questions/73963231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/20168544/']
`document.getElementsByClassName()` returns a `NodeList`, and to convert it to an array of elements, use `Array.from()`. this will return an array containing all of the elements with the class name `circle` Here is an example, which changes each element with the `circle` class: ```js const items = document.getElement...
You can try this. ``` const selectedIds = document.querySelectorAll('#id1, #id12, #id3'); console.log(selectedIds); //Will log [element#id1, element#id2, element#id3] ``` Then you can do something like this: ``` for(const element of selectedIds){ //Do something with element //Example: element.style.color = "red" }...
21,608,613
I was trying to solve a problem which is to verify that if there exist a sub sequence whose sum is equal to a given number. I found this thread [Distinct sub sequences summing to given number in an array](https://stackoverflow.com/questions/17125536/distinct-sub-sequences-summing-to-given-number-in-an-array). I don't h...
2014/02/06
['https://Stackoverflow.com/questions/21608613', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1763475/']
You're trying to solve the [subset sum problem](http://en.wikipedia.org/wiki/Subset_sum_problem) which is known to be NP-complete. Hence there's no known optimal polynomial algorithm. However if your problem permits certain constraints then it may be possible to solve it elegantly with one of the algorithms provided i...
There is a pseudo polynomial Dynamic Programming solution similar to knapsack problem using following analogy :- > > 1. Knapsack capacity W = num > 2. Item i's weight and cost is same as arr[i] > 3. Maximize Profit > 4. if MaxProfit == W then there exists subsequence else no subsequence possible. > 5. Recontruct solu...
167,409
I have to evaluate: $$\int\_{0}^{\pi/2}\frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}\, \mathrm{d}x. $$ I can't get the right answer! So please help me out!
2012/07/06
['https://math.stackexchange.com/questions/167409', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/27579/']
Let $I$ denote the integral and consider the substitution $u= \frac{\pi }{2} - x.$ Then $I = \displaystyle\int\_0^{\frac{\pi }{2}} \frac{\sqrt{\cos u}}{\sqrt{\cos u } + \sqrt{\sin u }} du$ and $2I = \displaystyle\int\_0^{\frac{\pi }{2}} \frac{\sqrt{\cos u} + \sqrt{\sin u }}{\sqrt{\cos u } + \sqrt{\sin u }} du = \frac{\...
Note that $\sin(\pi/2-x)=\cos x$ and $\cos(\pi/2-x)=\sin x$. The answer will exploit the symmetry. Break up the original integral into two parts, (i) from $0$ to $\pi/4$ and (ii) from $\pi/4$ to $\pi/2$. So our first integral is $$\int\_{x=0}^{\pi/4} \frac{\sqrt{\sin x}}{\sqrt{\sin x}+\sqrt{\cos x}}\,dx.\tag{$1$} $$ ...
40,102,726
I am working on building an app. Earlier I have used Xcode 7.1 at that time everything was working fine. Recently I have installed Xcode 8.0 as well and I have both the setups installed into in two different directories Xcode\_7, Xcode\_8 and I renamed the setup files as well. Everything was working fine but lately I a...
2016/10/18
['https://Stackoverflow.com/questions/40102726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4134597/']
Try This > > Go to Xcode -> Preferences -> Locations -> Derived Data -> click the > arrow to open in Finder -> And delete the content of that folder. > > > [![enter image description here](https://i.stack.imgur.com/0j0EO.png)](https://i.stack.imgur.com/0j0EO.png) Hope it helps!
Restart your mac, press cmd+R and open in recovery mode. Open terminal and type command --> csrutil disable restart mac.. open terminal--> sudo chmod 0777 / private / tmp  then run your xcode, simulator will work fine :)
40,102,726
I am working on building an app. Earlier I have used Xcode 7.1 at that time everything was working fine. Recently I have installed Xcode 8.0 as well and I have both the setups installed into in two different directories Xcode\_7, Xcode\_8 and I renamed the setup files as well. Everything was working fine but lately I a...
2016/10/18
['https://Stackoverflow.com/questions/40102726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4134597/']
Try This > > Go to Xcode -> Preferences -> Locations -> Derived Data -> click the > arrow to open in Finder -> And delete the content of that folder. > > > [![enter image description here](https://i.stack.imgur.com/0j0EO.png)](https://i.stack.imgur.com/0j0EO.png) Hope it helps!
To all you Xcode 8 users out there: Make sure you are running mac os sierra! It isn't said that being on el capitan will cause this problem. But I have updated to Sierra and everything works fine now!
40,102,726
I am working on building an app. Earlier I have used Xcode 7.1 at that time everything was working fine. Recently I have installed Xcode 8.0 as well and I have both the setups installed into in two different directories Xcode\_7, Xcode\_8 and I renamed the setup files as well. Everything was working fine but lately I a...
2016/10/18
['https://Stackoverflow.com/questions/40102726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4134597/']
Restart your mac, press cmd+R and open in recovery mode. Open terminal and type command --> csrutil disable restart mac.. open terminal--> sudo chmod 0777 / private / tmp  then run your xcode, simulator will work fine :)
To all you Xcode 8 users out there: Make sure you are running mac os sierra! It isn't said that being on el capitan will cause this problem. But I have updated to Sierra and everything works fine now!
101,120
I have a Google App Engine Java web app that I have setup with a custom domain from GoDaddy. The site can currently be reached at domain.com and www.domain.com. I am trying to have a 301 redirect occur whenever someone tries to access domain.com instead of www.domain.com. I have tried to use domain forwarding via GoDad...
2016/11/15
['https://webmasters.stackexchange.com/questions/101120', 'https://webmasters.stackexchange.com', 'https://webmasters.stackexchange.com/users/71988/']
Update: There are 3 ways to do this. 1. htaccess 2. php to yaml with redirect 3. Within Google itself. > > **Specify the domain and subdomains you want to map.** > > > Note: The naked domain and www subdomain are pre populated in the > form. A naked domain, such as example.com, maps to <http://example.com>. > A...
Google does not support htaccess file. They support app.yaml file, which have different [mod rewrite rule](https://cloud.google.com/appengine/docs/php/config/appref), but as far I know It will applicable only to one CNAME, it means if you have set www.example.com then those rewrite rules will not applicable to example....
3,018
In my view the life begins at the time of forming zygote inside the mother's womb. My question is that what is the view of Hinduism about "the beginning of a life"?
2014/09/04
['https://hinduism.stackexchange.com/questions/3018', 'https://hinduism.stackexchange.com', 'https://hinduism.stackexchange.com/users/187/']
**Scientifically:** You are correct. **By Hinduism:** Its a soul,which is going to change a body like clothes, leaving off the old one and wearing newones.[see this](http://www.eaglespace.com/spirit/gita_reincarnation.php) > > vaasaa.nsi jiirNaani yathaa vihaaya navaani gRRihNaati naro.aparaaNi. > > > tathaa shari...
*Krishna* says in the *Bhagavad Gita* that the soul is eternal i.e. life neither begins nor ends. Ofcourse, the body if formed again and again as mentioned in *nobalG's* answer. TEXT 2.12 > > na tv evaham jatu nasam na tvam neme janadhipah na caiva na > bhavisyamah sarve vayam atah param > > > SYNONYMS > > na...
3,018
In my view the life begins at the time of forming zygote inside the mother's womb. My question is that what is the view of Hinduism about "the beginning of a life"?
2014/09/04
['https://hinduism.stackexchange.com/questions/3018', 'https://hinduism.stackexchange.com', 'https://hinduism.stackexchange.com/users/187/']
**Scientifically:** You are correct. **By Hinduism:** Its a soul,which is going to change a body like clothes, leaving off the old one and wearing newones.[see this](http://www.eaglespace.com/spirit/gita_reincarnation.php) > > vaasaa.nsi jiirNaani yathaa vihaaya navaani gRRihNaati naro.aparaaNi. > > > tathaa shari...
My SatGuru says human life (i.e., in physical form) starts when the sperm fuses with the Ova. However, it is not that simple.The incoming spirit permeates through both the Ova and the sperm even before they fuse. Answer is taken from this video: <https://www.youtube.com/watch?v=sWXgorb7Ia8>
3,018
In my view the life begins at the time of forming zygote inside the mother's womb. My question is that what is the view of Hinduism about "the beginning of a life"?
2014/09/04
['https://hinduism.stackexchange.com/questions/3018', 'https://hinduism.stackexchange.com', 'https://hinduism.stackexchange.com/users/187/']
*Krishna* says in the *Bhagavad Gita* that the soul is eternal i.e. life neither begins nor ends. Ofcourse, the body if formed again and again as mentioned in *nobalG's* answer. TEXT 2.12 > > na tv evaham jatu nasam na tvam neme janadhipah na caiva na > bhavisyamah sarve vayam atah param > > > SYNONYMS > > na...
My SatGuru says human life (i.e., in physical form) starts when the sperm fuses with the Ova. However, it is not that simple.The incoming spirit permeates through both the Ova and the sperm even before they fuse. Answer is taken from this video: <https://www.youtube.com/watch?v=sWXgorb7Ia8>
37,899,964
I am a total scrub with the node http module and having some trouble. The ultimate goal here is to take a huge list of urls, figure out which are valid and then scrape those pages for certain data. So step one is figuring out if a URL is valid and this simple exercise is baffling me. say we have an array allURLs: ``...
2016/06/18
['https://Stackoverflow.com/questions/37899964', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6062473/']
You need to closure url value to have access to it and protect it from changes on next loop iteration. For example: ``` (function(url){ // use url here })(allUrls[i]); ``` Most simple solution for this is use `forEach` instead of `for`. ``` allURLs.forEach(function(url){ //.... }); ``` Promisified soluti...
You can use something like this (Not tested): ``` const arr = ["", "/a", "", ""]; Promise.all(arr.map(fetch) .then(responses=>responses.filter(res=> res.ok).map(res=>res.url)) .then(workingUrls=>{ console.log(workingUrls); console.log(arr.filter(url=> workingUrls.indexOf(url) == -1 )) }); ``` **EDITED** [Worki...
47,712,861
I have Three queries execute at the same time and its declared one object $sql. In result "Product" Array Actually Four Record display only one Record,Three Record is not Display. In "total" Array Percentage Value Display null. I have need this Result ``` {"success":1,"product":[{"std_Name":"VIVEK SANAPARA","Stand...
2017/12/08
['https://Stackoverflow.com/questions/47712861', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8841544/']
You could do it with just a little CSS but it does leave a gap: ``` .week-name th:nth-child(7), .month1 tbody tr td:nth-child(7) { display: none; } ``` Hope this helps a little.
You can also do it by setting a custom css class and use it in `beforeShowDay` like below ``` .hideSunDay{ display:none; } beforeShowDay: function(t) { var valid = t.getDay() !== 0; //disable sunday var _class = t.getDay() !== 0 ? '' : 'hideSunDay'; // var _tooltip = valid ? '' : 'weeken...
47,712,861
I have Three queries execute at the same time and its declared one object $sql. In result "Product" Array Actually Four Record display only one Record,Three Record is not Display. In "total" Array Percentage Value Display null. I have need this Result ``` {"success":1,"product":[{"std_Name":"VIVEK SANAPARA","Stand...
2017/12/08
['https://Stackoverflow.com/questions/47712861', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8841544/']
I finally ended up by letting the Sundays appear (but completely disabling them). These questions inspired me : * [Moment.js - Get all mondays between a date range](https://stackoverflow.com/questions/44909662/moment-js-get-all-mondays-between-a-date-range) * [Moment.js: Date between dates](https://stackoverflow.com...
You could do it with just a little CSS but it does leave a gap: ``` .week-name th:nth-child(7), .month1 tbody tr td:nth-child(7) { display: none; } ``` Hope this helps a little.
47,712,861
I have Three queries execute at the same time and its declared one object $sql. In result "Product" Array Actually Four Record display only one Record,Three Record is not Display. In "total" Array Percentage Value Display null. I have need this Result ``` {"success":1,"product":[{"std_Name":"VIVEK SANAPARA","Stand...
2017/12/08
['https://Stackoverflow.com/questions/47712861', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8841544/']
You need do changes in two functions in your daterangepicker.js file: 1. createMonthHTML() ``` function createMonthHTML(d) { var days = []; d.setDate(1); var lastMonth = new Date(d.getTime() - 86400000); var now = new Date(); var dayOfWeek = d.getDay(); if ((dayOfWeek === 0) && (opt.startOfWe...
You can also do it by setting a custom css class and use it in `beforeShowDay` like below ``` .hideSunDay{ display:none; } beforeShowDay: function(t) { var valid = t.getDay() !== 0; //disable sunday var _class = t.getDay() !== 0 ? '' : 'hideSunDay'; // var _tooltip = valid ? '' : 'weeken...
47,712,861
I have Three queries execute at the same time and its declared one object $sql. In result "Product" Array Actually Four Record display only one Record,Three Record is not Display. In "total" Array Percentage Value Display null. I have need this Result ``` {"success":1,"product":[{"std_Name":"VIVEK SANAPARA","Stand...
2017/12/08
['https://Stackoverflow.com/questions/47712861', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8841544/']
I finally ended up by letting the Sundays appear (but completely disabling them). These questions inspired me : * [Moment.js - Get all mondays between a date range](https://stackoverflow.com/questions/44909662/moment-js-get-all-mondays-between-a-date-range) * [Moment.js: Date between dates](https://stackoverflow.com...
You can also do it by setting a custom css class and use it in `beforeShowDay` like below ``` .hideSunDay{ display:none; } beforeShowDay: function(t) { var valid = t.getDay() !== 0; //disable sunday var _class = t.getDay() !== 0 ? '' : 'hideSunDay'; // var _tooltip = valid ? '' : 'weeken...
47,712,861
I have Three queries execute at the same time and its declared one object $sql. In result "Product" Array Actually Four Record display only one Record,Three Record is not Display. In "total" Array Percentage Value Display null. I have need this Result ``` {"success":1,"product":[{"std_Name":"VIVEK SANAPARA","Stand...
2017/12/08
['https://Stackoverflow.com/questions/47712861', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8841544/']
I finally ended up by letting the Sundays appear (but completely disabling them). These questions inspired me : * [Moment.js - Get all mondays between a date range](https://stackoverflow.com/questions/44909662/moment-js-get-all-mondays-between-a-date-range) * [Moment.js: Date between dates](https://stackoverflow.com...
You need do changes in two functions in your daterangepicker.js file: 1. createMonthHTML() ``` function createMonthHTML(d) { var days = []; d.setDate(1); var lastMonth = new Date(d.getTime() - 86400000); var now = new Date(); var dayOfWeek = d.getDay(); if ((dayOfWeek === 0) && (opt.startOfWe...
46,977,956
Any ideas how to create like this animation on iOS using Swift ? Thanks [![enter image description here](https://i.stack.imgur.com/h49Hi.gif)](https://i.stack.imgur.com/h49Hi.gif)
2017/10/27
['https://Stackoverflow.com/questions/46977956', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5718563/']
There are three ways to achieve this (probably more than three): 1. Create a custom header and listen to your table view Scroll, then update the header based on the offset. 2. Use a third party library like this one: * <https://material.io/components/ios/catalog/flexible-headers/> 3. Follow a tutorial (there are many...
I think it's not the UINavigationBar. You could change nav bar alpha then add custom view to table view or collection view and create animation that you need when scrolling.
46,977,956
Any ideas how to create like this animation on iOS using Swift ? Thanks [![enter image description here](https://i.stack.imgur.com/h49Hi.gif)](https://i.stack.imgur.com/h49Hi.gif)
2017/10/27
['https://Stackoverflow.com/questions/46977956', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5718563/']
There are three ways to achieve this (probably more than three): 1. Create a custom header and listen to your table view Scroll, then update the header based on the offset. 2. Use a third party library like this one: * <https://material.io/components/ios/catalog/flexible-headers/> 3. Follow a tutorial (there are many...
Custom Collection view flow layout or ScrollView with UIScrollViewDelegate adjusting the header height when content offset is changing.
9,347
In the rules it is recommended for the first games to use side A of the wonders only. After these first games (if I understand the rules correctly) players play the side that is *at the top* of the wonder card they draw. So some would play side A and some side B (probably). This question discusses [if the two sides are...
2012/11/23
['https://boardgames.stackexchange.com/questions/9347', 'https://boardgames.stackexchange.com', 'https://boardgames.stackexchange.com/users/3532/']
This is a tricky one. The rulebook makes seems to specify option #3 pretty specifically: > > Shuffle the 7 Wonder cards, face down, and hand one to each player. The card **and its facing** determine the Wonders board given to each player, as well as the side to be used during the game. > > > However, when I demoe...
The sides are pretty imbalanced - with about one exception (I forget which, and depends on Leaders expansion) B is far stronger. In general it's a poorly balanced game but forcing some players to side A and some to side B only exacerbates this.
7,324,767
Look at the Twitter sign up page at <https://twitter.com/signup> Even when you click on first input field "Full name" placeholder stays there until I start typing something. That is awesome. Does anyone know of a good jQuery plugin that comes close to that?
2011/09/06
['https://Stackoverflow.com/questions/7324767', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/796723/']
One possible problem could be that the web server is running out of memory and forcing the app pool to recycle. This would flush the InProc Session memory. You could try using Sql Session State instead and see if that resolves the problem. Try monitoring the web server processes and see if they're recycling quickly.
You can place a ``` if(Session.IsNew) ``` check in your code and redirect/stop code execution appropriately.
7,324,767
Look at the Twitter sign up page at <https://twitter.com/signup> Even when you click on first input field "Full name" placeholder stays there until I start typing something. That is awesome. Does anyone know of a good jQuery plugin that comes close to that?
2011/09/06
['https://Stackoverflow.com/questions/7324767', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/796723/']
One possible problem could be that the web server is running out of memory and forcing the app pool to recycle. This would flush the InProc Session memory. You could try using Sql Session State instead and see if that resolves the problem. Try monitoring the web server processes and see if they're recycling quickly.
I would check the Performance tab in IIS to see whether a bandwidth threshold is set. 1. Right click on website in IIS 2. Performance tab 3. Check "Bandwidth throttling" limit If a treshold is set you might be hitting the maximum bandwidth (KB per second) limit. Either disable bandwidth throttling, or increase the l...
79,016
Given the case that a user is presented a modal dialog that displays an installation process (or something similar). If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? I've seen installers that disable the Cancel button and...
2015/05/20
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
It very much depends on the type of your application the operation it is doing. Ideally user should always be in control, but there are situations when you will want to keep control when you are making critical changes. Firstly, you must inform user that a following operation might take X amount of time and that she m...
If there is no safe way for the user to leave the process then you really should make them wait until it is complete. Leaving them with a faulty system is potentially more damaging to the software's reputation than making them wait for an extra 20 minutes for a correct and perfect instal. However, I assume that they'v...
79,016
Given the case that a user is presented a modal dialog that displays an installation process (or something similar). If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? I've seen installers that disable the Cancel button and...
2015/05/20
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
If there is no safe way for the user to leave the process then you really should make them wait until it is complete. Leaving them with a faulty system is potentially more damaging to the software's reputation than making them wait for an extra 20 minutes for a correct and perfect instal. However, I assume that they'v...
If possible, present the user with a "Finish Later" option on the dialog, instead of "Cancel". If the install takes longer than they want right now, or they have something important they need to do right now that the install process is interfering with, they can choose that option and then you let them continue the nex...
79,016
Given the case that a user is presented a modal dialog that displays an installation process (or something similar). If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? I've seen installers that disable the Cancel button and...
2015/05/20
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
It very much depends on the type of your application the operation it is doing. Ideally user should always be in control, but there are situations when you will want to keep control when you are making critical changes. Firstly, you must inform user that a following operation might take X amount of time and that she m...
I believe the correct action would be to explain to the user before going through with the irreversible action, that the action is irreversible. `"Doing this is permanent / This action is un-doable / You can not roll back this change" -> OK /cancel` Or something like that depending on what kind of users you have and w...
79,016
Given the case that a user is presented a modal dialog that displays an installation process (or something similar). If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? I've seen installers that disable the Cancel button and...
2015/05/20
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
I believe the correct action would be to explain to the user before going through with the irreversible action, that the action is irreversible. `"Doing this is permanent / This action is un-doable / You can not roll back this change" -> OK /cancel` Or something like that depending on what kind of users you have and w...
If possible, present the user with a "Finish Later" option on the dialog, instead of "Cancel". If the install takes longer than they want right now, or they have something important they need to do right now that the install process is interfering with, they can choose that option and then you let them continue the nex...
79,016
Given the case that a user is presented a modal dialog that displays an installation process (or something similar). If the process would normally take a few seconds but can potentially take longer, should I offer a "Cancel" button to give the user full control? I've seen installers that disable the Cancel button and...
2015/05/20
['https://ux.stackexchange.com/questions/79016', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/19337/']
It very much depends on the type of your application the operation it is doing. Ideally user should always be in control, but there are situations when you will want to keep control when you are making critical changes. Firstly, you must inform user that a following operation might take X amount of time and that she m...
If possible, present the user with a "Finish Later" option on the dialog, instead of "Cancel". If the install takes longer than they want right now, or they have something important they need to do right now that the install process is interfering with, they can choose that option and then you let them continue the nex...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
The problem is your entity version is confused with `.NetFramework` and `.NetCore`. Your application target framework is `Asp.Net Core`. So You should install package related with `Asp.net Core` In your case `'EntityFramework 6.2.0'` is supports by `.NETFramework,Version=v4.6.1'` not by `'.NETCoreApp,Version=v2.0'`. S...
Change your project to `.NETFramework,Version=v4.6.1` or choose an Entity Framework nuget that supports `.NETCoreApp,Version=v2.0`
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
Alternatively you can change your target framework to net461 as below. ``` <TargetFramework>net461</TargetFramework> ``` By changing your target framework to net461 makes you available to use .net core and full .net frameworks. I think that for this period of time, this approach is better. Because EF Core still hasn...
Change your project to `.NETFramework,Version=v4.6.1` or choose an Entity Framework nuget that supports `.NETCoreApp,Version=v2.0`
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
In my case, my project was Core 2.2. I installed (NuGet) Microsoft.EntityFrameworkCore v2.2.4 first and all built fine. Then I ACCIDENTALLY installed Microsoft.AspNet.Identity rather than Microsoft.AspNetCore.Idendity (v2.2.0). Once my eyes spotted the missing 'Core' in the .Identity package and I fixed it by uninstall...
Change your project to `.NETFramework,Version=v4.6.1` or choose an Entity Framework nuget that supports `.NETCoreApp,Version=v2.0`
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
The problem is your entity version is confused with `.NetFramework` and `.NetCore`. Your application target framework is `Asp.Net Core`. So You should install package related with `Asp.net Core` In your case `'EntityFramework 6.2.0'` is supports by `.NETFramework,Version=v4.6.1'` not by `'.NETCoreApp,Version=v2.0'`. S...
Alternatively you can change your target framework to net461 as below. ``` <TargetFramework>net461</TargetFramework> ``` By changing your target framework to net461 makes you available to use .net core and full .net frameworks. I think that for this period of time, this approach is better. Because EF Core still hasn...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
The problem is your entity version is confused with `.NetFramework` and `.NetCore`. Your application target framework is `Asp.Net Core`. So You should install package related with `Asp.net Core` In your case `'EntityFramework 6.2.0'` is supports by `.NETFramework,Version=v4.6.1'` not by `'.NETCoreApp,Version=v2.0'`. S...
I had the same problem, and was introduced by altering my solution to use a new TargetFramework. ``` <TargetFramework>netcoreapp2.2</TargetFramework> ``` After the Update I tried to add the Identity Framework but failed with a warning as described. By Adding the packages in this sequence solved it for me: ``` Mic...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
The problem is your entity version is confused with `.NetFramework` and `.NetCore`. Your application target framework is `Asp.Net Core`. So You should install package related with `Asp.net Core` In your case `'EntityFramework 6.2.0'` is supports by `.NETFramework,Version=v4.6.1'` not by `'.NETCoreApp,Version=v2.0'`. S...
In my case, my project was Core 2.2. I installed (NuGet) Microsoft.EntityFrameworkCore v2.2.4 first and all built fine. Then I ACCIDENTALLY installed Microsoft.AspNet.Identity rather than Microsoft.AspNetCore.Idendity (v2.2.0). Once my eyes spotted the missing 'Core' in the .Identity package and I fixed it by uninstall...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
Alternatively you can change your target framework to net461 as below. ``` <TargetFramework>net461</TargetFramework> ``` By changing your target framework to net461 makes you available to use .net core and full .net frameworks. I think that for this period of time, this approach is better. Because EF Core still hasn...
I had the same problem, and was introduced by altering my solution to use a new TargetFramework. ``` <TargetFramework>netcoreapp2.2</TargetFramework> ``` After the Update I tried to add the Identity Framework but failed with a warning as described. By Adding the packages in this sequence solved it for me: ``` Mic...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
Alternatively you can change your target framework to net461 as below. ``` <TargetFramework>net461</TargetFramework> ``` By changing your target framework to net461 makes you available to use .net core and full .net frameworks. I think that for this period of time, this approach is better. Because EF Core still hasn...
In my case, my project was Core 2.2. I installed (NuGet) Microsoft.EntityFrameworkCore v2.2.4 first and all built fine. Then I ACCIDENTALLY installed Microsoft.AspNet.Identity rather than Microsoft.AspNetCore.Idendity (v2.2.0). Once my eyes spotted the missing 'Core' in the .Identity package and I fixed it by uninstall...
48,201,091
I have made .net core 2.0 web app. I have added Entity Framework 6.2.0 using NUGET and then I get this error > > Package 'EntityFramework 6.2.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your proj...
2018/01/11
['https://Stackoverflow.com/questions/48201091', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2613439/']
In my case, my project was Core 2.2. I installed (NuGet) Microsoft.EntityFrameworkCore v2.2.4 first and all built fine. Then I ACCIDENTALLY installed Microsoft.AspNet.Identity rather than Microsoft.AspNetCore.Idendity (v2.2.0). Once my eyes spotted the missing 'Core' in the .Identity package and I fixed it by uninstall...
I had the same problem, and was introduced by altering my solution to use a new TargetFramework. ``` <TargetFramework>netcoreapp2.2</TargetFramework> ``` After the Update I tried to add the Identity Framework but failed with a warning as described. By Adding the packages in this sequence solved it for me: ``` Mic...
54,096,270
I do not understand why one IEnumerable.Contains() is faster than the other in the following snippet, even though they are identical. ``` public class Group { public static Dictionary<int, Group> groups = new Dictionary<int, Group>(); // Members, user and groups public List<string> Users = new List<string...
2019/01/08
['https://Stackoverflow.com/questions/54096270', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5550961/']
An interesting question. When I compiled it in .NET Framework, the execution times were about the same (I had to change the TryAdd Dictionary method to Add). In .NET Core I've got the same result as you observed. I believe the answer is deferred execution. You can see in the debugger, that the ``` IEnumerable<strin...
I figured out how to overcome the problem after reading Mikołaj's answer and Servy's comment. Thanks! ``` public class Group { public static Dictionary<int, Group> groups = new Dictionary<int, Group>(); // Members, user and groups public List<string> Users = new List<string>(); public List<int> GroupI...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
on the assumption that your needs are more like your colored example code then: ``` .box:nth-child(odd){ clear:both; } ``` if it's going to be 3 rows then `nth-child(3n+1)`
This may not be the exact solution for everybody but I find that (quite literally) thinking outside the box works for many cases: in stead of displaying the the boxes from left to right, in many cases you can fill the left column first, than go to the middle, fill that with boxes and finally fill the right column with ...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
To my knowledge, there's no way to fix this problem with pure CSS (that works in all common browsers): * Floats [don't work](http://jsfiddle.net/bCgea/). * `display: inline-block` [doesn't work](http://jsfiddle.net/bCgea/1/). * `position: relative` with `position: absolute` requires [manual pixel tuning](http://jsfidd...
With a little help from this comment ([CSS Block float left](https://stackoverflow.com/questions/4889230/css-block-float-left)) I figured out the answer. On every "row" that I make, I add a class name `left`. On every other "row" that I make, I add a class name `right`. Then I float left and float right for each o...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
As has been rightly pointed out, this is impossible with CSS alone... thankfully, I've now found a solution in <http://isotope.metafizzy.co/> It seems to solve the problem fully.
Thanks to thirtydot, I have realised my previous answer did not properly resolve the problem. Here is my second attempt, which utilizes JQuery as a CSS only solution appears impossible: ``` <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
I'm providing this answer because even when there are good ones which do provide a solution([using Masonry](http://masonry.desandro.com/)) still isn't crystal clear why it isn't possible to achieve this by using floats. (this is important - **#1**). > > A floated element will move as far to the left or right as it ...
As has been rightly pointed out, this is impossible with CSS alone... thankfully, I've now found a solution in <http://isotope.metafizzy.co/> It seems to solve the problem fully.
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
on the assumption that your needs are more like your colored example code then: ``` .box:nth-child(odd){ clear:both; } ``` if it's going to be 3 rows then `nth-child(3n+1)`
On modern browsers you can simply do: ``` display: inline-block; vertical-align: top; ```
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
With a little help from this comment ([CSS Block float left](https://stackoverflow.com/questions/4889230/css-block-float-left)) I figured out the answer. On every "row" that I make, I add a class name `left`. On every other "row" that I make, I add a class name `right`. Then I float left and float right for each o...
This may not be the exact solution for everybody but I find that (quite literally) thinking outside the box works for many cases: in stead of displaying the the boxes from left to right, in many cases you can fill the left column first, than go to the middle, fill that with boxes and finally fill the right column with ...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
I'm providing this answer because even when there are good ones which do provide a solution([using Masonry](http://masonry.desandro.com/)) still isn't crystal clear why it isn't possible to achieve this by using floats. (this is important - **#1**). > > A floated element will move as far to the left or right as it ...
Thanks to thirtydot, I have realised my previous answer did not properly resolve the problem. Here is my second attempt, which utilizes JQuery as a CSS only solution appears impossible: ``` <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
on the assumption that your needs are more like your colored example code then: ``` .box:nth-child(odd){ clear:both; } ``` if it's going to be 3 rows then `nth-child(3n+1)`
With a little help from this comment ([CSS Block float left](https://stackoverflow.com/questions/4889230/css-block-float-left)) I figured out the answer. On every "row" that I make, I add a class name `left`. On every other "row" that I make, I add a class name `right`. Then I float left and float right for each o...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
I'm providing this answer because even when there are good ones which do provide a solution([using Masonry](http://masonry.desandro.com/)) still isn't crystal clear why it isn't possible to achieve this by using floats. (this is important - **#1**). > > A floated element will move as far to the left or right as it ...
With a little help from this comment ([CSS Block float left](https://stackoverflow.com/questions/4889230/css-block-float-left)) I figured out the answer. On every "row" that I make, I add a class name `left`. On every other "row" that I make, I add a class name `right`. Then I float left and float right for each o...
5,234,749
I have infinite number of divs of a 100px width, which can fit into a 250px width parent. Regardless of height, I need the divs to be displayed in rows, as shown in the image. I've tried resolving this, but the div height seems to be screwing it up. ![enter image description here](https://i.stack.imgur.com/J5D3J.jpg) ...
2011/03/08
['https://Stackoverflow.com/questions/5234749', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/504617/']
To my knowledge, there's no way to fix this problem with pure CSS (that works in all common browsers): * Floats [don't work](http://jsfiddle.net/bCgea/). * `display: inline-block` [doesn't work](http://jsfiddle.net/bCgea/1/). * `position: relative` with `position: absolute` requires [manual pixel tuning](http://jsfidd...
On modern browsers you can simply do: ``` display: inline-block; vertical-align: top; ```
15,722,072
I have created a singup button as follows: ``` signupButton = [[UIButton alloc] initWithFrame:CGRectMake(10,(facebookLoginButton.bounds.size.height + 40),300,50)]; signupButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; UIImage *signupButtonImage = [[UIImage imageNamed:@"...
2013/03/30
['https://Stackoverflow.com/questions/15722072', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1523603/']
You don't need the starting and trailing `.*`, but you do need to escape the `$` as it has the special meaning of the zero-width end of the string. ``` \\$_POST\\['[a-zA-Z0-9]*'\\] ```
Use this: ``` "\\$_POST\\['([a-zA-Z0-9]*)'\\]" ``` Symbols like `$`have particular meanings in regex. Therefore, you need to prefix them with `\`
15,722,072
I have created a singup button as follows: ``` signupButton = [[UIButton alloc] initWithFrame:CGRectMake(10,(facebookLoginButton.bounds.size.height + 40),300,50)]; signupButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; UIImage *signupButtonImage = [[UIImage imageNamed:@"...
2013/03/30
['https://Stackoverflow.com/questions/15722072', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1523603/']
You don't need the starting and trailing `.*`, but you do need to escape the `$` as it has the special meaning of the zero-width end of the string. ``` \\$_POST\\['[a-zA-Z0-9]*'\\] ```
You can use the regex pattern given as a String with the [matches(...) method](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#matches%28java.lang.String%29) of the [String class](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#matches%28java.lang.String%29). It returns a `boolean`. ``` S...
72,120,789
I'm trying to figure out a way to detect where the cursor is in a certain range. This would be the sort of thing I'm looking for: ``` if ('bla bla bla' && Input.mousePosition == (in between x1 and x2, in between y1. and y2)) ``` Is this possible in unity, because I can't figure it out :( Thanks for any help!
2022/05/05
['https://Stackoverflow.com/questions/72120789', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16430718/']
also you can use `Rect.Contains` for Prevent dublication: ``` var InRect = new Rect(0, 0, Screen.width/2, Screen.height).Contains(Input.mousePosition); UnityEngine.Debug.Log(InRect); ```
``` Vector2 mousePos = Input.mousePosition; ``` This returns a `Vector2` with the coordinates `x` and `y` of the mouse position. To check if this point with the coordinates `mousePos.x` and `mousePos.y` lies in the range `x1` and `x2`; `y1` and `y2`, we can write ``` if((mousePos.x >= x1 && mousePos.x <= x2) && (...
10,650,165
I'm working on a scripting language and would like to write a compiler / interpreter for my language. I've desited to do the compiler in standart ML My question now is, is there a "pattern" for doing this sorta design process? I've written a java-compiler from scratch as a part of a computerscience course, but that...
2012/05/18
['https://Stackoverflow.com/questions/10650165', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/750186/']
The classic books on modern compiler construction in functional languages are: * [Modern Compiler Implementation in ML](http://www.cs.princeton.edu/~appel/modern/ml/) * [Types and Programming Languages](http://www.cis.upenn.edu/~bcpierce/tapl/) * [Implementing Functional Languages](http://research.microsoft.com/en-us/...
[Concepts, Techniques and Models of Computer Programming](https://rads.stackoverflow.com/amzn/click/com/0262220695). This book is not directly about how to design a language, but it is an in-depth exploration of the features of one interesting language (Oz), how they interact, and how they enable various usage patterns...
24,808,853
I have several lists and I need to do something with each possible combination of these list items. In the case of two lists, I can do: ``` for a in alist: for b in blist: # do something with a and b ``` However, if there are more lists, say 6 or 7 lists, this method seems reluctant. Is there any way to elegan...
2014/07/17
['https://Stackoverflow.com/questions/24808853', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150462/']
You could use `itertools.product` to make all possible combinations from your lists. The result will be one long list of `tuple` with an element from each list in the order you passed the list in. ``` >>> a = [1,2,3] >>> b = ['a', 'b', 'c'] >>> c = [4,5,6] >>> import itertools >>> list(itertools.product(a,b,c)) [(1, ...
If there are in fact 6 or 7 lists, it's probably worth going to `itertools.product` for readability. But for simple cases it's straightforward to use a [list comprehension](https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions), and it requires no imports. For example: ``` alist = [1, 2, 3] blist ...
556,808
I have a table like this (the `C` column is blank): ``` A B C 1 19:30 23:00 (3.50) 2 14:15 18:30 (4.25) ``` I need to calculate the time difference in each row between column `A` and column `B` (always `B` - `A`), and put it in column `C` as a decimal number (as show...
2013/02/24
['https://superuser.com/questions/556808', 'https://superuser.com', 'https://superuser.com/users/165729/']
If you use MOD that will also work when the times cross midnight, e.g. in C2 `=MOD(B2-A2,1)*24` copy formula down column and the row numbers will change automaticaly for each row
This will do the job: ``` =(B1-A1)*24 ``` You might need to format the cell as number, not time!
67,169,129
I want to exclude only If ColumnA = 'SA' exclude ColumnB not like '%Prev%' and ColumnB not like '%old%'. If columnA = 'BA' I want to keep them. exp: > > > ``` > select columnA > from Table > where columnA ='SA' and ColumnB not like '%Prev%' and ColumnB not like '%old%' > > ``` > >
2021/04/19
['https://Stackoverflow.com/questions/67169129', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5661085/']
You are trying to perform Integer operation on a list. 'lengths' is an ArrayList and operation % is non applicable to it. Also, I think you shouldn't use cloning here and just iterate over `list` and check if each element is odd - print it or add to another list if it is.
modify lengths methods ``` public static void main(String []args){ ArrayList<String> list = new ArrayList<String>(); list.add("yoy"); list.add("lmao"); list.add("lol"); list.add("kk"); list.add("bbb"); ArrayList<String> lengths = lengths(list); ...
67,169,129
I want to exclude only If ColumnA = 'SA' exclude ColumnB not like '%Prev%' and ColumnB not like '%old%'. If columnA = 'BA' I want to keep them. exp: > > > ``` > select columnA > from Table > where columnA ='SA' and ColumnB not like '%Prev%' and ColumnB not like '%old%' > > ``` > >
2021/04/19
['https://Stackoverflow.com/questions/67169129', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5661085/']
It's better to implement a separate method that copies the strings with odd length: ```java public static List<String> oddLengths(List<String> list) { List<String> result = new ArrayList<>(); for (String s : list) { if (s.length() % 2 != 0) { result.add(s); } } return result...
modify lengths methods ``` public static void main(String []args){ ArrayList<String> list = new ArrayList<String>(); list.add("yoy"); list.add("lmao"); list.add("lol"); list.add("kk"); list.add("bbb"); ArrayList<String> lengths = lengths(list); ...
865,774
I am trapping a `KeyDown` event and I need to be able to check whether the current keys pressed down are : `Ctrl` + `Shift` + `M` ? --- I know I need to use the `e.KeyData` from the `KeyEventArgs`, the `Keys` enum and something with Enum Flags and bits but I'm not sure on how to check for the combination.
2009/05/14
['https://Stackoverflow.com/questions/865774', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44084/']
You need to use the [Modifiers](http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.modifiers.aspx) property of the KeyEventArgs class. Something like: ``` //asumming e is of type KeyEventArgs (such as it is // on a KeyDown event handler // .. bool ctrlShiftM; //will be true if the combination ...
You can check using a technique similar to the following: ``` if(Control.ModifierKeys == Keys.Control && Control.ModifierKeys == Keys.Shift) ``` This in combination with the normal key checks will give you the answer you seek.
865,774
I am trapping a `KeyDown` event and I need to be able to check whether the current keys pressed down are : `Ctrl` + `Shift` + `M` ? --- I know I need to use the `e.KeyData` from the `KeyEventArgs`, the `Keys` enum and something with Enum Flags and bits but I'm not sure on how to check for the combination.
2009/05/14
['https://Stackoverflow.com/questions/865774', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44084/']
You need to use the [Modifiers](http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.modifiers.aspx) property of the KeyEventArgs class. Something like: ``` //asumming e is of type KeyEventArgs (such as it is // on a KeyDown event handler // .. bool ctrlShiftM; //will be true if the combination ...
I think its easiest to use this: `if(e.KeyData == (Keys.Control | Keys.G))`
865,774
I am trapping a `KeyDown` event and I need to be able to check whether the current keys pressed down are : `Ctrl` + `Shift` + `M` ? --- I know I need to use the `e.KeyData` from the `KeyEventArgs`, the `Keys` enum and something with Enum Flags and bits but I'm not sure on how to check for the combination.
2009/05/14
['https://Stackoverflow.com/questions/865774', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/44084/']
I think its easiest to use this: `if(e.KeyData == (Keys.Control | Keys.G))`
You can check using a technique similar to the following: ``` if(Control.ModifierKeys == Keys.Control && Control.ModifierKeys == Keys.Shift) ``` This in combination with the normal key checks will give you the answer you seek.
17,608,853
I would like a for loop in jquery using `.html()` like this: ``` .html('<select property="doctype" name="doctype"><%for (String number : list) {%>'<option value="'<%=number%>'>'<%out.println(number); %>'</option>'<% } %>'</select>'); ``` In Java's for each loop list it uses an object of `java.util.ArrayList<String>`...
2013/07/12
['https://Stackoverflow.com/questions/17608853', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2147478/']
``` <nav id="nav-single"> <?php $prev_post = get_previous_post(); $id = $prev_post->ID ; $permalink = get_permalink( $id ); ?> <?php $next_post = get_next_post(); $nid = $next_post->ID ; $permalink = get_permalink($nid); ?> <span class="nav-previo...
I hope you are using this code in single.php from where the whole of the post is displayed. For displaying the links (Next/Prev), you need to check the function. ``` get_template_part() in the same file (Single.php of your theme). In my case function in single.php has been passes parameters like <?php get_template_p...
64,634,372
I develop an Angular app based on ASP.NET Core and there is some settings in `launchSettings.json` in order to run the app with the given ports as shown below: ``` "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { "DOTNET_ENVIRONMENT"...
2020/11/01
['https://Stackoverflow.com/questions/64634372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/836018/']
If you want to do this the VS Code way, as long as you use F5 (or the Run > "Start Debugging" command), it's as simple as changing the `launch.json` file from this: ```json ... "env": { "ASPNETCORE_ENVIRONMENT": "Development" }, ... ``` to this: ```json ... "env": { "ASPNETCORE_ENVIRONMENT": "Development", ...
Running from command line execute `Kastrel` server not `IIS`. In that case probably configuration `appsettings.json` is use. You can put in this configuration section to control port: ``` "Kestrel": { "Endpoints": { "HTTP": { "Url": "http://localhost:6000" } ...
26,085,466
How can I shorten this function, so I don't need any of these `if`? ``` function showhide(element) { $('body').on('click', '#'+element, function() { if(element == 'export') { $('.chat-export').toggle(); $('.chat-settings').hide(); $('.chat-users').hide(); } else...
2014/09/28
['https://Stackoverflow.com/questions/26085466', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/718990/']
Just do this: ``` $('[class^=chat]').each(function(){ if($(this).attr("class").indexOf(element) > -1){ $(this).toggle(); } else { $(this).hide(); } }); ``` PS. The problem with my early code and antyrat's code is that when we hide everything, the toggle works unexpectedly. [**DEMO**](http://jsfiddle.net/f3...
You can avoid this using this [`regex`](http://james.padolsey.com/javascript/regex-selector-for-jquery/) selector snippet for example: ``` $( 'div:regex(class, .chat-*)' ).hide(); $( '.chat-' + element ).toggle(); ```
35,957,207
I got an error "android.database.CursorIndexOutOfBoundsException: Index 20 requested, with a size of 20" and I can't understand what exactly caused it and how to fix it? Probably something wrong with c.moveToFirst() and c.moveToNext(). ``` public class MainActivity extends AppCompatActivity { Map<Integer, String>...
2016/03/12
['https://Stackoverflow.com/questions/35957207', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5427240/']
Change the below lines to ``` c.moveToFirst(); while (c!= null){ Log.i("articleIdIndex", Integer.toString(c.getInt(articleIdIndex))); Log.i("articleUrl",c.getString(urlIndex) ); Log.i("titleTitle",c.getString(titleIndex)); c.moveToNext(); } ``` to ``` while (c.moveToNext()) { Log.i("articleIdIn...
Change the below code ``` Cursor c = articlesDB.rawQuery("SELECT * FROM articles",null); int articleIdIndex = c.getColumnIndex("articleId"); int urlIndex = c.getColumnIndex("url"); int titleIndex = c.getColumnIndex("title"); c.moveToFirst(); while (c!= null){ Log.i("articleIdIndex", Integer.toString(c.getInt(articleI...
13,362,921
According to AngularJS's tutorial, a controller function just sits within the global scope. <http://docs.angularjs.org/tutorial/step_04> Do the controller functions themselves automatically get parsed into an encapsulated scope, or do they dwell within the global scope? I know that they are passed a reference to the...
2012/11/13
['https://Stackoverflow.com/questions/13362921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1707160/']
AngularJS supports 2 methods of registering controller functions - either as globally accessible functions (you can see this form in the mentioned tutorial) or as a part of a modules (that forms a kind of namespace). More info on modules can be found here: <http://docs.angularjs.org/guide/module> but in short one would...
You can register a controller as part of a module, as answered by [pkozlowski-opensource](https://stackoverflow.com/a/13363482/1957398). If you need minification you can simply extend this by providing the variable names before the actual function in a list: ``` angular.module('[module name]', []). controller('Phon...