qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
63,700,826 | SQL Query taking too much time to execute. Working fine at UAT. I need to compare data of two tables and want to get difference. Below mention is my query.
```
Select *
from tblBrandDetailUsers tbdu
inner join tblBrands tbs on tbs.BrandId = tbdu.BrandId
left join tblBrandDetails tbd on tbd.CategoryId = tbdu.CategoryI... | 2020/09/02 | [
"https://Stackoverflow.com/questions/63700826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14207128/"
] | a number of things you need to check:
1. number of rows for each table. the more rows you have the slower it gets. Do you have the same size of data with UAT?
2. `SELECT *` : avoid the `*` and only retrieve columns you need.
3. `ISNULL` function on left side of the `WHERE` predicate will scan the index because it is [... | as other suggested, try to add index on columns used for joins |
39,410,507 | I'm developing E-Commerce website using Wordpress and Woocommerce plugins.
I've installed yith Woocommerce wishlist plugin for user to add product in wishlist, it's display unit product cost, add to cart button and product image.
**I want to display Total product cost added in wishlist** and for that add to cart butto... | 2016/09/09 | [
"https://Stackoverflow.com/questions/39410507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6234150/"
] | To display Total product cost with YITH Woocommerce Wishlist plugin, you can do this with Jquery :
```
var myArray = $(".wishlist_table .amount"); // Recover all product cost
var result = 0;
for (var i = 0; i<myArray.length; i++) {
result += parseFloat(myArray[i].childNodes["0"].data); // Make the sum
}
$("#som")... | I am not sure which wishlist plugin you're using as there are a few wishlist plugins.
However, I have written a solution for this while using [YITH Woocommerce Wishlist plugin](https://wordpress.org/plugins/yith-woocommerce-wishlist/). Sharing that code here if that helps.
```
function tnc_wishlist_summary_cart(){
... |
14,860,845 | I have this piece of HTML
```
<div id="workflowEditor" class="workflow-editor">
<div class="node" class="ui-widget" style="top:20px; left:40px;">
<div class="ui-widget ui-widget-header ui-state-default">Header test</div>
<div class="ui-widget ui-widget-content">Test Content</div>
</div>
</div... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14860845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/320700/"
] | calculating the boundaries of the node and its parent, please check the [jsFiddle Link](http://jsfiddle.net/rachit_doshi/FhNtt/3/)
as per the explanations at [Jquery UI](http://jqueryui.com/draggable/#constrain-movement)
```
var containmentX1 = $(".node").parent().offset().left;
var containmentY1 = $(".node").parent(... | I've had a similar problem - I needed to position "boxes" inside a container, allowing them to overflow to the bottom or the right, but not to the left or top. I also had to support varying the container's position.
Unfortunately, I could not find an elegant solution. As you correctly note, setting the containment via... |
73,513,629 | I want to send bulk Emails by using MailKit.Net.Smtp, using MimeKit.
I get email lists and email body data like (feeamount and feetype), these two fields send to the same row email address.
Code to get list and data:
```
public IActionResult FeeNotification(int? id)
{
var ids = _context.FeeEntry
... | 2022/08/27 | [
"https://Stackoverflow.com/questions/73513629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19516952/"
] | try this
```
npm install @material-ui/core @material-ui/icons @material-ui/lab @react-google-maps/api axios google-map-react --force
```
or try to install packages once at a time. That way you can understand which one causing problem with *peer dependency* | `@material-ui/core` depends on react ^16.8 or ^17.0, you installed react 18.2
Try the new material-ui v5:
```
npm install @mui/material @emotion/react @emotion/styled
```
<https://mui.com/> |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | I needed a way to change the stroke color of any `GradientDrawable` without knowing the width of the stroke. My goal was to do this using `Drawable.setTint`. I had to add a transparent `solid` element to my `shape` xml to get it to work:
```xml
<!-- stroke_background.xml -->
<?xml version="1.0" encoding="utf-8"?>
<sha... | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... | I answered a similar question in [Change shape border color at runtime](https://stackoverflow.com/questions/13585496/change-shape-border-color-at-runtime)
Its like the same solution proposed by f20k but in my case the drawable was a GradientDrawable instead of a ShapeDrawable.
see if it works... |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | *1. If you have drawable file for a "view" like this*
```
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="5dp" />
<solid android:color="@android:color/white" />
<stroke
android:width="3px"
android:color="@color/blue" />
</s... | Perhaps they are referring to [Color State Lists](http://developer.android.com/reference/android/content/res/ColorStateList.html) which allows you to change the color based on whether the button was pressed/focused/enabled/etc |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | Try using StateLists (as opposed to ColorStateList). Take a look:
<http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList>
You can also create a `ShapeDrawable` (or a `RoundRectShape` in your example) programmatically, and then call the button's `setBackgroundDrawable` | Perhaps they are referring to [Color State Lists](http://developer.android.com/reference/android/content/res/ColorStateList.html) which allows you to change the color based on whether the button was pressed/focused/enabled/etc |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... | Perhaps they are referring to [Color State Lists](http://developer.android.com/reference/android/content/res/ColorStateList.html) which allows you to change the color based on whether the button was pressed/focused/enabled/etc |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | I needed a way to change the stroke color of any `GradientDrawable` without knowing the width of the stroke. My goal was to do this using `Drawable.setTint`. I had to add a transparent `solid` element to my `shape` xml to get it to work:
```xml
<!-- stroke_background.xml -->
<?xml version="1.0" encoding="utf-8"?>
<sha... | Create background (file in `res/drawable`) with transparent (`#00000000`) solid:
```
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<stroke
android:width="1dp"
android:col... |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... | Try using StateLists (as opposed to ColorStateList). Take a look:
<http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList>
You can also create a `ShapeDrawable` (or a `RoundRectShape` in your example) programmatically, and then call the button's `setBackgroundDrawable` |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | I needed a way to change the stroke color of any `GradientDrawable` without knowing the width of the stroke. My goal was to do this using `Drawable.setTint`. I had to add a transparent `solid` element to my `shape` xml to get it to work:
```xml
<!-- stroke_background.xml -->
<?xml version="1.0" encoding="utf-8"?>
<sha... | Perhaps they are referring to [Color State Lists](http://developer.android.com/reference/android/content/res/ColorStateList.html) which allows you to change the color based on whether the button was pressed/focused/enabled/etc |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... | Create background (file in `res/drawable`) with transparent (`#00000000`) solid:
```
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<stroke
android:width="1dp"
android:col... |
4,772,537 | I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to u... | 2011/01/23 | [
"https://Stackoverflow.com/questions/4772537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/528130/"
] | *1. If you have drawable file for a "view" like this*
```
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="5dp" />
<solid android:color="@android:color/white" />
<stroke
android:width="3px"
android:color="@color/blue" />
</s... | Please look at the [LayerDrawable](https://developer.android.com/reference/android/graphics/drawable/LayerDrawable) because it created from your XML and used at runtime.
Here is a Demo Example:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectang... |
47,963,519 | A friend sent me a Jupyter notebook with the below code:
```
for stock_df, allo in zip((aapl, cisco, ibm, amzn), [.3,.2,.4,.1]):
stock_df['Allocation'] = stock_df['NormedReturn']*allo
```
I understand the output as it creates a new column 'Allocation' in each dataframe 'aapl', 'cisco'... and applies weights to t... | 2017/12/24 | [
"https://Stackoverflow.com/questions/47963519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5281845/"
] | The key bit of Python syntax here is the [**`zip()`**](https://docs.python.org/3/library/functions.html#zip) function.
From the documentation, we can see that this:
>
> Returns an iterator of `tuples`, where the `i-th` tuple contains the `i-th` element from each of the argument sequences or `iterables`.
>
>
>
S... | This looks like a portfolio diversification kind of code. The aapl, cisco, ibm and amzn are DataFrames containing at least a NormedReturn field.
```
aapl = pd.DataFrame({'NormedReturn':[1,2,3]})
cisco = pd.DataFrame({'NormedReturn':[4,5,6]})
ibm = pd.DataFrame({'NormedReturn':[7,8,9]})
amzn = pd.DataFrame({'NormedRetu... |
15,253,779 | I have a `UITableView` that gets populated via an array (`tableArray`), who gets populated from core data.
each `UITableViewCell` gets assigned a number at creation time and the numbers are stored in an array. (`numberArray`)
when the user reorders the rows, the numbers get moved around in the array (in conjunction... | 2013/03/06 | [
"https://Stackoverflow.com/questions/15253779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2072789/"
] | Why don't you leave the `tableArray` unchanged, and use the `numberArray` as an *index* into the other array.
You would initialize the `numberArray` to `0, 1, 2, ..., n-1` with
```
numberArray = [NSMutableArray array];
for (NSUInteger i = 0; i < [tableArray count]; i++) {
[numberArray addObject:[NSNumber numberW... | ```
NSMutableArray *unsortedArray = [NSMutableArray arrayWithObjects:@"1) hi",@"2) whats Up",@"3) this",@"4) is cool!",nil];
NSArray *guideArray = [NSArray arrayWithObjects:@"2",@"4",@"3",@"1", nil];
for(int i=0; i< [guideArray count];i++)
{
for(int j=0; j< [unsortedArray count];j++)
{
if([[[unsortedAr... |
15,253,779 | I have a `UITableView` that gets populated via an array (`tableArray`), who gets populated from core data.
each `UITableViewCell` gets assigned a number at creation time and the numbers are stored in an array. (`numberArray`)
when the user reorders the rows, the numbers get moved around in the array (in conjunction... | 2013/03/06 | [
"https://Stackoverflow.com/questions/15253779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2072789/"
] | Why don't you leave the `tableArray` unchanged, and use the `numberArray` as an *index* into the other array.
You would initialize the `numberArray` to `0, 1, 2, ..., n-1` with
```
numberArray = [NSMutableArray array];
for (NSUInteger i = 0; i < [tableArray count]; i++) {
[numberArray addObject:[NSNumber numberW... | I cant see a way to solve it with a predicate
```
NSArray *stringArray = @[@"hi", @"what's up?", @"this", @"is cool"];
NSArray *numberArray = @[@2, @4, @3, @1];
NSMutableArray *combinedArray = [NSMutableArray array];
//connect string with the numbers of there new position
[numberArray enumerateObjectsUsingBlock:^(id ... |
9,032 | Is automatic theorem proving and proof searching easier in linear and other propositional substructural logics which lack contraction?
Where can I read more about automatic theorem proving in these logics and the role of contraction in proof search? | 2011/11/19 | [
"https://cstheory.stackexchange.com/questions/9032",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/14197/"
] | Other resources could be found referenced in Kaustuv Chaudhuri's thesis "[The Focused Inverse Method for Linear Logic](http://www.lix.polytechnique.fr/~kaustuv/papers/chaudhuri06thesis.pdf)", and you might be interested in Roy Dyckhoff's "[Contraction-Free Sequent Calculi](http://www.jstor.org/pss/2275431)", which is a... | Perhaps Dale Miller's [Overview of linear logic programming](http://www.lix.polytechnique.fr/~dale/papers/llp.pdf) is a good strarting point? |
9,032 | Is automatic theorem proving and proof searching easier in linear and other propositional substructural logics which lack contraction?
Where can I read more about automatic theorem proving in these logics and the role of contraction in proof search? | 2011/11/19 | [
"https://cstheory.stackexchange.com/questions/9032",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/14197/"
] | No, it is only ever harder.
Just as the decision problem for intuitionistic propositional logic is harder than of classical propositional logic, so to is linear propositional logic harder still. With either exponentials (which don't lack contraction) or various flavours of noncommutative connective, the logic becomes ... | Perhaps Dale Miller's [Overview of linear logic programming](http://www.lix.polytechnique.fr/~dale/papers/llp.pdf) is a good strarting point? |
9,032 | Is automatic theorem proving and proof searching easier in linear and other propositional substructural logics which lack contraction?
Where can I read more about automatic theorem proving in these logics and the role of contraction in proof search? | 2011/11/19 | [
"https://cstheory.stackexchange.com/questions/9032",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/14197/"
] | Assuming that the complexity of the provability problem would satisfy you, the landscape of complexities of substructural logics with and without contraction is somewhat complex. I'll try to survey here what is known for propositional linear logic and propositional logic. The short answer is that contraction sometimes ... | Perhaps Dale Miller's [Overview of linear logic programming](http://www.lix.polytechnique.fr/~dale/papers/llp.pdf) is a good strarting point? |
9,032 | Is automatic theorem proving and proof searching easier in linear and other propositional substructural logics which lack contraction?
Where can I read more about automatic theorem proving in these logics and the role of contraction in proof search? | 2011/11/19 | [
"https://cstheory.stackexchange.com/questions/9032",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/14197/"
] | Other resources could be found referenced in Kaustuv Chaudhuri's thesis "[The Focused Inverse Method for Linear Logic](http://www.lix.polytechnique.fr/~kaustuv/papers/chaudhuri06thesis.pdf)", and you might be interested in Roy Dyckhoff's "[Contraction-Free Sequent Calculi](http://www.jstor.org/pss/2275431)", which is a... | No, it is only ever harder.
Just as the decision problem for intuitionistic propositional logic is harder than of classical propositional logic, so to is linear propositional logic harder still. With either exponentials (which don't lack contraction) or various flavours of noncommutative connective, the logic becomes ... |
9,032 | Is automatic theorem proving and proof searching easier in linear and other propositional substructural logics which lack contraction?
Where can I read more about automatic theorem proving in these logics and the role of contraction in proof search? | 2011/11/19 | [
"https://cstheory.stackexchange.com/questions/9032",
"https://cstheory.stackexchange.com",
"https://cstheory.stackexchange.com/users/14197/"
] | Other resources could be found referenced in Kaustuv Chaudhuri's thesis "[The Focused Inverse Method for Linear Logic](http://www.lix.polytechnique.fr/~kaustuv/papers/chaudhuri06thesis.pdf)", and you might be interested in Roy Dyckhoff's "[Contraction-Free Sequent Calculi](http://www.jstor.org/pss/2275431)", which is a... | Assuming that the complexity of the provability problem would satisfy you, the landscape of complexities of substructural logics with and without contraction is somewhat complex. I'll try to survey here what is known for propositional linear logic and propositional logic. The short answer is that contraction sometimes ... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | I'm pretty sure that if you use `Network.HTTP` with the `String` type, it converts bytes to characters using your system encoding, which is, in general, wrong.
This is only one of several reasons I don't like `Network.HTTP`.
Your options:
1. Use the `Bytestring` interface. It's more awkward for some reason. It'll a... | This program produces the same output as the curl command:
```
curl "http://www.piaotian.net/html/7/7430/"
```
Test with:
```
stack program > out.html
open out.html
```
(If not using `stack`, just install the `wreq` and `lens` packages and execute with `runhaskell`.)
```
#!/usr/bin/env stack
-- stack --resolver ... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | I'm pretty sure that if you use `Network.HTTP` with the `String` type, it converts bytes to characters using your system encoding, which is, in general, wrong.
This is only one of several reasons I don't like `Network.HTTP`.
Your options:
1. Use the `Bytestring` interface. It's more awkward for some reason. It'll a... | Since you said you are interested in just the links, there is no need to convert the GBK encoding to Unicode.
Here is a version which prints out all links like "123456.html" in the document:
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens
--package tagsoup... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | If you just want to download the file, e.g. to look at later, you just need to use the ByteString interface. It would be better to use `http-client` for this (or `wreq` if you have some lens knowledge). Then you can open it in your browser, which will see that it is a gbk file. So far, you would just be transferring th... | This program produces the same output as the curl command:
```
curl "http://www.piaotian.net/html/7/7430/"
```
Test with:
```
stack program > out.html
open out.html
```
(If not using `stack`, just install the `wreq` and `lens` packages and execute with `runhaskell`.)
```
#!/usr/bin/env stack
-- stack --resolver ... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | Here is an updated answer which uses the `encoding` package
to convert the GBK encoded contents to Unicode.
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens --package encoding --package binary
-}
{-# LANGUAGE OverloadedStrings #-}
import Network.Wreq
import ... | This program produces the same output as the curl command:
```
curl "http://www.piaotian.net/html/7/7430/"
```
Test with:
```
stack program > out.html
open out.html
```
(If not using `stack`, just install the `wreq` and `lens` packages and execute with `runhaskell`.)
```
#!/usr/bin/env stack
-- stack --resolver ... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | Since you said you are interested in just the links, there is no need to convert the GBK encoding to Unicode.
Here is a version which prints out all links like "123456.html" in the document:
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens
--package tagsoup... | This program produces the same output as the curl command:
```
curl "http://www.piaotian.net/html/7/7430/"
```
Test with:
```
stack program > out.html
open out.html
```
(If not using `stack`, just install the `wreq` and `lens` packages and execute with `runhaskell`.)
```
#!/usr/bin/env stack
-- stack --resolver ... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | If you just want to download the file, e.g. to look at later, you just need to use the ByteString interface. It would be better to use `http-client` for this (or `wreq` if you have some lens knowledge). Then you can open it in your browser, which will see that it is a gbk file. So far, you would just be transferring th... | Since you said you are interested in just the links, there is no need to convert the GBK encoding to Unicode.
Here is a version which prints out all links like "123456.html" in the document:
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens
--package tagsoup... |
38,701,016 | I was wondering if I can write a Haskell program to check updates of some novels on demand, and the website I am using as an example is [this](http://www.piaotian.net/html/7/7430/). And I got a problem when displaying the contents of it (on a mac el capitan). The simple codes follow:
```
import Network.HTTP
openURL :... | 2016/08/01 | [
"https://Stackoverflow.com/questions/38701016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429327/"
] | Here is an updated answer which uses the `encoding` package
to convert the GBK encoded contents to Unicode.
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens --package encoding --package binary
-}
{-# LANGUAGE OverloadedStrings #-}
import Network.Wreq
import ... | Since you said you are interested in just the links, there is no need to convert the GBK encoding to Unicode.
Here is a version which prints out all links like "123456.html" in the document:
```
#!/usr/bin/env stack
{- stack
--resolver lts-6.0 --install-ghc runghc
--package wreq --package lens
--package tagsoup... |
29,649,671 | I want to find out if a specific word comes before another. Partial words are not a match.
Some example tests:
>
> “Hi my name is AB, I’m from London and I love it here ..."
>
>
>
```
if "from" is before "Hi" -> return false
if "Hi" is before "AB" -> return true
``` | 2015/04/15 | [
"https://Stackoverflow.com/questions/29649671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098019/"
] | ```
yourString.matches(".*? Hi\\b.*? AB\\b.*")
```
This will make sure that you have spaces in between and you're matching whole words.
If you're dealing with latin american stuff where puncuation can come before words, this is more general
```
yourString.matches(".*?\\bHi\\b.*?\\bAB\\b.*")
```
Breaking that down... | You can take a look at the [`indexOf(String string)`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#indexOf-java.lang.String-), which returns an integer denoting the position of the substring, or -1 if not found. You could use that to see which strings preceeds another. |
29,649,671 | I want to find out if a specific word comes before another. Partial words are not a match.
Some example tests:
>
> “Hi my name is AB, I’m from London and I love it here ..."
>
>
>
```
if "from" is before "Hi" -> return false
if "Hi" is before "AB" -> return true
``` | 2015/04/15 | [
"https://Stackoverflow.com/questions/29649671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098019/"
] | There are several ways of doing this:
* **Use [`indexOf`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String))** - this is perhaps the simplest approach. Get indexes of the strings, and compare them. The string with a lower indexs is before the other string
* **Use regular expressi... | You can take a look at the [`indexOf(String string)`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#indexOf-java.lang.String-), which returns an integer denoting the position of the substring, or -1 if not found. You could use that to see which strings preceeds another. |
29,649,671 | I want to find out if a specific word comes before another. Partial words are not a match.
Some example tests:
>
> “Hi my name is AB, I’m from London and I love it here ..."
>
>
>
```
if "from" is before "Hi" -> return false
if "Hi" is before "AB" -> return true
``` | 2015/04/15 | [
"https://Stackoverflow.com/questions/29649671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098019/"
] | ```
yourString.matches(".*? Hi\\b.*? AB\\b.*")
```
This will make sure that you have spaces in between and you're matching whole words.
If you're dealing with latin american stuff where puncuation can come before words, this is more general
```
yourString.matches(".*?\\bHi\\b.*?\\bAB\\b.*")
```
Breaking that down... | You can use `indexOf` method and get the first occurrence of each word and then check. For example:
```
String sentence = "Hi my name is AB, I’m from London and I love it here …";
int fromIndex = sentence.indexOf("from");
int hiIndex = sentence.indexOf("Hi");
if (fromIndex < hiIndex)
System.out.println("false")... |
29,649,671 | I want to find out if a specific word comes before another. Partial words are not a match.
Some example tests:
>
> “Hi my name is AB, I’m from London and I love it here ..."
>
>
>
```
if "from" is before "Hi" -> return false
if "Hi" is before "AB" -> return true
``` | 2015/04/15 | [
"https://Stackoverflow.com/questions/29649671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098019/"
] | ```
yourString.matches(".*? Hi\\b.*? AB\\b.*")
```
This will make sure that you have spaces in between and you're matching whole words.
If you're dealing with latin american stuff where puncuation can come before words, this is more general
```
yourString.matches(".*?\\bHi\\b.*?\\bAB\\b.*")
```
Breaking that down... | There are several ways of doing this:
* **Use [`indexOf`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String))** - this is perhaps the simplest approach. Get indexes of the strings, and compare them. The string with a lower indexs is before the other string
* **Use regular expressi... |
29,649,671 | I want to find out if a specific word comes before another. Partial words are not a match.
Some example tests:
>
> “Hi my name is AB, I’m from London and I love it here ..."
>
>
>
```
if "from" is before "Hi" -> return false
if "Hi" is before "AB" -> return true
``` | 2015/04/15 | [
"https://Stackoverflow.com/questions/29649671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098019/"
] | There are several ways of doing this:
* **Use [`indexOf`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String))** - this is perhaps the simplest approach. Get indexes of the strings, and compare them. The string with a lower indexs is before the other string
* **Use regular expressi... | You can use `indexOf` method and get the first occurrence of each word and then check. For example:
```
String sentence = "Hi my name is AB, I’m from London and I love it here …";
int fromIndex = sentence.indexOf("from");
int hiIndex = sentence.indexOf("Hi");
if (fromIndex < hiIndex)
System.out.println("false")... |
31,297,604 | I'm trying too use JavaScripts "replace"-function to put tags around text given in between certain characters. Example:
```
str.replace(/\_(.*?)\_/gi, '<u>$1</u>');
```
Now this works fine but I want the "\_"-characters to be given as a variable.
For example:
```
var und = "_";
str.replace(/\und(.*?)\und/gi, '<u>$1... | 2015/07/08 | [
"https://Stackoverflow.com/questions/31297604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3081076/"
] | You will need to use `RegExp` constructor to construct a regex from variable:
```
var und = "_";
var re = new RegExp(und + '(.*?)' + und, "gi");
var repl = str.replace(re, '<u>$1</u>');
``` | You want to use [`new RegExp(pattern, flags)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) to build the regular expression from a string. |
2,426,442 | I have the following program that creates 100 random elements trough a array.
Those 100 random value's are unique, and every value only gets displayed once.
Although with the linear search it keeps looking up the entire array.
How would i be able to get a **Jagged Array** into this, so it only "scans" the remaining pl... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2426442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291630/"
] | So it looks as though you want to fill your array, and you want to guarantee that each item in it is unique? If so, put each number that you generate into a Hashset. Lookups on the hashset are O(1), (or maybe logarithmic) -- you can put a million items into it, and still have extremely high performance lookups. | I'm not certain if this is what you were looking for, but here is a snippet of code that fills an array with a set of unique random numbers within a range. As JMarsch suggested, it uses a HashSet to keep track of the numbers that are used.
It also makes a quick check to be certain that the problem is solvable - if Ran... |
2,426,442 | I have the following program that creates 100 random elements trough a array.
Those 100 random value's are unique, and every value only gets displayed once.
Although with the linear search it keeps looking up the entire array.
How would i be able to get a **Jagged Array** into this, so it only "scans" the remaining pl... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2426442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291630/"
] | So it looks as though you want to fill your array, and you want to guarantee that each item in it is unique? If so, put each number that you generate into a Hashset. Lookups on the hashset are O(1), (or maybe logarithmic) -- you can put a million items into it, and still have extremely high performance lookups. | ```
static int[] FillArray(int low, int high, int count)
{
Random rand = new Random();
HashSet<int> Data = new HashSet<int>();
while (Data.Count() < count)
Data.Add(rand.Next(low, high));
return Data.ToArray();
}
```
This is similar to what JMarsch was suggesting. H... |
445,860 | I have a thesis template I created during my studies. And for my master thesis, I want to add some "neat looking" design to it.
I'm going for figures in the margin, as well as side nodes. Simply accomplished with the `geometry` package. However, for my chapter styles, I am at a loss.
I would like my numbers to appear... | 2018/08/13 | [
"https://tex.stackexchange.com/questions/445860",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/168374/"
] | Some box juggling:
```
\RequirePackage{fix-cm} % if you want to use Computer Modern
\documentclass[
10pt,
twoside,
openright,
]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{lipsum}
\usepackage[
includemp,
a4paper,
top=2.170cm,
bottom=2.510cm,
inner=2.1... | Here is a solution which works, thanks to the `explicit` option of `titlesec` and the use of a `tabularx`. I added some colour (personal taste) but it's easy to remove. Also, don't forget to define `\titleformat` for unnumbered chapters (e.g. bibliography), as part of this code is meaningless for them.
```
\documentcl... |
158,743 | I cannot see new customers in my M2 backend customers list and I figure out it's happening because my "Customer Grid" is not reindexed(Reindex required), Here is manual method to re-index CLI: `php bin/magento indexer:reindex` but how to make reindex automatically? like cronjob? | 2017/02/08 | [
"https://magento.stackexchange.com/questions/158743",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/38379/"
] | That's correct. In Magento 2, the indexing process is triggerred by the cron and cannot be triggered manually anymore.
To setup your cron I suggest you follow the official documentation: <http://devdocs.magento.com/guides/v2.1/config-guide/cli/config-cli-subcommands-cron.html> | Had the same problem after a migration from 1.9.x to 2.1.x
• `php bin/magento cron:run`
• `php bin/magento indexer:reindex`
• Flush Magento cache
Make sure you setup your crons correctly as @Raphael suggested |
58,906,041 | I have this code and I will like to make it multi language app. What I want is to use the Strings from the Strings.xml file. How can i change "Colombian Peso" to String.
```
placeHolderData.add(new ExchangeListData("COP","Colombian Peso",R.drawable.colombia,time,"1"));
``` | 2019/11/17 | [
"https://Stackoverflow.com/questions/58906041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12388558/"
] | When you see a warning like this:
```
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
```
Try adding React version settings in your eslint configuration file, such as `.eslintrc.js`, like below:
 and subscribe like that :
```
ThrowEvent += X;
ThrowEvent += X;
ThrowEvent += X;
```
What happend when I try to make
```
ThrowEvent -= X;
```
Will it remove the first or the last added method ? | 2013/08/05 | [
"https://Stackoverflow.com/questions/18056520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2390393/"
] | The SCARD command returns the cardinality (i.e. number of items) of a Redis set.
<http://redis.io/commands/scard>
There is a similar command (ZCARD) for sorted sets. | Also if you have a sorted set, you can use the [`ZCOUNT`](https://redis.io/commands/zcount) command to get the **number of elements in the sorted set** at key with a score between min and max.
Example:
`ZCOUNT myzset 2 15`
return count of elements with score >= 2 and <= 15 |
18,056,520 | If I have reference to event ThrowEvent, method X() and subscribe like that :
```
ThrowEvent += X;
ThrowEvent += X;
ThrowEvent += X;
```
What happend when I try to make
```
ThrowEvent -= X;
```
Will it remove the first or the last added method ? | 2013/08/05 | [
"https://Stackoverflow.com/questions/18056520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2390393/"
] | The SCARD command returns the cardinality (i.e. number of items) of a Redis set.
<http://redis.io/commands/scard>
There is a similar command (ZCARD) for sorted sets. | for python you can use scard.
```
lebgth=db.scard(key)
``` |
61,977,451 | In SwiftUI I have a struct that want to hold data of the View. Let's say there is a View that user can create a recipe in it. It has a text field to type the recipe name, and options to choose and add to the array in the struct's properties.
I managed to make the struct and introduce it in the View but I cannot change... | 2020/05/23 | [
"https://Stackoverflow.com/questions/61977451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12216317/"
] | For the use-case as provided the most appropriate is to use view model as in example below
```
class RecipeViewModel: ObservableObject {
@Published var recipe: Recipe
init(_ recipe: Recipe) {
self.recipe = recipe
}
}
```
so in the view
```
struct ContentView: View {
@ObservedObject var recipeVM = ... | Add `@State`
```
@State var recipe = Recipe(..
```
Also, don't forget to add `self.` before using `recipe` inside button action. |
35,894,570 | I have a dataset in the following format:
```
Patient Date colA colB
1 1/3/2015 . 5
1 2/5/2015 3 10
1 3/5/2016 8 .
2 4/5/2014 2 .
2 etc
```
I am trying to define a function in PANDAS which treats unique patients as an item and iterates over these uni... | 2016/03/09 | [
"https://Stackoverflow.com/questions/35894570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5437137/"
] | Switching from BlockingConnection to SelectConnection made a huge difference, speeding up the process almost fifty times. All I needed to do is modify the example from [the following tutorial:](http://pika.readthedocs.org/en/latest/examples/comparing_publishing_sync_async.html), publishing messages in a loop:
```
impo... | Am assuming that you don't run any consumers `These benchmarks start with populating a queue`.
Since you are only publishing messages, the rabbitmq switches to flow state. To be more precise, your exchanges and/or queues go to flow state.
Quote from [rabbitmq blog](https://www.rabbitmq.com/blog/2014/04/14/finding-bott... |
44,920,737 | I need to handle empty input and remove the stack trace from output.
Here's a snippet of my code:
```
public class TestShape
{
public static void main(String args[])
{
for(int i = 0; i < args.length; i++)
{
try
{
Integer.parseInt(args[i]);
}... | 2017/07/05 | [
"https://Stackoverflow.com/questions/44920737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5939374/"
] | Your loop is not entered when no arguments are supplied, so no exception is thrown and nothing is displayed.
You should add a condition prior to the loop that throws an exception if `args.length==0`.
As for the stack trace being displayed, that's the default behavior for exception not handled by the `main` method. Yo... | For the first problem, you are checking condition in wrong place. Refer given code for correction.
For the second problem, you are using default exception handling which shows stack trace. For custom error handling, use throws clause. Refer given code for same.
Updated Code:
```
if (args.length < 1)
{
throw new I... |
44,920,737 | I need to handle empty input and remove the stack trace from output.
Here's a snippet of my code:
```
public class TestShape
{
public static void main(String args[])
{
for(int i = 0; i < args.length; i++)
{
try
{
Integer.parseInt(args[i]);
}... | 2017/07/05 | [
"https://Stackoverflow.com/questions/44920737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5939374/"
] | Your loop is not entered when no arguments are supplied, so no exception is thrown and nothing is displayed.
You should add a condition prior to the loop that throws an exception if `args.length==0`.
As for the stack trace being displayed, that's the default behavior for exception not handled by the `main` method. Yo... | You can check received values before checking for avoiding exceptions because you have expected numbers for the task (from 0 to 9);
I prefer this approach:
```
public static void main(String args[])
{
if(arargs.length < 1 || arargs.length > 3) //firstly check input size
{
System.out.printl... |
1,002,218 | How do I show a usercontrol after clicking the check box in a checkbox list using JQuery. | 2009/06/16 | [
"https://Stackoverflow.com/questions/1002218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91313/"
] | This should be close to what you're looking for:
```
$('#myCheckbox').click(function () {
if ($(this).is(':checked')) {
$('#myControl').show();
} else {
$('#myControl').hide();
}
});
```
That will show the element with id **myControl** when the checkbox is checked, and hide it after it ha... | Where do you want to show the control?
First decide where you want to show it
Then decide what control you want to show
After that:
```
$("#myCheckboxId").click(function(){ /* show the control */});
``` |
1,002,218 | How do I show a usercontrol after clicking the check box in a checkbox list using JQuery. | 2009/06/16 | [
"https://Stackoverflow.com/questions/1002218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91313/"
] | In certain situations it may be preferable, rather than showing an existing form element, to add the elements on the fly to the DOM. Then you can bind a [jQuery live event](http://docs.jquery.com/Events/live) to submit such a form.
```
$(document).ready(function(){
$("#myCheckbox").click(function(){
$(t... | Where do you want to show the control?
First decide where you want to show it
Then decide what control you want to show
After that:
```
$("#myCheckboxId").click(function(){ /* show the control */});
``` |
1,002,218 | How do I show a usercontrol after clicking the check box in a checkbox list using JQuery. | 2009/06/16 | [
"https://Stackoverflow.com/questions/1002218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91313/"
] | This should be close to what you're looking for:
```
$('#myCheckbox').click(function () {
if ($(this).is(':checked')) {
$('#myControl').show();
} else {
$('#myControl').hide();
}
});
```
That will show the element with id **myControl** when the checkbox is checked, and hide it after it ha... | In certain situations it may be preferable, rather than showing an existing form element, to add the elements on the fly to the DOM. Then you can bind a [jQuery live event](http://docs.jquery.com/Events/live) to submit such a form.
```
$(document).ready(function(){
$("#myCheckbox").click(function(){
$(t... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | You can add a BasicAuthenticationFilter to the security filter chain to get OAuth2 OR Basic authentication security on a protected resource. Example config is below...
```
@Configuration
@EnableResourceServer
public class OAuth2ResourceServerConfig extends ResourceServerConfigurerAdapter {
@Autowired
private ... | I believe that is not possible to have both authentications. You can have basic authentication and oauth2 authentication, but for distinct endpoints. The way as you did, the first configuration will overcome the second, in this case, http basic will be used. |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | I managed to get this work based on the hints by Michael Ressler's answer but with some tweaks.
My goal was to allow both Basic Auth and Oauth on the same resource endpoints, e.g., /leafcase/123. I was trapped for quite some time due to the ordering of the filterChains (can be inspected in FilterChainProxy.filterChai... | This may be close to what you were looking for:
```
@Override
public void configure(HttpSecurity http) throws Exception {
http.requestMatcher(new OAuthRequestedMatcher())
.authorizeRequests()
.anyRequest().authenticated();
}
private static class OAuthRequestedMatcher implements RequestMatcher {
@O... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | Can't provide you with complete example, but here's a hints to dig:
Roughly, spring auth is just a combination of request filter that extract auth data from request (headers) and authentication manager that provides authentication object for that auth.
So to get basic and oauth at the same url, you need 2 filters ins... | In the latest version of Spring Boot the [WebSecurityConfigurerAdapter](https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter) class is deprecated.
The solution to have HTTP Basic authorization for some endpoints and Oauth2 authorization for other endpoints is setting the HTTP Basi... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | This may be close to what you were looking for:
```
@Override
public void configure(HttpSecurity http) throws Exception {
http.requestMatcher(new OAuthRequestedMatcher())
.authorizeRequests()
.anyRequest().authenticated();
}
private static class OAuthRequestedMatcher implements RequestMatcher {
@O... | If anyone is trying to get this working with Spring WebFlux, the method which determines whether the request is handled is called "securityMatcher", rather than "requestMatcher".
i.e.
```
fun configureBasicAuth(http: ServerHttpSecurity): SecurityWebFilterChain {
return http
.securityMatcher(BasicAuthServe... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | If anyone is trying to get this working with Spring WebFlux, the method which determines whether the request is handled is called "securityMatcher", rather than "requestMatcher".
i.e.
```
fun configureBasicAuth(http: ServerHttpSecurity): SecurityWebFilterChain {
return http
.securityMatcher(BasicAuthServe... | I believe that is not possible to have both authentications. You can have basic authentication and oauth2 authentication, but for distinct endpoints. The way as you did, the first configuration will overcome the second, in this case, http basic will be used. |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | Can't provide you with complete example, but here's a hints to dig:
Roughly, spring auth is just a combination of request filter that extract auth data from request (headers) and authentication manager that provides authentication object for that auth.
So to get basic and oauth at the same url, you need 2 filters ins... | I believe that is not possible to have both authentications. You can have basic authentication and oauth2 authentication, but for distinct endpoints. The way as you did, the first configuration will overcome the second, in this case, http basic will be used. |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | The solution @kca2ply provided works very well. I noticed the browser wasn't issuing a challenge so I tweaked the code a little to the following:
```
@Configuration
@Order(2)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exceptio... | Can't provide you with complete example, but here's a hints to dig:
Roughly, spring auth is just a combination of request filter that extract auth data from request (headers) and authentication manager that provides authentication object for that auth.
So to get basic and oauth at the same url, you need 2 filters ins... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | The solution @kca2ply provided works very well. I noticed the browser wasn't issuing a challenge so I tweaked the code a little to the following:
```
@Configuration
@Order(2)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exceptio... | I believe that is not possible to have both authentications. You can have basic authentication and oauth2 authentication, but for distinct endpoints. The way as you did, the first configuration will overcome the second, in this case, http basic will be used. |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | I managed to get this work based on the hints by Michael Ressler's answer but with some tweaks.
My goal was to allow both Basic Auth and Oauth on the same resource endpoints, e.g., /leafcase/123. I was trapped for quite some time due to the ordering of the filterChains (can be inspected in FilterChainProxy.filterChai... | In the latest version of Spring Boot the [WebSecurityConfigurerAdapter](https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter) class is deprecated.
The solution to have HTTP Basic authorization for some endpoints and Oauth2 authorization for other endpoints is setting the HTTP Basi... |
23,526,649 | I've been using the BarcodeScanner plugin to experiment with QR code scanning in phonegap and that seems to be working.
I've used this sample: <https://github.com/wildabeast/BarcodeDemo>
However, I'd like the barcodescanner to show up inside a page at let's say 25% of the screen width instead of it showing up fullscr... | 2014/05/07 | [
"https://Stackoverflow.com/questions/23526649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/229656/"
] | This may be close to what you were looking for:
```
@Override
public void configure(HttpSecurity http) throws Exception {
http.requestMatcher(new OAuthRequestedMatcher())
.authorizeRequests()
.anyRequest().authenticated();
}
private static class OAuthRequestedMatcher implements RequestMatcher {
@O... | The solution @kca2ply provided works very well. I noticed the browser wasn't issuing a challenge so I tweaked the code a little to the following:
```
@Configuration
@Order(2)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exceptio... |
18,600,317 | I have the following for loop:
```
for /l %%a in (1,1,%count%) do (
<nul set /p=" %%a - "
Echo !var%%a!
)
```
which will display something like this:
```
1 - REL1206
2 - REL1302
3 - REL1306
```
I need to create a variable that appends itself based on the number of iterations. Example the variable would look like... | 2013/09/03 | [
"https://Stackoverflow.com/questions/18600317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/742279/"
] | example:
```
@ECHO OFF &SETLOCAL
SET /a count=5
for /l %%a in (1,1,%count%) do call set "Myvar=%%Myvar%%, %%a"
ECHO %Myvar:~2%
```
..output is:
```
1, 2, 3, 4, 5
``` | Use delayed expansion
```
setlocal enableextensions enabledelayedexpansion
SET OUTPUTSTRING=
for /l %%a in (1,1,%count%) do (
<nul set /p=" %%a - "
Echo !var%%a!
if .!OUTPUTSTRING!==. (
SET OUTPUTSTRING=%%a
) ELSE (
SET OUTPUTSTRING=!OUTPUTSTRING!, %%a
)
)
SET OUTPUTSTRING
``` |
48,320,362 | I am creating a cloudformation template on AWS and have successfully added the username and **password** parameter which is required as a user input.
But is there any way to add **"Confirm password"** field as well ? | 2018/01/18 | [
"https://Stackoverflow.com/questions/48320362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5281918/"
] | It finally worked after I specified 3 parameters - username, password, confirm password and then added the following rule section in the template:
JSON:
```
"Rules" : {
"matchPasswords" : {
"Assertions" : [
{
"Assert" : {"Fn::Equals":[{"Ref":"Password"},{"Ref":"ConfirmPassword"}]},
... | You could accept 3 parameters - username, password, confirm password. Specify a condition like "password-match" and then, add this condition to all your resources. So if the passwords don't match, nothing will be created.
Check this page to understand the use of conditions better <https://docs.aws.amazon.com/AWSCloudF... |
60,278,002 | Is there a way to find number of days from timespan?
For example,
time(00:00:00.2000000), time(00:30:30), time(01:00:00), time(413.00:00:00)
should return 0, 0, 0, 413 | 2020/02/18 | [
"https://Stackoverflow.com/questions/60278002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9238311/"
] | You could use format\_timespan():
```
let getDays = (t:timespan)
{
toint(format_timespan(t, 'd'))
};
print result = getDays(time(00:00:00.2000000)), //0
getDays(time(00:30:30)), //0
getDays(time(01:00:00)), //0
getDays(time(413.00:00:00)) //413
``` | An alternative way would be to divide the timespan by the a day, for example:
```
datatable(t:timespan) [ time(00:00:00.2000000), time(00:30:30), time(01:00:00), time(413.00:00:00)]
| extend Days = tolong(t/1d)
``` |
67,013 | I've just stumbled across [OpenStreetMap France](http://tile.openstreetmap.fr/) and was amazed to find that it has 2 extra zoom levels, 19 and 20, whereas OpenStreetMap only goes up to 18.
In our application we display potentially masses of geographic data over the top of basemaps. We use Ordnance Survey and OpenStre... | 2013/07/25 | [
"https://gis.stackexchange.com/questions/67013",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/6061/"
] | I'm behind osm-fr tiles...
I confirm that there is some changes in the style, compared to OSM cartocss translation while retaining the well known OSM default "teletubbies" color scheme.
I've added zoom 19 and 20 to be able to view more details.
The tilemill project I'm using to generate my mapnik XML config file is ... | 1) It doesn't seem quite as fast and has some slight differences in cartography, but basically go for it, I guess.
2) Here's the thread from earlier this year on OSM-talk where z19 came up: <http://lists.openstreetmap.org/pipermail/talk/2013-January/065814.html>
Reading through, it seems like people think it's feasi... |
44,355,298 | I have a sentence "Computer Science" as my input and I want to print Computer and Science seperately. I wrote a program in c++ but it is printing only "Computer". Could anyone help me find out why it is not printing both the words seperately?
```
int main()
{
char string[]="Computer Science";
int l;
l=strl... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44355298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4532954/"
] | You are looking only for space which printing output. Science has null after it not space.
Change while to
```
while(i <= l)
```
Change your if condition to
```
if(string[i]==' ' || string[i] == '\0')
``` | Variable Length Arrays (VLA) is not a standard feature of C++. Moreover there is no need to declare one more array that to output words separated by spaces.
Your program never outputs the second (or last) word in the string if there are no spaces after it.
And the program includes leading spaces in words because it d... |
44,355,298 | I have a sentence "Computer Science" as my input and I want to print Computer and Science seperately. I wrote a program in c++ but it is printing only "Computer". Could anyone help me find out why it is not printing both the words seperately?
```
int main()
{
char string[]="Computer Science";
int l;
l=strl... | 2017/06/04 | [
"https://Stackoverflow.com/questions/44355298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4532954/"
] | Modern C++ offers a lot of features for handling strings. These features are designed to simplify handling string in more efficient way. Don't use C-Style string unless you have to. In your case, you could do
```
#include <iostream>
#include <string>
int main()
{
std::string str("Computer Science");
for(int ... | Variable Length Arrays (VLA) is not a standard feature of C++. Moreover there is no need to declare one more array that to output words separated by spaces.
Your program never outputs the second (or last) word in the string if there are no spaces after it.
And the program includes leading spaces in words because it d... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | It's more fun. Nothing says "mad scientist" like big coils, a few jacob's ladders around the place, sparks flying off towards the sky, and a visible corona. Some of these things don't work with DC, and a few diodes and capacitors aren't nearly as awe inspiring. | Maybe it's the added bonus that the Tesla coil makes lots of noise. The old school spark-gap ones buzz rather loudly, and it's even possible with solid state drive to make a TC emit audio signals from the discharge. |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | It's more fun. Nothing says "mad scientist" like big coils, a few jacob's ladders around the place, sparks flying off towards the sky, and a visible corona. Some of these things don't work with DC, and a few diodes and capacitors aren't nearly as awe inspiring. | Tesla Coils are marginally less dangerous due to the "Skin Effect" whereas a C.W. Multiplier can become deadly pretty quickly. Also, having a constant stream of arcs, that loud buzz, and the smell of ozone is an experience that a Tesla Coil is quite adept at providing! Besides, a Tesla Coil looks a lot like the univers... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | The way I understand it, a CW Generator creates high voltage DC, whereas a tesla coil create high voltage AC.
For the fun sparky effects it is easier to use AC that DC as it should spark at a lower voltage.
Also, to get a CW generator up to the kind of voltages that a tesla coil typically gets to (say half a million ... | A tesla coil uses resonance ,and the q of the secondary multiplies the reactive watts. The reactive output of a tesla coil at 500kv at 8 amps is 4 Mega Watts. Though its not true power ,what your seeing is the reactive power entering the capacitance of air. A voltage multiplier is just true power being stored and disch... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | The way I understand it, a CW Generator creates high voltage DC, whereas a tesla coil create high voltage AC.
For the fun sparky effects it is easier to use AC that DC as it should spark at a lower voltage.
Also, to get a CW generator up to the kind of voltages that a tesla coil typically gets to (say half a million ... | Tesla Coils are marginally less dangerous due to the "Skin Effect" whereas a C.W. Multiplier can become deadly pretty quickly. Also, having a constant stream of arcs, that loud buzz, and the smell of ozone is an experience that a Tesla Coil is quite adept at providing! Besides, a Tesla Coil looks a lot like the univers... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | It's more fun. Nothing says "mad scientist" like big coils, a few jacob's ladders around the place, sparks flying off towards the sky, and a visible corona. Some of these things don't work with DC, and a few diodes and capacitors aren't nearly as awe inspiring. | A tesla coil uses resonance ,and the q of the secondary multiplies the reactive watts. The reactive output of a tesla coil at 500kv at 8 amps is 4 Mega Watts. Though its not true power ,what your seeing is the reactive power entering the capacitance of air. A voltage multiplier is just true power being stored and disch... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | Mostly, the tesla coil is simpler than the multiplier.
If you want to increase the output voltage of the CW generator, you need to inncrease the number of stages and/or voltage tolerance of the diodes. If you want to do the same for the tesla coil, simply use a bigger coil. | A tesla coil uses resonance ,and the q of the secondary multiplies the reactive watts. The reactive output of a tesla coil at 500kv at 8 amps is 4 Mega Watts. Though its not true power ,what your seeing is the reactive power entering the capacitance of air. A voltage multiplier is just true power being stored and disch... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | Maybe it's the added bonus that the Tesla coil makes lots of noise. The old school spark-gap ones buzz rather loudly, and it's even possible with solid state drive to make a TC emit audio signals from the discharge. | Tesla Coils are marginally less dangerous due to the "Skin Effect" whereas a C.W. Multiplier can become deadly pretty quickly. Also, having a constant stream of arcs, that loud buzz, and the smell of ozone is an experience that a Tesla Coil is quite adept at providing! Besides, a Tesla Coil looks a lot like the univers... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | Mostly, the tesla coil is simpler than the multiplier.
If you want to increase the output voltage of the CW generator, you need to inncrease the number of stages and/or voltage tolerance of the diodes. If you want to do the same for the tesla coil, simply use a bigger coil. | Tesla Coils are marginally less dangerous due to the "Skin Effect" whereas a C.W. Multiplier can become deadly pretty quickly. Also, having a constant stream of arcs, that loud buzz, and the smell of ozone is an experience that a Tesla Coil is quite adept at providing! Besides, a Tesla Coil looks a lot like the univers... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | Maybe it's the added bonus that the Tesla coil makes lots of noise. The old school spark-gap ones buzz rather loudly, and it's even possible with solid state drive to make a TC emit audio signals from the discharge. | A tesla coil uses resonance ,and the q of the secondary multiplies the reactive watts. The reactive output of a tesla coil at 500kv at 8 amps is 4 Mega Watts. Though its not true power ,what your seeing is the reactive power entering the capacitance of air. A voltage multiplier is just true power being stored and disch... |
18,215 | When I see someone want to get high voltage - we see tesla coil.
Why everyone do that instead of building [Cockcroft–Walton generator](http://en.wikipedia.org/wiki/Cockcroft%E2%80%93Walton_generator)? Are there any issues with Cockcroft–Walton generator, making it less fun than tesla coil? | 2011/08/14 | [
"https://electronics.stackexchange.com/questions/18215",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/2062/"
] | It's more fun. Nothing says "mad scientist" like big coils, a few jacob's ladders around the place, sparks flying off towards the sky, and a visible corona. Some of these things don't work with DC, and a few diodes and capacitors aren't nearly as awe inspiring. | Mostly, the tesla coil is simpler than the multiplier.
If you want to increase the output voltage of the CW generator, you need to inncrease the number of stages and/or voltage tolerance of the diodes. If you want to do the same for the tesla coil, simply use a bigger coil. |
15,911,457 | I would like create a select that have options and suboptions.
For example, if I have a form similar like this one:
```
<form method="post" action="processor.php">
<select name="mySelect">
<option value="1">Parent option 1</option>
<option value="1">Child option 1 of parent 1</option>
<option value=... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15911457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/727184/"
] | The `<select>` tag does not support nested options. It supports [groups](https://developer.mozilla.org/en-US/docs/HTML/Element/optgroup), but not a real hierarchy.
There are available JavaScript-based replacements that use nested lists to perform the same type of functionality. You may wish to explore this option. | try using "`<ul>`" tags instead of "`<select>`" then put some jquery or javascript and CSS to do the animation (hide, show) thing then on submit get selected value using javascript or do it like this:
[Best way to submit UL via POST?](https://stackoverflow.com/questions/3287336/best-way-to-submit-ul-via-post)
cheers! |
15,911,457 | I would like create a select that have options and suboptions.
For example, if I have a form similar like this one:
```
<form method="post" action="processor.php">
<select name="mySelect">
<option value="1">Parent option 1</option>
<option value="1">Child option 1 of parent 1</option>
<option value=... | 2013/04/09 | [
"https://Stackoverflow.com/questions/15911457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/727184/"
] | The `<select>` tag does not support nested options. It supports [groups](https://developer.mozilla.org/en-US/docs/HTML/Element/optgroup), but not a real hierarchy.
There are available JavaScript-based replacements that use nested lists to perform the same type of functionality. You may wish to explore this option. | I think you would benefit far more from a javascript-based tree control rather than a selector. You could have infinite levels of hierarchy and the selection mechanism would be pretty much what you're looking for.
Have you given a look at, for example, [DHTMLX Tree](http://www.dhtmlx.com/docs/products/dhtmlxTree/)? |
21,257,506 | I want an approach and method to separate the connected lines. Here is my image

and here is the result I would like

How do I solve that problem? Thank you in advance!
Sincere... | 2014/01/21 | [
"https://Stackoverflow.com/questions/21257506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3210664/"
] | You need to append the input and label to the `row` element
```
html = $("<div class='table'>").append($("<div class='row'>")
.append("<label>Denominazione Gruppo</label>")
.append("<input type='text' id='denominazione'>"));
$("#content").empty();
$("#content").append(html);
```
Demo: [Fiddle](http://jsfiddl... | You have to use `.appendTo()` in this context.
Try,
```
$("<label>Denominazione Gruppo</label>")
.appendTo($("<div class='row'><input type='text' id='denominazione'>")
.appendTo($("<div class='table'>")
.appendTo($('#content'))));
```
[DEMO](http://jsfiddle.net/laraprabhu/B4WBN/)
----------... |
21,257,506 | I want an approach and method to separate the connected lines. Here is my image

and here is the result I would like

How do I solve that problem? Thank you in advance!
Sincere... | 2014/01/21 | [
"https://Stackoverflow.com/questions/21257506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3210664/"
] | You have to use `.appendTo()` in this context.
Try,
```
$("<label>Denominazione Gruppo</label>")
.appendTo($("<div class='row'><input type='text' id='denominazione'>")
.appendTo($("<div class='table'>")
.appendTo($('#content'))));
```
[DEMO](http://jsfiddle.net/laraprabhu/B4WBN/)
----------... | try this:
```
html=$("<div class='table'>").append(
$("<div class='row'>").append(
$("<label>Denominazione Gruppo</label>")).append(
$("<input type='text' id='denominazione'>")));
```
### [Demo](http://jsfiddle.net/aWVw4/) |
21,257,506 | I want an approach and method to separate the connected lines. Here is my image

and here is the result I would like

How do I solve that problem? Thank you in advance!
Sincere... | 2014/01/21 | [
"https://Stackoverflow.com/questions/21257506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3210664/"
] | You need to append the input and label to the `row` element
```
html = $("<div class='table'>").append($("<div class='row'>")
.append("<label>Denominazione Gruppo</label>")
.append("<input type='text' id='denominazione'>"));
$("#content").empty();
$("#content").append(html);
```
Demo: [Fiddle](http://jsfiddl... | try this:
```
html=$("<div class='table'>").append(
$("<div class='row'>").append(
$("<label>Denominazione Gruppo</label>")).append(
$("<input type='text' id='denominazione'>")));
```
### [Demo](http://jsfiddle.net/aWVw4/) |
3,477,678 | The problem says :
>
> Find all polynomials $P(x)$ with odd degree such that
> $$P(x^2 - 2) = P^2(x)-2$$
>
>
>
I tried a lot if ways (using high school mathematics) but the only solution I have so far is $P(x) = x$. Can anyone solve this problem using only high school mathematics ?
PS: I have reduced the soluti... | 2019/12/15 | [
"https://math.stackexchange.com/questions/3477678",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/669545/"
] | This **extended comment** has the sole purpose of showing a simple *Mathematica code* to print the $P(x)$ polynomials up to the tenth degree that satisfy the relation $P(x^2-2) - (P(x))^2 + 2 = 0$.
```
P[x_] = Sum[ToExpression[StringJoin["a", ToString[n]]] x^n, {n, 0, 10}];
coeff = CoefficientList[P[x^2 - 2] - P[x]^2 ... | Let $K(x) = x^2-2$ and for any $n \geq 1$ let $K^n(x)$ be repeated application of $K$ (so $K^1(x)=K(x)$ and $K^{n+1}(x) = K(K^n(x))$). Then for fixed $x$ the sequence $K^n(x)$ is bounded if and only if $\lvert x \rvert \leq 2$. Since $P(K^n(x))=K^n(P(x))$ it follows that $\lvert P(x) \rvert \leq 2$ for all $\lvert x \r... |
3,477,678 | The problem says :
>
> Find all polynomials $P(x)$ with odd degree such that
> $$P(x^2 - 2) = P^2(x)-2$$
>
>
>
I tried a lot if ways (using high school mathematics) but the only solution I have so far is $P(x) = x$. Can anyone solve this problem using only high school mathematics ?
PS: I have reduced the soluti... | 2019/12/15 | [
"https://math.stackexchange.com/questions/3477678",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/669545/"
] | This **extended comment** has the sole purpose of showing a simple *Mathematica code* to print the $P(x)$ polynomials up to the tenth degree that satisfy the relation $P(x^2-2) - (P(x))^2 + 2 = 0$.
```
P[x_] = Sum[ToExpression[StringJoin["a", ToString[n]]] x^n, {n, 0, 10}];
coeff = CoefficientList[P[x^2 - 2] - P[x]^2 ... | For every $n\ge 0$ there exists a unique polynomial of degree $n$ such that
$$P\_n(t+1/t) = t^n + 1/t^n$$
For instance, $P\_0(x) = 2$, $P\_1(x) =x$, $P\_2(x) = x^2-2$, and so on. It is easy to see that
$$P\_m\circ P\_n(x) = P\_{mn}(x)$$
so any two $P\_m$'s commute. In particular, $P\_n(P\_2(x))= P\_2(P\_n(x))$.
Let ... |
2,254,080 | New to php.
I use a php script to generate a playlist, the first song entry in the list is blank for all fields (artist, title, length, filename). Why?
Here's the script
```
<?php
require_once('getid3/getid3.php');
$dir = 'mp3';
$file_type = 'mp3';
$play_list = '<?xml version="1.0" encoding="utf-8"?><config>... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2254080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272047/"
] | The filename field isn't empty :
`<song><artist></artist><title></title><length></length><fileName>mp3/air - all i need.mp3</fileName></song>`
Maybe it's just because the ID3 tags aren't set for "all i need.mp3" ?
P.S : you should use [`pathinfo`](http://fr.php.net/manual/en/function.pathinfo.php) with `PATHINFO_EXT... | Try using glob() to get the files.
<http://us.php.net/manual/en/function.glob.php>
```
$files = glob($dir . '/*.mp3');
foreach ($files as $file) {
...
}
```
Use pathinfo() to get the file extension information.
<http://php.net/manual/en/function.pathinfo.php>
Although, if you use the glob() function above, you wou... |
23,224 | Can karma be destroyed by other Niyamas?
Can the other four niyamas from the "Five Niyamas" remove a person's karma? Or just affect it? | 2017/10/11 | [
"https://buddhism.stackexchange.com/questions/23224",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/6921/"
] | No, if speaking of "can one deed make another undone" ([MN 101](http://www.zugangzureinsicht.org/html/tipitaka/mn/mn.101.than_en.html)), Breath, but by the deed of traing the mind, one can reach the ability to bear results of fruits from deeds easier. See the [The Salt Crystal](http://www.zugangzureinsicht.org/html/tip... | They can influence Karma and affect Vipaka(result).
ex: The reason why mangoes taste the way they taste is due to Bija Niyama & Uttu Niyama. Not because of Karma. So when you eat a mango, the pleasurable feeling at the tongue arises due to Karma. But Karma cannot make it taste like an apple, if you eat a mango. The nat... |
23,224 | Can karma be destroyed by other Niyamas?
Can the other four niyamas from the "Five Niyamas" remove a person's karma? Or just affect it? | 2017/10/11 | [
"https://buddhism.stackexchange.com/questions/23224",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/6921/"
] | No, if speaking of "can one deed make another undone" ([MN 101](http://www.zugangzureinsicht.org/html/tipitaka/mn/mn.101.than_en.html)), Breath, but by the deed of traing the mind, one can reach the ability to bear results of fruits from deeds easier. See the [The Salt Crystal](http://www.zugangzureinsicht.org/html/tip... | Kamma is destroyed only by the Dhamma Niyama of not-self (*anatta*).
>
> *Just this noble eightfold path — right view, right resolve, right
> speech, right action, right livelihood, right effort, right
> mindfulness, right concentration — is the path of practice leading to
> the cessation of kamma. AN 6.63*
>
> ... |
172,562 | We've all seen the pictures captioned "How many squares are in this image? 98% will not get this right!" Well, here's your chance to laugh at that 98%.
Input
-----
A rectangular block made of only 2 characters. In a general form, this is defined by *m* lines, each containing *n* characters.
Example:
```
0000xxx
00x... | 2018/09/20 | [
"https://codegolf.stackexchange.com/questions/172562",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/82845/"
] | Perl, 0 characters not in squares (25430 bytes)
===============================================
```
##((((((((((((((((((((((((((((((((((((((((((((((
##($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(
##($rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$(
##($r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r$(
##($r,$$$$$$$$$$$$$$$$$... | [Jelly](https://github.com/DennisMitchell/jelly), ~~20 1917 1908~~ 1905 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page), Score ~~20~~ 0
=======================================================================================================================================================
```
ẆẆẆẆẆẆẆẆẆẆ... |
172,562 | We've all seen the pictures captioned "How many squares are in this image? 98% will not get this right!" Well, here's your chance to laugh at that 98%.
Input
-----
A rectangular block made of only 2 characters. In a general form, this is defined by *m* lines, each containing *n* characters.
Example:
```
0000xxx
00x... | 2018/09/20 | [
"https://codegolf.stackexchange.com/questions/172562",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/82845/"
] | Perl, 0 characters not in squares (25430 bytes)
===============================================
```
##((((((((((((((((((((((((((((((((((((((((((((((
##($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$(
##($rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr$(
##($r,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,r$(
##($r,$$$$$$$$$$$$$$$$$... | [MATL](https://github.com/lmendo/MATL), ~~18~~ ~~16~~ ~~14~~ 10 characters not in squares (~~92~~ ~~103~~ ~~111~~ 127 bytes)
============================================================================================================================
```
!!!ffqqqqQQQ%OOOOGGGxx44---@@&&lllxxTT ~~~ ++||7 ss--~~~ssvvss
!... |
11,437,330 | I need to migrate from my old user DB, to a new one.... but luckily the value of the password and salt fields are the same on both, but the column name are different (on old table:user passhash->secret, on new table:newuser password->salt)
How do I generate an insert dump from my existing users-data? Whenever I do som... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11437330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1099972/"
] | @naqi @gkris
I also noticed this issue where `isProviderEnabled(LocationManager.GPS_PROVIDER)` was returning `false`.
Solution to this is to also ask user to set the `Location Method` to `High Accuracy` instead of `Battery Saving` or `Device Only`
This setting is available under location settings and has different ... | From the API doc for : LocationManager.GPS\_PROVIDER
>
> This provider determines location using satellites. Depending on
> conditions, this provider may take a while to return a location fix.
> Requires the permission ACCESS\_FINE\_LOCATION.
>
>
>
So if you're not requiring ACCESS\_FINE\_LOCATION it will retur... |
52,838,457 | ```
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
void deleteNode(ListNode* node) {
*(node) = *(node->next);
}
```
I know that this would be the result
node = 3
deleteNode(node)
1->2->3->4->5
1->2->4->5
but where would this lead to a memo... | 2018/10/16 | [
"https://Stackoverflow.com/questions/52838457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10513648/"
] | >
> but would this lead to a memory leak
>
>
>
Yes.
>
> but would the int variable 3 still be floating around in memory somewhere?
>
>
>
No. The node which contains 4 is the one that is leaked, since it is the node containing 3 which was overwritten, and that is the node which was pointing to 4. The result w... | It is impossible to get rid of the node not having a pointer to its predecessor in the slist.
What you can do is move `->data` and `->next` from the `node->next` into the `node` and get rid of the `node->next`. It will be almost the same as requested — get rid of the data stored in the `node->data` and make list one e... |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | You can use this:
```
string x = Console.ReadLine();
int i;
if(int.TryParse(x, out i))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
If the `TryParse()` returns `true`, the parsed value is stored in `i` | Just use [Int.TryParse](http://msdn.microsoft.com/en-us/library/f02979c7.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as in this example
```
int result;
string x = Console.ReadLine();
if(int.TryParse(x, out result))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
The method accepts the... |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | You can use this:
```
string x = Console.ReadLine();
int i;
if(int.TryParse(x, out i))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
If the `TryParse()` returns `true`, the parsed value is stored in `i` | try
```
static void check()
{ int result
string x = Console.ReadLine();
if(int.TryParse(x, out result)
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | You can use this:
```
string x = Console.ReadLine();
int i;
if(int.TryParse(x, out i))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
If the `TryParse()` returns `true`, the parsed value is stored in `i` | Try this
```
int isInteger;
Console.WriteLine("Input Characters: ");
string x = Console.ReadLine();
if(int.TryParse(x, out isInteger)
Console.WriteLine("int");
else
Console.WriteLine("not int");
``` |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | You can use this:
```
string x = Console.ReadLine();
int i;
if(int.TryParse(x, out i))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
If the `TryParse()` returns `true`, the parsed value is stored in `i` | `Console.ReadLine()` Will Always Return String . So you can Try `Int.TryParse()` To Check the type. Check the bellow Example
```
int output;
string x = Console.ReadLine();
if(int.TryParse(x, out output)
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
hope This may helpful f... |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | Just use [Int.TryParse](http://msdn.microsoft.com/en-us/library/f02979c7.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as in this example
```
int result;
string x = Console.ReadLine();
if(int.TryParse(x, out result))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
The method accepts the... | try
```
static void check()
{ int result
string x = Console.ReadLine();
if(int.TryParse(x, out result)
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | Just use [Int.TryParse](http://msdn.microsoft.com/en-us/library/f02979c7.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as in this example
```
int result;
string x = Console.ReadLine();
if(int.TryParse(x, out result))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
The method accepts the... | Try this
```
int isInteger;
Console.WriteLine("Input Characters: ");
string x = Console.ReadLine();
if(int.TryParse(x, out isInteger)
Console.WriteLine("int");
else
Console.WriteLine("not int");
``` |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | Just use [Int.TryParse](http://msdn.microsoft.com/en-us/library/f02979c7.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as in this example
```
int result;
string x = Console.ReadLine();
if(int.TryParse(x, out result))
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
The method accepts the... | `Console.ReadLine()` Will Always Return String . So you can Try `Int.TryParse()` To Check the type. Check the bellow Example
```
int output;
string x = Console.ReadLine();
if(int.TryParse(x, out output)
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
hope This may helpful f... |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | try
```
static void check()
{ int result
string x = Console.ReadLine();
if(int.TryParse(x, out result)
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | Try this
```
int isInteger;
Console.WriteLine("Input Characters: ");
string x = Console.ReadLine();
if(int.TryParse(x, out isInteger)
Console.WriteLine("int");
else
Console.WriteLine("not int");
``` |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | try
```
static void check()
{ int result
string x = Console.ReadLine();
if(int.TryParse(x, out result)
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | `Console.ReadLine()` Will Always Return String . So you can Try `Int.TryParse()` To Check the type. Check the bellow Example
```
int output;
string x = Console.ReadLine();
if(int.TryParse(x, out output)
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
hope This may helpful f... |
19,050,809 | Actually I'm trying to write small program that read input from user to decide whether is it `integer` or not.
```
object x=Console.ReadLine();
check(x);
static void check(object x)
{
if (x.GetType() == typeof(int))
Console.WriteLine("int");
else
Console.WriteLine("not int");
}
``` | 2013/09/27 | [
"https://Stackoverflow.com/questions/19050809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2823356/"
] | Try this
```
int isInteger;
Console.WriteLine("Input Characters: ");
string x = Console.ReadLine();
if(int.TryParse(x, out isInteger)
Console.WriteLine("int");
else
Console.WriteLine("not int");
``` | `Console.ReadLine()` Will Always Return String . So you can Try `Int.TryParse()` To Check the type. Check the bellow Example
```
int output;
string x = Console.ReadLine();
if(int.TryParse(x, out output)
Console.WriteLine("int");
else
Console.WriteLine("not int");
```
hope This may helpful f... |
62,565,188 | I am working on a COVID-19 statistics app with **Ionic** and **Angular**. The data is retrieved from an API. This is the API: <https://covid19api.com/>. I can search up for countries but now I want to be able to make a country a favorite using local storage so that next time I don't have to search for a country when I ... | 2020/06/24 | [
"https://Stackoverflow.com/questions/62565188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11244166/"
] | Interesting. I went through your logs and I don't see anything obvious, and you've already figured out that you can't reach the orderer . . I want to check if this is indeed a TLS issue. Can you try something for me please?
* there should be a monitordocker.sh script in `fabric-samples/commercial-paper/organization/di... | Feels like a connection or set up problem, but might need more data to do a RCA. Could you bring down your network and start it up again, please and share the full log once you kick off createChannel, it Wil start with something like “Creating channel ‘mychannel’. If network is not up, starting nodes with CLI timeout o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.