qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
56,888
At work we make websites for other companies. One of our client wanted us to make a e-commerce website for them. Nothing out of the ordinary until we realized they had 50 000+ products to sell and their classification is inexistant. In other words, we don't have ay categories to work with. They just told us to "Put a s...
2014/05/07
['https://ux.stackexchange.com/questions/56888', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/47784/']
Your client might not be able to assign categories to products, but there is noting stopping them assigning categories to *sellers*. The kind of sellers using a resale ecommerce site are likely to be specialists in certain categories already, rather than having a diverse range of products (e.g. there will likely be s...
If there is no way of categorizing the products then search must be the primary method of traversing the catalog. But as a previous answer suggests you should guide the user with top products sold for a search, top products viewed for a search etc. The other users behavior should help guide them, consider adding a meth...
203,891
I found part of my answer here: [If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)](https://math.stackexchange.com/questions/28123/if-gfx-is-one-to-one-injective-show-fx-is-also-one-to-one-given-that); however I wanted to flesh out the last two statements I had in a proposition in my not...
2012/09/28
['https://math.stackexchange.com/questions/203891', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/8324/']
Both of your proofs are correct.
I've never taken an analysis course but I don't believe that your first proof is correct. Since take for example $f=x^2$, which isn't one-to-one. $g \circ f (-2)$ and $g \circ f (2)$ would be equal, since in both cases it is $g(4)$ and $g$ is a function. So $x$ would not have to equal $y$ and thus $f$ does not have a r...
203,891
I found part of my answer here: [If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)](https://math.stackexchange.com/questions/28123/if-gfx-is-one-to-one-injective-show-fx-is-also-one-to-one-given-that); however I wanted to flesh out the last two statements I had in a proposition in my not...
2012/09/28
['https://math.stackexchange.com/questions/203891', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/8324/']
Both of your proofs are correct.
On the first one i would say since g composed of f is one-to-one, if g(f(x))=g(f(y)) for all x,y in A then x=y. By definition of f then there exist some value f(x) and f(y) in B. Then because we already noted x=y. F(x) must equal F(y) by the definition of a function.
203,891
I found part of my answer here: [If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)](https://math.stackexchange.com/questions/28123/if-gfx-is-one-to-one-injective-show-fx-is-also-one-to-one-given-that); however I wanted to flesh out the last two statements I had in a proposition in my not...
2012/09/28
['https://math.stackexchange.com/questions/203891', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/8324/']
Both of your proofs are correct.
(i) If $f \circ g$ is one-to-one, then it is invertible. Its inverse is $g^{-1} \circ f^{-1}.$ Thus $f^{-1}$ exists. Therefore, $f$ is invertible, and thus is one-to-one. QED.
203,891
I found part of my answer here: [If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)](https://math.stackexchange.com/questions/28123/if-gfx-is-one-to-one-injective-show-fx-is-also-one-to-one-given-that); however I wanted to flesh out the last two statements I had in a proposition in my not...
2012/09/28
['https://math.stackexchange.com/questions/203891', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/8324/']
I've never taken an analysis course but I don't believe that your first proof is correct. Since take for example $f=x^2$, which isn't one-to-one. $g \circ f (-2)$ and $g \circ f (2)$ would be equal, since in both cases it is $g(4)$ and $g$ is a function. So $x$ would not have to equal $y$ and thus $f$ does not have a r...
On the first one i would say since g composed of f is one-to-one, if g(f(x))=g(f(y)) for all x,y in A then x=y. By definition of f then there exist some value f(x) and f(y) in B. Then because we already noted x=y. F(x) must equal F(y) by the definition of a function.
203,891
I found part of my answer here: [If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)](https://math.stackexchange.com/questions/28123/if-gfx-is-one-to-one-injective-show-fx-is-also-one-to-one-given-that); however I wanted to flesh out the last two statements I had in a proposition in my not...
2012/09/28
['https://math.stackexchange.com/questions/203891', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/8324/']
(i) If $f \circ g$ is one-to-one, then it is invertible. Its inverse is $g^{-1} \circ f^{-1}.$ Thus $f^{-1}$ exists. Therefore, $f$ is invertible, and thus is one-to-one. QED.
On the first one i would say since g composed of f is one-to-one, if g(f(x))=g(f(y)) for all x,y in A then x=y. By definition of f then there exist some value f(x) and f(y) in B. Then because we already noted x=y. F(x) must equal F(y) by the definition of a function.
3,257,640
Let $\gamma:[0,1] \longrightarrow \mathbf{C} \backslash \{0\}$ be a closed curve (continuous and of bounded variation). We call $$\operatorname{Ind}\_\gamma(0) \overset{\mathrm{def}}{=} \frac{1}{2 \pi i}\int\_\gamma \frac{1}{z}\ dz.$$ $\textbf{the index of $\gamma$ around $0$.}$ As for the winding number, we can take...
2019/06/10
['https://math.stackexchange.com/questions/3257640', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/680871/']
First, we observe that $$ f(x)=x-\ln x -1\geq \frac{(x-1)^2}{2}-\frac{(x-1)^3}{3}=g(x). $$ Now clearly if $$ g(x)\geq\varepsilon \Rightarrow f(x)\geq \varepsilon $$ Now all we have to do is to find the roots $f(x)-\varepsilon=0$ and identify the one which is larger than, but close to $1$. It is given by $$ x(\varepsi...
$x(\epsilon)=x-\ln(x)-1$ is the largest upper bound possible, and also happens to be in closed form.
125,202
I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ``` gdalwarp -cutline clipper.shp -crop_to_cutline input.tif output.tif ``` However, the actual area I want to clip to will a...
2014/12/10
['https://gis.stackexchange.com/questions/125202', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37589/']
I don't know if it's possible to clip a raster with an other raster but you could use gdaltindex to build the shapefile with the extent of your raster. <http://www.gdal.org/gdaltindex.html>
For irregular polygons, and assuming that your geotiff raster file is a binary raster, you could use [GDAL\_Calc](http://www.gdal.org/gdal_calc.html): ``` GDAL_Calc.py -A Mask.tif -B CutBigImageToClip.tif --outfile=SmallerFile.tif --NoDataValue=0 --Calc="B*(A>0)" ``` This query will populate 0 where Mask.tif <= 0 a...
125,202
I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ``` gdalwarp -cutline clipper.shp -crop_to_cutline input.tif output.tif ``` However, the actual area I want to clip to will a...
2014/12/10
['https://gis.stackexchange.com/questions/125202', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37589/']
I don't know if it's possible to clip a raster with an other raster but you could use gdaltindex to build the shapefile with the extent of your raster. <http://www.gdal.org/gdaltindex.html>
The solution in Python directly, without making shape: ``` import gdal from gdalconst import GA_ReadOnly data = gdal.Open('img_mask.tif', GA_ReadOnly) geoTransform = data.GetGeoTransform() minx = geoTransform[0] maxy = geoTransform[3] maxx = minx + geoTransform[1] * data.RasterXSize miny = maxy + geoTransform[5] * da...
125,202
I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ``` gdalwarp -cutline clipper.shp -crop_to_cutline input.tif output.tif ``` However, the actual area I want to clip to will a...
2014/12/10
['https://gis.stackexchange.com/questions/125202', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37589/']
I don't know if it's possible to clip a raster with an other raster but you could use gdaltindex to build the shapefile with the extent of your raster. <http://www.gdal.org/gdaltindex.html>
Here u can use this code to run an intersection raster tool. You need to be aware of CRS and pixel size (cols and rows). ``` # This file is part of Brazil Data Cube Validation Tools. # Copyright (C) 2020. # Python Native import os # 3rd party import gdal import numpy def raster_intersection(ds1, ds2, nodata1=None, n...
125,202
I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ``` gdalwarp -cutline clipper.shp -crop_to_cutline input.tif output.tif ``` However, the actual area I want to clip to will a...
2014/12/10
['https://gis.stackexchange.com/questions/125202', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37589/']
For irregular polygons, and assuming that your geotiff raster file is a binary raster, you could use [GDAL\_Calc](http://www.gdal.org/gdal_calc.html): ``` GDAL_Calc.py -A Mask.tif -B CutBigImageToClip.tif --outfile=SmallerFile.tif --NoDataValue=0 --Calc="B*(A>0)" ``` This query will populate 0 where Mask.tif <= 0 a...
Here u can use this code to run an intersection raster tool. You need to be aware of CRS and pixel size (cols and rows). ``` # This file is part of Brazil Data Cube Validation Tools. # Copyright (C) 2020. # Python Native import os # 3rd party import gdal import numpy def raster_intersection(ds1, ds2, nodata1=None, n...
125,202
I'm writing a simple utility to crop batches of multi-band geotiff raster files to the same (smaller) area. Using gdalwarp, I can easily crop a file using a single-polygon clipping shapefile: ``` gdalwarp -cutline clipper.shp -crop_to_cutline input.tif output.tif ``` However, the actual area I want to clip to will a...
2014/12/10
['https://gis.stackexchange.com/questions/125202', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/37589/']
The solution in Python directly, without making shape: ``` import gdal from gdalconst import GA_ReadOnly data = gdal.Open('img_mask.tif', GA_ReadOnly) geoTransform = data.GetGeoTransform() minx = geoTransform[0] maxy = geoTransform[3] maxx = minx + geoTransform[1] * data.RasterXSize miny = maxy + geoTransform[5] * da...
Here u can use this code to run an intersection raster tool. You need to be aware of CRS and pixel size (cols and rows). ``` # This file is part of Brazil Data Cube Validation Tools. # Copyright (C) 2020. # Python Native import os # 3rd party import gdal import numpy def raster_intersection(ds1, ds2, nodata1=None, n...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
Just ask Moses ============== From [Artapansus of Alexandria](https://en.wikipedia.org/wiki/Artapanus_of_Alexandria) in his History of the Jews: > > Jealousy of Moses' excellent qualities induced Chenephres to send him > with unskilled troops on a military expedition to Ethiopia, where he > won great victories. A...
Do what any human does and kill them ------------------------------------ Look at human history, you can likely easily name 5 animals off the top of your head that humanity has hunted to extinction. Unless the animals mass breeds like insects, early man has always had dominion over animal life. If these people truly...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
Just ask Moses ============== From [Artapansus of Alexandria](https://en.wikipedia.org/wiki/Artapanus_of_Alexandria) in his History of the Jews: > > Jealousy of Moses' excellent qualities induced Chenephres to send him > with unskilled troops on a military expedition to Ethiopia, where he > won great victories. A...
Why do you have snakes on the plain in the first place? Rodents! So you need to find a way to control the rodent populations. If the snakes have nothing to eat, they won't hang about in large numbers. Introduce species that will eliminate the rodents and the snakes won't have prey. This is why Bast was an Egyptian God...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
Just ask Moses ============== From [Artapansus of Alexandria](https://en.wikipedia.org/wiki/Artapanus_of_Alexandria) in his History of the Jews: > > Jealousy of Moses' excellent qualities induced Chenephres to send him > with unskilled troops on a military expedition to Ethiopia, where he > won great victories. A...
> > Kookaburra roams through the plains with glee, eating all the snakes > with a grin is he, laugh, Kookaburra laugh, Kookaburra full your stomach > must be. > > > The humble Kookaburra! <https://en.wikipedia.org/wiki/Kookaburra> A less well known Australian bird who loves to eat snakes and small rodents (solve...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
Why do you have snakes on the plain in the first place? Rodents! So you need to find a way to control the rodent populations. If the snakes have nothing to eat, they won't hang about in large numbers. Introduce species that will eliminate the rodents and the snakes won't have prey. This is why Bast was an Egyptian God...
Do what any human does and kill them ------------------------------------ Look at human history, you can likely easily name 5 animals off the top of your head that humanity has hunted to extinction. Unless the animals mass breeds like insects, early man has always had dominion over animal life. If these people truly...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
> > Kookaburra roams through the plains with glee, eating all the snakes > with a grin is he, laugh, Kookaburra laugh, Kookaburra full your stomach > must be. > > > The humble Kookaburra! <https://en.wikipedia.org/wiki/Kookaburra> A less well known Australian bird who loves to eat snakes and small rodents (solve...
Do what any human does and kill them ------------------------------------ Look at human history, you can likely easily name 5 animals off the top of your head that humanity has hunted to extinction. Unless the animals mass breeds like insects, early man has always had dominion over animal life. If these people truly...
72,475
There is an African plain, there are trees, grasses, some seasonal rivers/lakes, and snakes. Upon the plain lives a society of tribesmen (think along the lines of the [Maasai Mara](https://en.wikipedia.org/wiki/Maasai_Mara) people) [![enter image description here](https://l7.alamy.com/zooms/5e1e3bdb36f9477cbb4c5d1f00...
2017/02/28
['https://worldbuilding.stackexchange.com/questions/72475', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/-1/']
Why do you have snakes on the plain in the first place? Rodents! So you need to find a way to control the rodent populations. If the snakes have nothing to eat, they won't hang about in large numbers. Introduce species that will eliminate the rodents and the snakes won't have prey. This is why Bast was an Egyptian God...
> > Kookaburra roams through the plains with glee, eating all the snakes > with a grin is he, laugh, Kookaburra laugh, Kookaburra full your stomach > must be. > > > The humble Kookaburra! <https://en.wikipedia.org/wiki/Kookaburra> A less well known Australian bird who loves to eat snakes and small rodents (solve...
36,096,018
This may be a very typical task yet i am having issued cracking a solution for it. I am using a form which has 2 select options in it ``` <form enctype="multipart/form-data" id="uploadimage" method="post" action="" class="allForms"> <select id="parentCatSel" onchange=listsubcategory(this.value)> <option value="">C...
2016/03/18
['https://Stackoverflow.com/questions/36096018', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1332909/']
Add name attribute to your select inputs. ``` <select id="subCatSel" name="subCatSel"><option value="">Choose Sub category</option> ```
Sorry guys, my terrible bad of coding in the actual code. I missed out on a quote in the select just changed that to it works as wanted!!, thanks everyone
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
I would recommend using [redux toolkit](https://redux-toolkit.js.org/) because it reduces boilerplate code in redux... With [createSlice](https://redux-toolkit.js.org/api/createSlice) you create Action and Reducer at the same time. And in case of dispatching API calls to the backend and performing suitable state mutat...
<https://github.com/vercel/next.js/tree/canary/examples/with-redux-wrapper> cant get any easier than this
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
Assuming you have knowledge in Redux with React. Firstly, install these packages `$ npm install next-redux-wrapper react-redux redux redux-thunk --save` `$ npm install redux-devtools-extension --save-dev` --- Override or create the default App, create the file `./pages/_app.js` as shown below: ```js import withRe...
<https://github.com/vercel/next.js/tree/canary/examples/with-redux-wrapper> cant get any easier than this
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
First i created simple next.js app with "npx create-next-app" Then i installed "npm i redux react-redux redux-thunk redux-devtools-extension Then I created general redux setup in a folder called "store" and folder structure is like the following image and code is for store.js [![enter image description here](https://...
<https://github.com/vercel/next.js/tree/canary/examples/with-redux-wrapper> cant get any easier than this
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
Assuming you have knowledge in Redux with React. Firstly, install these packages `$ npm install next-redux-wrapper react-redux redux redux-thunk --save` `$ npm install redux-devtools-extension --save-dev` --- Override or create the default App, create the file `./pages/_app.js` as shown below: ```js import withRe...
I would recommend using [redux toolkit](https://redux-toolkit.js.org/) because it reduces boilerplate code in redux... With [createSlice](https://redux-toolkit.js.org/api/createSlice) you create Action and Reducer at the same time. And in case of dispatching API calls to the backend and performing suitable state mutat...
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
I would recommend using [redux toolkit](https://redux-toolkit.js.org/) because it reduces boilerplate code in redux... With [createSlice](https://redux-toolkit.js.org/api/createSlice) you create Action and Reducer at the same time. And in case of dispatching API calls to the backend and performing suitable state mutat...
Here is my simplest way, you can follow it. <https://github.com/imimran/next-redux-example>
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
Assuming you have knowledge in Redux with React. Firstly, install these packages `$ npm install next-redux-wrapper react-redux redux redux-thunk --save` `$ npm install redux-devtools-extension --save-dev` --- Override or create the default App, create the file `./pages/_app.js` as shown below: ```js import withRe...
First i created simple next.js app with "npx create-next-app" Then i installed "npm i redux react-redux redux-thunk redux-devtools-extension Then I created general redux setup in a folder called "store" and folder structure is like the following image and code is for store.js [![enter image description here](https://...
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
Assuming you have knowledge in Redux with React. Firstly, install these packages `$ npm install next-redux-wrapper react-redux redux redux-thunk --save` `$ npm install redux-devtools-extension --save-dev` --- Override or create the default App, create the file `./pages/_app.js` as shown below: ```js import withRe...
Here is my simplest way, you can follow it. <https://github.com/imimran/next-redux-example>
65,421,043
I want to create a new table from query result in SSMS: Query result: ``` select table1.col1, table1.col2, table2.col3 from table1 inner join table2 on table1.col1 = table2.col1 order by col1 asc; ``` How can I create new table from above result: I have tried ``` select * into new_table from ( select table1.c...
2020/12/23
['https://Stackoverflow.com/questions/65421043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/14875495/']
First i created simple next.js app with "npx create-next-app" Then i installed "npm i redux react-redux redux-thunk redux-devtools-extension Then I created general redux setup in a folder called "store" and folder structure is like the following image and code is for store.js [![enter image description here](https://...
Here is my simplest way, you can follow it. <https://github.com/imimran/next-redux-example>
12,636,300
hello everyone i am unable to recieve asynchronous message using active mq, below code which i am using for publish message and subscribe it. ``` public class publishMessage extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException...
2012/09/28
['https://Stackoverflow.com/questions/12636300', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1565086/']
Shell globbing? ``` cp -r J* /path/to/other/dir ```
``` cp -r J* /destination/path/ ``` the -r option lets you copy directories recursively
368,914
I'm lost on where to start on this proof: Using the fact that $A^m A^n = A^{m+n}$ , prove the identity $F\_m F\_n + F\_{m−1} F\_{n−1} = F\_{m+n−1}$ I want to use induction starting with n = 1, but would I also have to make m = 1? I haven't done induction with 2 variables before. or because of $A^m A^n = A^{m+n}$ sh...
2013/04/22
['https://math.stackexchange.com/questions/368914', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/66788/']
You can actually use induction here. We induct on $n$ proving that the relation holds for all $m$ at each step of the way. For $n=2$, $F\_1 = F\_2 =1$ and the identity $F\_m+F\_{m-1}=F\_{m+1}$ is true for all $m$ by the definition of the Fibonacci sequence. We now have a strong induction hypothesis that the identity ho...
Fibonacci numbers have a [matrix representation](http://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form): $$\left( \begin{smallmatrix} F\_{n+1} & F\_n \\ F\_n & F\_{n-1}\end{smallmatrix} \right) = \left( \begin{smallmatrix} 1 & 1 \\ 1 & 0 \end{smallmatrix}\right)^n$$ This is probably what you were meant to use for...
368,914
I'm lost on where to start on this proof: Using the fact that $A^m A^n = A^{m+n}$ , prove the identity $F\_m F\_n + F\_{m−1} F\_{n−1} = F\_{m+n−1}$ I want to use induction starting with n = 1, but would I also have to make m = 1? I haven't done induction with 2 variables before. or because of $A^m A^n = A^{m+n}$ sh...
2013/04/22
['https://math.stackexchange.com/questions/368914', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/66788/']
You can actually use induction here. We induct on $n$ proving that the relation holds for all $m$ at each step of the way. For $n=2$, $F\_1 = F\_2 =1$ and the identity $F\_m+F\_{m-1}=F\_{m+1}$ is true for all $m$ by the definition of the Fibonacci sequence. We now have a strong induction hypothesis that the identity ho...
Hint: If $$v\_{n}=\left[ \begin{array} {c} F\_{n+1} \\ F\_{n}\end{array}\right]$$Then:$$F\_{m}F\_{n}+F\_{m-1}F\_{n-1}=\langle v\_{m-1},v\_{n-1}\rangle$$where $\langle \cdot, \cdot \rangle$ is the standard inner product on $\mathbb{R}^2$. This along with Vadim123's hint should get the job done.
106,460
I have a system which triggers a backup on repeated frequency and/or disk fill. For the the repeat frequency, my form shows the following (same field repeated in one image): [![enter image description here](https://i.stack.imgur.com/Se3aa.jpg)](https://i.stack.imgur.com/Se3aa.jpg) You can select a different values in...
2017/03/29
['https://ux.stackexchange.com/questions/106460', 'https://ux.stackexchange.com', 'https://ux.stackexchange.com/users/99190/']
The problem comes when you specify a pattern rather than an interval. Technically, it's the period you want to set, not the frequency. Frequency being the number of occurrences of a repeating event per unit time vs period as the duration of time of one cycle. When you specify a pattern like every X at Y you have to ...
To provide an example of a robust way to schedule a task I'd look at programs made for it - A tried and tested example is Microsoft Outlook. It's not pretty, but neither is our calendar, nor the way humans like to schedule things. [![Example image](https://i.stack.imgur.com/ZxZi3.jpg)](https://i.stack.imgur.com/ZxZi3....
45,932,788
I created a SharePoint Framework Webpart. I call a webservice that returns some data from sharepoint (terms from termstore), and for each term i generate an html that display the term. On the onclick of each term i want to call a typescript function, passing the term as parameters, to get its children terms. This c...
2017/08/29
['https://Stackoverflow.com/questions/45932788', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8191909/']
There is one more way to attach event listener. Refer below code sample. This works perfectly for me: (Note: This is a basic idea. You can refer this code and make changes to yours accordingly.) ``` public render(): void{ this.domElement.innerHTML = ` <div class="form-group"> <button class="btn btn-success" id=...
Rather onClick instead of onclick. Then check to make sure that you get into your "readIterm" method by calling the console (console.log).
20,621,868
I'm trying to import a large amount of data into a flat table using CSV. During the import BigQuery reports: ``` - File: 0 / Line:6659 / Field:11: Could not parse '' as a timestamp ``` In the schema I have 2 timestamps: fields 4 and 11 . Both are nullable. For the second timestamp the row entry on field 11 is indeed...
2013/12/16
['https://Stackoverflow.com/questions/20621868', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3108981/']
Note the difference between a null value and an empty string. Line 6659 copied above has empty strings, but not nulls. To reproduce, I created a table with this schema: ``` [{"name":"a","type":"TIMESTAMP","mode":"NULLABLE"}, {"name":"b","type":"TIMESTAMP","mode":"NULLABLE"}] ``` Then uploaded this file to it: ```...
I had similar problem like this The error was ``` - File: 2 / Line:9940 / Field:13: Day 0-0-0 does not exist for timestamp: 0000-00-00 00:00:00 "9718470";"2769586jfghjkdf";"2015-08-03 15:57:28";"2015-08-03 16:10:10";"479";"128833308";"May 2015";"1461782";"ab_20150616";"1130567689";"69466";"emailid@hotmail.com";"0...
62,075,043
Very new to Flutter and Dart, so pardon me for the ill-phrased question. This is a generic code that I have: ``` // Constructor class class ctr { String i; ctr(String a){ this.a = a; } // New variables based on contsructor var ctrA = ctr('a'); var ctrB = ctr('b'); var ctrC = ctr('c'); // Storing the varia...
2020/05/28
['https://Stackoverflow.com/questions/62075043', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9234811/']
Unlike previous suggestion, you should use `pdfplumber.open` instead of `pdfplumber.load`! [The link](https://github.com/jsvine/pdfplumber) for the repo of pdfplumber. > > Warning: pdfplumber.load is deprecated.Please use pdfplumber.open > (with same arguments) instead. > > > Hence, the below code extracts entire...
Here is an example, which uses `io.BytesIO()` instead of creating any files on the hard drive. Note that `pdfplumber.load(...)` is used instead of `pdfplumber.open(...)`. ``` import urllib3 import pdfplumber import io def read_pdf(url: str) -> str: http = urllib3.PoolManager() temp = io.BytesIO() temp.w...
52,837,952
What I am trying to do is as follows: I am taking few elements of an array, comparing them with a fixed value and trying to create a vector out of it. Here is a piece of code: ``` architecture behav of main_ent is ... type f_array is array(0 to 8) of std_logic_vector(7 downto 0); signal ins_f_array: f_array; sign...
2018/10/16
['https://Stackoverflow.com/questions/52837952', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9547499/']
This is because the = function in VHDL returns a boolean, not a std\_logic. In VHDL '93, there is no tidy way to do this, other than set each bit manually: ``` sel_sig_cmd(3) <= '1' when (ins_f_array(4) = x"3A") else '0' sel_sig_cmd(2) <= '1' when (ins_f_array(3) = x"3A") else '0' -- etc ``` but in VHDL 2008, there ...
The answer from Tricky is a good one to follow. However, if you want to implement it in a process, then the process can be rewritten as follows : ``` architecture behav of main_ent is ... type f_array is array(0 to 8) of std_logic_vector(7 downto 0); signal ins_f_array: f_array; signal sel_sig_cmd : std_logic_vector(...
52,837,952
What I am trying to do is as follows: I am taking few elements of an array, comparing them with a fixed value and trying to create a vector out of it. Here is a piece of code: ``` architecture behav of main_ent is ... type f_array is array(0 to 8) of std_logic_vector(7 downto 0); signal ins_f_array: f_array; sign...
2018/10/16
['https://Stackoverflow.com/questions/52837952', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9547499/']
This is because the = function in VHDL returns a boolean, not a std\_logic. In VHDL '93, there is no tidy way to do this, other than set each bit manually: ``` sel_sig_cmd(3) <= '1' when (ins_f_array(4) = x"3A") else '0' sel_sig_cmd(2) <= '1' when (ins_f_array(3) = x"3A") else '0' -- etc ``` but in VHDL 2008, there ...
You can overload the "=" operator : ``` library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity tb is end entity; architecture behav of tb is function "=" (Left, Right: std_logic_vector) return std_logic is begin if (Left = Right) then return '1'; else return '0'; end...
52,837,952
What I am trying to do is as follows: I am taking few elements of an array, comparing them with a fixed value and trying to create a vector out of it. Here is a piece of code: ``` architecture behav of main_ent is ... type f_array is array(0 to 8) of std_logic_vector(7 downto 0); signal ins_f_array: f_array; sign...
2018/10/16
['https://Stackoverflow.com/questions/52837952', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9547499/']
The answer from Tricky is a good one to follow. However, if you want to implement it in a process, then the process can be rewritten as follows : ``` architecture behav of main_ent is ... type f_array is array(0 to 8) of std_logic_vector(7 downto 0); signal ins_f_array: f_array; signal sel_sig_cmd : std_logic_vector(...
You can overload the "=" operator : ``` library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity tb is end entity; architecture behav of tb is function "=" (Left, Right: std_logic_vector) return std_logic is begin if (Left = Right) then return '1'; else return '0'; end...
69,934,658
Sorry for the lousy text in the question? I can't come up with a summarized way to ask this question. I have a dataframe (variable df) such as the below: ``` df ``` | ID | A | B | C | | --- | --- | --- | --- | | 1 | m | nan | nan | | 2 | n | nan | nan | | 3 | b | nan | nan | | 1 | nan | t | nan | | 2 | nan | e | na...
2021/11/11
['https://Stackoverflow.com/questions/69934658', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10608268/']
Looks like you only need `groupby().first()`: ``` df.groupby('ID', as_index=False).first() ``` Output: ``` ID A B C 0 1 m t y 1 2 n e u 2 3 b r i ```
Use `stack_unstack()` as suggested by @QuangHoang if `ID` is the index: ``` >>> df.stack().unstack().reset_index() A B C ID 1 m t y 2 n e u 3 b r i ``` You can use `melt` and `pivot`: ``` >>> df.melt('ID').dropna().pivot('ID', 'variable', 'value') \ .rename_axis(columns=None).reset_...
42,156,145
am writing a hook to a function using the basic x86 method of inserting a jump worth 5 bytes. My code is rusty but I think i have the logic. I get a segmentation fault error when I run against LD\_PRELOAD env var. Am basically using a replacement function, hook func, trampoline function to modify and return the origina...
2017/02/10
['https://Stackoverflow.com/questions/42156145', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6423730/']
You can pass it as null. It's mentioned in the doc also > > inCertificate is the Object which is holding Certificate Information. > Pass this as null if no client certificate is used by the merchant (as > given above in the Prerequisites section) > > >
I suggest you to use PGSDK 2.0 instead of old version which is not required any **Client side certificate** ``` ---------- protected void onCreate(Bundle savedInstanceState) { super.onCreate( savedInstanceState ); PaytmButton.setOnClickListener( new OnClickListener() { @Override pu...
21,644,400
I am using the django-autoslug package with a project and, though the documentation is simple enough, I cannot get it to populate the database field with the slug. models.py ``` class Thread(models.Model): forum = models.ForeignKey(Forum) title = models.CharField(max_length=100) date_created = models.Date...
2014/02/08
['https://Stackoverflow.com/questions/21644400', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2626646/']
``` File file[] = Environment.getExternalStorageDirectory().listFiles(); recursiveFileFind(file); public void recursiveFileFind(File[] file1){ int i = 0; String filePath=""; if(file1!=null){ while(i!=file1.length){ filePath = file1[i].getAbsolutePath(); if(file1[i].isDirectory()){ ...
This code will give internal files. ``` String[] SavedFiles; ArrayList<String> arrList; SavedFiles = getApplicationContext().fileList(); arrList = new ArrayList<String>(); if(SavedFiles != null) { for(int i=0; i<SavedFiles.length; i++) { arrLis...
328,753
I know this is a longshot but I was wondering if anyone knows if this is possible.
2008/11/30
['https://Stackoverflow.com/questions/328753', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Most browsers set the [HTTP\_REFERRER](http://en.wikipedia.org/wiki/Referer) header to the current URL when requesting a linked document. However, it can be spoofed so don't use it for security.
I know nothing about air. But if AIR has JavaScript access, and you can access the container document ( [How do I share a javascript object between different pages in Adobe AIR?](https://stackoverflow.com/questions/193130/how-do-i-share-a-javascript-object-between-different-pages-in-adobe-air) ) then all you need to ...
328,753
I know this is a longshot but I was wondering if anyone knows if this is possible.
2008/11/30
['https://Stackoverflow.com/questions/328753', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Most browsers set the [HTTP\_REFERRER](http://en.wikipedia.org/wiki/Referer) header to the current URL when requesting a linked document. However, it can be spoofed so don't use it for security.
I reckon this is rather late, but since I was searching for the same information 3 years later, here it goes. [LoaderInfo.loaderUrl](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html#loaderURL) should give you the information you are after. HTH!
50,032,109
I'm trying to create a script that will list the servers I need to list along with the latency returned from each server, I need the list to be in ascending or descending order based on ping. What I've come up with so far has given basically what I want, but if the ping returned is above 100 on one server, the other v...
2018/04/25
['https://Stackoverflow.com/questions/50032109', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9631948/']
There are several ways to address your problem. You could [format](http://social.technet.microsoft.com/wiki/contents/articles/7855.using-the-f-format-operator-in-powershell.aspx) the number in a way that aligns integer sort order and string sort order as [LotPings suggested](https://stackoverflow.com/questions/5003210...
Here is an alternative to the way you are doing things that will give output that can be sorted and formatted more easily: ``` function Test-Network { $array = ("<ServerName>","<ipaddress>"), ("<ServerName>","<ipaddress>"), ("<ServerName>","<ipaddress>") $array | ForEach-Object { ...
50,032,109
I'm trying to create a script that will list the servers I need to list along with the latency returned from each server, I need the list to be in ascending or descending order based on ping. What I've come up with so far has given basically what I want, but if the ping returned is above 100 on one server, the other v...
2018/04/25
['https://Stackoverflow.com/questions/50032109', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9631948/']
Here is an alternative to the way you are doing things that will give output that can be sorted and formatted more easily: ``` function Test-Network { $array = ("<ServerName>","<ipaddress>"), ("<ServerName>","<ipaddress>"), ("<ServerName>","<ipaddress>") $array | ForEach-Object { ...
Cast string to integer ``` TestNetwork | Sort {[int]($_.numerical)} -Descending ```
50,032,109
I'm trying to create a script that will list the servers I need to list along with the latency returned from each server, I need the list to be in ascending or descending order based on ping. What I've come up with so far has given basically what I want, but if the ping returned is above 100 on one server, the other v...
2018/04/25
['https://Stackoverflow.com/questions/50032109', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9631948/']
There are several ways to address your problem. You could [format](http://social.technet.microsoft.com/wiki/contents/articles/7855.using-the-f-format-operator-in-powershell.aspx) the number in a way that aligns integer sort order and string sort order as [LotPings suggested](https://stackoverflow.com/questions/5003210...
Cast string to integer ``` TestNetwork | Sort {[int]($_.numerical)} -Descending ```
11,824,664
Is there a way to render background texture with alpha in a webpage? I want to have texture on top of a gradient so I can see through it. I'm not using canvas for this (although I do use canvas for some other animation effect)
2012/08/06
['https://Stackoverflow.com/questions/11824664', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/335999/']
You can achieve that with CSS3 Multiple Backgrounds and CSS3 Gradients. Here is a [good article](http://snook.ca/archives/html_and_css/multiple-bg-css-gradients "CSS Backgrounds and Gradients") on the subject. **Edit**: To clarify, you basically need to just define two backgrounds on the object. First one would be the...
You could just use a big div as background and add the gradient and the png inside the div and then use css to resize and position
11,824,664
Is there a way to render background texture with alpha in a webpage? I want to have texture on top of a gradient so I can see through it. I'm not using canvas for this (although I do use canvas for some other animation effect)
2012/08/06
['https://Stackoverflow.com/questions/11824664', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/335999/']
You can achieve that with CSS3 Multiple Backgrounds and CSS3 Gradients. Here is a [good article](http://snook.ca/archives/html_and_css/multiple-bg-css-gradients "CSS Backgrounds and Gradients") on the subject. **Edit**: To clarify, you basically need to just define two backgrounds on the object. First one would be the...
You don't need CSS3 for this. Use a seamless background tile on `html` and an alpha gradient on the `body`. ``` html {background: #fff url(path/to/bg-tile.png) repeat 0 0;} body {background: transparent url(path/to/gradient.png) repeat-x 0 0;} ``` [Multiple background images are not supported in IE<9](http://caniuse...
11,824,664
Is there a way to render background texture with alpha in a webpage? I want to have texture on top of a gradient so I can see through it. I'm not using canvas for this (although I do use canvas for some other animation effect)
2012/08/06
['https://Stackoverflow.com/questions/11824664', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/335999/']
You don't need CSS3 for this. Use a seamless background tile on `html` and an alpha gradient on the `body`. ``` html {background: #fff url(path/to/bg-tile.png) repeat 0 0;} body {background: transparent url(path/to/gradient.png) repeat-x 0 0;} ``` [Multiple background images are not supported in IE<9](http://caniuse...
You could just use a big div as background and add the gradient and the png inside the div and then use css to resize and position
65,119,282
Assuming I had this result of `print_r` below `Array ( [0] => 10 [1] => 11 )` which is the result of months within a specific year *october* and *november*. I wonder how to return true if the array return in correctly order months until December example => `Array ( [0] => 8 [1] => 9 [2] => 10 [3] => 11 [4] => 12)` . an...
2020/12/03
['https://Stackoverflow.com/questions/65119282', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11393883/']
A little hesitant to post an answer because the requirements for determining validity are vague but from your comments these are invalid: * 3,4,6 (missing 5) * 3,4,4,5 (duplicate 4) * 0,1 (0 is invalid) * 10,11,12,13 (13 is invalid) * 9,10,11 (invalid because 12 is missing) <http://sandbox.onlinephpfunctions.com/code...
Try this solution: ``` function isValidOrder(array $array): bool { $prevElement = $array[0] - 1; foreach($array as $element) { if (($prevElement + 1) !== $element) { return false; } $prevElement++; } return true; } ```
65,119,282
Assuming I had this result of `print_r` below `Array ( [0] => 10 [1] => 11 )` which is the result of months within a specific year *october* and *november*. I wonder how to return true if the array return in correctly order months until December example => `Array ( [0] => 8 [1] => 9 [2] => 10 [3] => 11 [4] => 12)` . an...
2020/12/03
['https://Stackoverflow.com/questions/65119282', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11393883/']
A little hesitant to post an answer because the requirements for determining validity are vague but from your comments these are invalid: * 3,4,6 (missing 5) * 3,4,4,5 (duplicate 4) * 0,1 (0 is invalid) * 10,11,12,13 (13 is invalid) * 9,10,11 (invalid because 12 is missing) <http://sandbox.onlinephpfunctions.com/code...
Maybe you can try this solution ``` function isValidSequence(array $sequence) { for($i=0; $i < count($sequence) - 1; ++$i) { if ($sequence[$i+1] !== ($sequence[$i] + 1)) { //if not in sequence return false; } } //return true if on sequence or only one element return true; } ```
67,631,531
I need to write a script to "validate" email addresses by taking user input and checking that the string is separated into 2 segments by an '@' symbol (it's honestly pointless - I know). I can figure out validating the '@' symbol, but I can't seem to figure out how to implement this to validate that the '@' separates ...
2021/05/21
['https://Stackoverflow.com/questions/67631531', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15861303/']
Probably the simplest way to handle this is by using a regular expression (regex), as although it is possible with raw Python (namely by using str.split() and checking the returned values) your code will be much harder to parse. Here is a regex that should only match with valid email addresses: ``` ^(\w|\.|\_|\-)+[@]...
You can use str.split() and maybe use regular expressions. <https://www.geeksforgeeks.org/python-string-split/> However, instead of checking if there are spaces in email address, simply find and delete them using str.split(' ') and create valid email.
67,631,531
I need to write a script to "validate" email addresses by taking user input and checking that the string is separated into 2 segments by an '@' symbol (it's honestly pointless - I know). I can figure out validating the '@' symbol, but I can't seem to figure out how to implement this to validate that the '@' separates ...
2021/05/21
['https://Stackoverflow.com/questions/67631531', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15861303/']
Probably the simplest way to handle this is by using a regular expression (regex), as although it is possible with raw Python (namely by using str.split() and checking the returned values) your code will be much harder to parse. Here is a regex that should only match with valid email addresses: ``` ^(\w|\.|\_|\-)+[@]...
You can use regular expressions to check if the String has an '@' symbol in the middle: ``` import re address = str(input("\n Email Address: ")) if(re.match('.+@.+', address)): print("address has '@' in the middle") ``` `.+@.+` is a regular expression that checks if the String has 1 or more characters (`.+`) ...
56,455,406
After adding $table->engine = 'MyISAM'; seem foreign key is not working anymore. This my main table ``` public function up() { Schema::create('users', function (Blueprint $table) { $table->engine = 'MyISAM'; $table->integer('id'); $table->string('user_id',20); $table->string('name'); $table->primary(['user_id','id']);...
2019/06/05
['https://Stackoverflow.com/questions/56455406', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10939437/']
Change Jquery ``` $('li.has-ul a').click(function() { $(this).parent().find('.sub-ul').slideToggle(500); $(this).parent().toggleClass('active'); /*event.preventDefault();*/ }); ``` <https://jsfiddle.net/lalji1051/kp8x4e7w/4/>
I hope this will help you. ``` $('li.has-ul a').click(function() { $(this).siblings('.sub-ul').slideToggle(500); $(this).parent().toggleClass('active'); event.preventDefault(); }); ```
25,342,121
I have the following (intended to be valid) XML: ``` <Series> <A> <id>1</id> </A> <B> <id>1</id> </B> <B> <id>1</id> </B> <B> <id>2</id> </B> </Series> ``` Using XSD 1.1 and XPath 2.0, I want to assert the maximum number of elements named "B" that share...
2014/08/16
['https://Stackoverflow.com/questions/25342121', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1336944/']
XML Schema 1.1 assertions *can* handle all of XPath 2.0, but according to the spec ([section 3.13.4](http://www.w3.org/TR/xmlschema11-1/#assertion-validation)) > > 1.3 From the "partial" ·post-schema-validation infoset·, a data model instance is constructed as described in [XDM]. The root node of the [XDM] instance i...
I found an answer to the question of how to control the number of permissible siblings. The key was to not put the assert within the sibling's type, but in the parent. The assert clause was also changed because of this to: `every $aid in child::element(A)/id satisfies (count(child::element(B)[child::id = $aid]) le 2)`...
22,296,301
I was wondering what is the best way to add a border to my elements without extending its dimensions. As far as I know, there are two ways to achieve it: `box-sizing:border-box;` and an inset `box-shadow`. Which one is wise to use and why?
2014/03/10
['https://Stackoverflow.com/questions/22296301', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1211785/']
Well `box-shadow` isn't a border, it's a shadow, so this question pretty much answers itself. If you wish to add a border without increasing an element's dimensions, you'd use `box-sizing: border-box`, as this is what it's designed for. From [the specification](http://www.w3.org/TR/2004/CR-css3-ui-20040511/#box-sizin...
I would suggest to use `box-sixing:border-box;` because it's not affecting the content of the element in connection to a usual CSS border. An inset-shadow might overlap the contents. In addition to that there's a better browser support for `box-sizing:border-box` like Mathias commented.
22,296,301
I was wondering what is the best way to add a border to my elements without extending its dimensions. As far as I know, there are two ways to achieve it: `box-sizing:border-box;` and an inset `box-shadow`. Which one is wise to use and why?
2014/03/10
['https://Stackoverflow.com/questions/22296301', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1211785/']
I would suggest to use `box-sixing:border-box;` because it's not affecting the content of the element in connection to a usual CSS border. An inset-shadow might overlap the contents. In addition to that there's a better browser support for `box-sizing:border-box` like Mathias commented.
The official way of course is to use `box-sizing: border-box`. This will include both the border and the padding in the width and height of the element. If you use a shadow with a spread distance, you can get the same effect as a border, except that the shadow is not part of the dimensions of the element, so it may ov...
22,296,301
I was wondering what is the best way to add a border to my elements without extending its dimensions. As far as I know, there are two ways to achieve it: `box-sizing:border-box;` and an inset `box-shadow`. Which one is wise to use and why?
2014/03/10
['https://Stackoverflow.com/questions/22296301', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1211785/']
Well `box-shadow` isn't a border, it's a shadow, so this question pretty much answers itself. If you wish to add a border without increasing an element's dimensions, you'd use `box-sizing: border-box`, as this is what it's designed for. From [the specification](http://www.w3.org/TR/2004/CR-css3-ui-20040511/#box-sizin...
The official way of course is to use `box-sizing: border-box`. This will include both the border and the padding in the width and height of the element. If you use a shadow with a spread distance, you can get the same effect as a border, except that the shadow is not part of the dimensions of the element, so it may ov...
9,979,467
I am using `pdb` (actually `ipdb`) to debug my Django `models.py`. In particular I am trying to debug these lines of code: ``` def add_can_view( sender, **kwargs ) : #import ipdb; ipdb.set_trace() for content_type in ContentType.objects.all(): Permission.objects.create( content_type = conte...
2012/04/02
['https://Stackoverflow.com/questions/9979467', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150923/']
Use `dir` (e.g. `dir(content_type)`) to get a list of attributes (including methods). In relation to django models, there is also a lot of information inside the `_meta` property. Explore that with `dir(my_model_object._meta)`.
Your choices are: 1. [dir](http://docs.python.org/library/functions.html#dir) to get a list of the attributes and methods of an object 2. `content_type.__class__` to learn the class of the object 3. [help](http://docs.python.org/library/functions.html#help) to show the documentation in the console so you don't have to...
9,979,467
I am using `pdb` (actually `ipdb`) to debug my Django `models.py`. In particular I am trying to debug these lines of code: ``` def add_can_view( sender, **kwargs ) : #import ipdb; ipdb.set_trace() for content_type in ContentType.objects.all(): Permission.objects.create( content_type = conte...
2012/04/02
['https://Stackoverflow.com/questions/9979467', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150923/']
Your choices are: 1. [dir](http://docs.python.org/library/functions.html#dir) to get a list of the attributes and methods of an object 2. `content_type.__class__` to learn the class of the object 3. [help](http://docs.python.org/library/functions.html#help) to show the documentation in the console so you don't have to...
Since you're using `ipdb` (and not `pdb`), a faster alternative to `dir` is using the built-in tab completion: ``` ipdb> foo="" ipdb> foo. #press tab after writing the dot foo.capitalize foo.islower foo.rpartition foo.center foo.isspace foo.rsplit foo.count foo.istitle foo.rstrip foo....
9,979,467
I am using `pdb` (actually `ipdb`) to debug my Django `models.py`. In particular I am trying to debug these lines of code: ``` def add_can_view( sender, **kwargs ) : #import ipdb; ipdb.set_trace() for content_type in ContentType.objects.all(): Permission.objects.create( content_type = conte...
2012/04/02
['https://Stackoverflow.com/questions/9979467', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150923/']
Use `dir` (e.g. `dir(content_type)`) to get a list of attributes (including methods). In relation to django models, there is also a lot of information inside the `_meta` property. Explore that with `dir(my_model_object._meta)`.
Since you're using `ipdb` (and not `pdb`), a faster alternative to `dir` is using the built-in tab completion: ``` ipdb> foo="" ipdb> foo. #press tab after writing the dot foo.capitalize foo.islower foo.rpartition foo.center foo.isspace foo.rsplit foo.count foo.istitle foo.rstrip foo....
68,651,869
I'm working on a project where there are four turtles in the middle of a circle, and they each follow a random path until one of them gets out. The last part is that if two or more turtles bump into each other, they go two steps back towards the center. I have everything except that, and I'm not sure how to proceed. Be...
2021/08/04
['https://Stackoverflow.com/questions/68651869', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16440183/']
You can't run background jobs on Cloud Run. Wrap it in a webserver as proposed by MBHA if the process take less than 1h. Else you can you GKE Autopilot to run your container for a while. you pay only when your container run. And the first cluster is free. You can have a try on it! As hack you can run your container i...
I've run in to a similar issue with building custom image on MAC + deploying in to Cloud Run. In my case, it turned out to be the docker platform causing the problem. The way I isolated this was by building the same image in Cloud Shell and that would work perfectly fine in Cloud Run. Now, if you need to build it loca...
68,651,869
I'm working on a project where there are four turtles in the middle of a circle, and they each follow a random path until one of them gets out. The last part is that if two or more turtles bump into each other, they go two steps back towards the center. I have everything except that, and I'm not sure how to proceed. Be...
2021/08/04
['https://Stackoverflow.com/questions/68651869', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16440183/']
You can't run background jobs on Cloud Run. Wrap it in a webserver as proposed by MBHA if the process take less than 1h. Else you can you GKE Autopilot to run your container for a while. you pay only when your container run. And the first cluster is free. You can have a try on it! As hack you can run your container i...
The explanation is in your question: > > I am running a background task, nothing to expose > > > A cloud run application, so your container, must be listening for incoming HTTP requests as stated in the [Container runtime contract](https://cloud.google.com/run/docs/reference/container-contract#port). That's why i...
45,684,925
I have a drop down in my form (<https://ant.design/components/select>). In this select drop down I have the onChange to call a function. Inside 'onChange' I want to pass the event as a parameter to my function. The problem is: when the onChange occurs, only the selected value is passed, but I want the entire event. *...
2017/08/15
['https://Stackoverflow.com/questions/45684925', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4956634/']
I found a solution. Just use: onSelect(), passing the value and the event. ``` handleOnChange = (value, event) => { ...code here } render() { render( <Form> <Select onSelect={(value, event) => this.handleOnChange(value, event)}> <Option valu...
The `Select` component that you use is the one that handle the `onChange` and call your "outer" function. What you can try is use the synthetic event variable inside your function, it might work: ``` handleOnChange = (selectedValue) => { console.log(selectedValue); // The value from the inner component consol...
45,684,925
I have a drop down in my form (<https://ant.design/components/select>). In this select drop down I have the onChange to call a function. Inside 'onChange' I want to pass the event as a parameter to my function. The problem is: when the onChange occurs, only the selected value is passed, but I want the entire event. *...
2017/08/15
['https://Stackoverflow.com/questions/45684925', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4956634/']
The `Select` component that you use is the one that handle the `onChange` and call your "outer" function. What you can try is use the synthetic event variable inside your function, it might work: ``` handleOnChange = (selectedValue) => { console.log(selectedValue); // The value from the inner component consol...
Try this, if you dont want to bind in callback in Select onSelect/onChange: ``` toggleActive = name => event => { console.log("name: ",name) // prints "name: Active!" console.log("event: ",event) // event is some data } <Select mode="multiple" style={{ width: '91%' }} placeholder="Stuff" value={this.props.val...
45,684,925
I have a drop down in my form (<https://ant.design/components/select>). In this select drop down I have the onChange to call a function. Inside 'onChange' I want to pass the event as a parameter to my function. The problem is: when the onChange occurs, only the selected value is passed, but I want the entire event. *...
2017/08/15
['https://Stackoverflow.com/questions/45684925', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4956634/']
I found a solution. Just use: onSelect(), passing the value and the event. ``` handleOnChange = (value, event) => { ...code here } render() { render( <Form> <Select onSelect={(value, event) => this.handleOnChange(value, event)}> <Option valu...
Try this, if you dont want to bind in callback in Select onSelect/onChange: ``` toggleActive = name => event => { console.log("name: ",name) // prints "name: Active!" console.log("event: ",event) // event is some data } <Select mode="multiple" style={{ width: '91%' }} placeholder="Stuff" value={this.props.val...
34,570
I am using ``` truffle migrate --reset --compile-all ``` to deploy the contract to local network but in order to use ***new web3.eth.Contract(jsonInterface[, address][, options])***, i should be able to know the contract address, so how could know the address which truffle is deploying?
2017/12/28
['https://ethereum.stackexchange.com/questions/34570', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/22913/']
There are a few ways to do this: 1) In your blockchain node (testrpc|ganache or your test/live network with geth/parity), the contract deployments will be logged and you can see the address created then ``` Transaction: 0xc2471aa6d1e020921d41247ac2a86eb5ad2447e93450347365a25f8d632e34bd Contract created: 0x98445ab3eaa...
If the contract is being deployed you can obviously read it from the log. What if the contract has deployed but you did not take a record of it? There are a few ways to do it: ``` 1. Using etherscan (or Rinkeby scan, Ropsten scan etc..) and search your wallet address used for deployment of the contract. But what if I ...
34,570
I am using ``` truffle migrate --reset --compile-all ``` to deploy the contract to local network but in order to use ***new web3.eth.Contract(jsonInterface[, address][, options])***, i should be able to know the contract address, so how could know the address which truffle is deploying?
2017/12/28
['https://ethereum.stackexchange.com/questions/34570', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/22913/']
There are a few ways to do this: 1) In your blockchain node (testrpc|ganache or your test/live network with geth/parity), the contract deployments will be logged and you can see the address created then ``` Transaction: 0xc2471aa6d1e020921d41247ac2a86eb5ad2447e93450347365a25f8d632e34bd Contract created: 0x98445ab3eaa...
You can find the contract address in your build .json files. For example build/contracts/deployedContract.json Just search the file for address. If you deployed the contract and lost the address/build.json you can simply retrieve it by truffle commands. You just need the name of the deployed contract. For example, I ...
34,570
I am using ``` truffle migrate --reset --compile-all ``` to deploy the contract to local network but in order to use ***new web3.eth.Contract(jsonInterface[, address][, options])***, i should be able to know the contract address, so how could know the address which truffle is deploying?
2017/12/28
['https://ethereum.stackexchange.com/questions/34570', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/22913/']
If the contract is being deployed you can obviously read it from the log. What if the contract has deployed but you did not take a record of it? There are a few ways to do it: ``` 1. Using etherscan (or Rinkeby scan, Ropsten scan etc..) and search your wallet address used for deployment of the contract. But what if I ...
You can find the contract address in your build .json files. For example build/contracts/deployedContract.json Just search the file for address. If you deployed the contract and lost the address/build.json you can simply retrieve it by truffle commands. You just need the name of the deployed contract. For example, I ...
14,248,725
I want to generate some binary arrays to control the brightness of an LED without a controller. Rather than generate the pulse widths on the microcontroller (which would take up instruction cycles that should be used for other things), I'll hard-code them as a look-up table, and loop through the binary array over and o...
2013/01/10
['https://Stackoverflow.com/questions/14248725', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1002358/']
Ok here it is. Basically, what you want to do is minimize the maximum run length of 0 or 1. The general idea is to distribute what we can. For the remainder, just jam it in at the front. N = # of total bits n = # of 1s ``` void pwm(int N, int n, char* z = 0) { if (n == 0) { // degenerate case! for...
Assume you need to light up k points in a grid of n points. You can follow the following probabilistic approach. ``` remk=k remn=n for i in range(n): x[i] = 1 if rand()< remk*1.0/remn else 0 remk-=x[i] remn-=1 ``` x is the array that contains lighting arrangement.
6,595,424
while typing a command like #ifconfig 10.0.0.10 up is it possible to see all "possible" prints inside kernel. I know something like echo t > /proc/sysrq-trigger will give you stack trace with respect to processes running in a system. What I am interested in is, with respect to a 'specific command' how can I get the ke...
2011/07/06
['https://Stackoverflow.com/questions/6595424', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/124330/']
`tail -f /var/log/kern.log` should display any interaction that occurrs in the kernel. It is more or less an equivalent to the `dmesg` command.
`strace ifconfig 10.0.0.10 up` will show all system calls called by ifconfig, but will not get inside kernel's calls
6,595,424
while typing a command like #ifconfig 10.0.0.10 up is it possible to see all "possible" prints inside kernel. I know something like echo t > /proc/sysrq-trigger will give you stack trace with respect to processes running in a system. What I am interested in is, with respect to a 'specific command' how can I get the ke...
2011/07/06
['https://Stackoverflow.com/questions/6595424', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/124330/']
The answer to your question is "ftrace". It is not a tool, not a command, but just a kernel feature built into most modern linux kernel. For example, here you can use ftrace to understand how swap space are implemented (see all the key functions executed and its sequence inside the pastebin files indicated below): <h...
`tail -f /var/log/kern.log` should display any interaction that occurrs in the kernel. It is more or less an equivalent to the `dmesg` command.
6,595,424
while typing a command like #ifconfig 10.0.0.10 up is it possible to see all "possible" prints inside kernel. I know something like echo t > /proc/sysrq-trigger will give you stack trace with respect to processes running in a system. What I am interested in is, with respect to a 'specific command' how can I get the ke...
2011/07/06
['https://Stackoverflow.com/questions/6595424', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/124330/']
The answer to your question is "ftrace". It is not a tool, not a command, but just a kernel feature built into most modern linux kernel. For example, here you can use ftrace to understand how swap space are implemented (see all the key functions executed and its sequence inside the pastebin files indicated below): <h...
`strace ifconfig 10.0.0.10 up` will show all system calls called by ifconfig, but will not get inside kernel's calls
15,767
I can already figure out the melody of a song by 'trial and error' along the C major scale just because it is easier on that scale and eventually become okay at guessing melody. This is fun enough on the recorder but I couldn't figure out how do I make a full use of string instrument such as ukulele. To sum everything ...
2014/02/26
['https://music.stackexchange.com/questions/15767', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/9372/']
Well `user9372`, there are several things that you can do to make the melody sound fuller or accompany yourself. The first thing that you should do is start learning some chords. Here is a chord chart that has plenty of ukulele chords. <http://www.ukalady.com/Images/UkeChart.pdf> As far as having to refer to a music ...
One thing that really opened my eyes musically was the concept of "chord of the moment". I had a teacher that mentioned it in passing once, and it blew my mind that "real musicians" can change chords that fast! Basically, as a song is played through, musicians are always changing chords, and potentially, the key of t...
602
I want to avoid duplicate titles/descriptions on pages (P1,P2...) so I want to add Page 1, Page 2 in the page title. Is there a way to know if we are on pagination and which page it is, but outside of pagination tags? Maybe Stash or something like that? Thank you
2012/11/28
['https://expressionengine.stackexchange.com/questions/602', 'https://expressionengine.stackexchange.com', 'https://expressionengine.stackexchange.com/users/281/']
I wrote a [plugin](https://github.com/tyssen/Page-Number.ee_addon) a while back to do this. It was the first one I wrote so apologies in advance if it's not up to scratch. Example is included in the plugin usage, but basically, place `{exp:page_number url_segment="{segment_1}" limit="5"}` somewhere in your template. ...
With Stash, inside you pagination tag pair you could do: ``` {paginate} {exp:stash:set name="page_number"} Page {current_page} {/exp:stash:set} {!-- any other pagination stuff here --} {/paginate} ``` Which would give you "Page X" accessible as `{exp:stash:get name="page_number"}`. Another poten...
46,006,705
I need to get the OS version and Revision number using PowerShell on a list of remote systems. I need the results that you get from [environment]::OSVersion.Version but on the remote systems. when I run [environment]::OSVersion.Version it returns Major Minor Build Revision 6 1 7601 65536 the ultimate goal would...
2017/09/01
['https://Stackoverflow.com/questions/46006705', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1232402/']
(1) When you make a change to checkbox you need to check all checkboxes and update to textarea. (2) function `updateAllChecked` will handle all the check and update. (3) for check all, if it is checked, set all email checkboxes to checked and call `.change()` to trigger the change event. ```js $("input[name=email]")...
Try something like this, using an array with a final `join()` once your array is populated. I think it's a lot cleaner: ``` checkbox.onclick = (function(chk){ return function() { var valueArray = []; for (var j = 0; j < checkboxes.length; j++) { if (checkboxes[j].che...
46,006,705
I need to get the OS version and Revision number using PowerShell on a list of remote systems. I need the results that you get from [environment]::OSVersion.Version but on the remote systems. when I run [environment]::OSVersion.Version it returns Major Minor Build Revision 6 1 7601 65536 the ultimate goal would...
2017/09/01
['https://Stackoverflow.com/questions/46006705', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1232402/']
(1) When you make a change to checkbox you need to check all checkboxes and update to textarea. (2) function `updateAllChecked` will handle all the check and update. (3) for check all, if it is checked, set all email checkboxes to checked and call `.change()` to trigger the change event. ```js $("input[name=email]")...
Hi guys here is my html and php, I retrieve recipients email from db: ``` here is my html with php, I retrieve recipients email from db.: <?php $i=''; if($result_applied_jobs): ?> <div class="tg-wrap"> <table id="tg-s6tTH" class="tg" style="width: 100%;"> <t...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
See below for my original answer - that pattern has worked well, but recently I've started using a different approach to Service/Activity communication: * Use a [bound service](https://developer.android.com/guide/components/bound-services.html) which enables the Activity to get a direct reference to the Service, thus ...
My solution might not be the cleanest but it should work with no problems. The logic is simply to create a static variable to store your data on the `Service` and update your view each second on your `Activity`. Let's say that you have a `String` on your `Service` that you want to send it to a `TextView` on your `Acti...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
See below for my original answer - that pattern has worked well, but recently I've started using a different approach to Service/Activity communication: * Use a [bound service](https://developer.android.com/guide/components/bound-services.html) which enables the Activity to get a direct reference to the Service, thus ...
I would use a [bound service](http://developer.android.com/guide/components/bound-services.html) to do that and communicate with it by implementing a listener in my activity. So if your app implements myServiceListener, you can register it as a listener in your service after you have bound with it, call listener.onUpda...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
``` Callback from service to activity to update UI. ResultReceiver receiver = new ResultReceiver(new Handler()) { protected void onReceiveResult(int resultCode, Bundle resultData) { //process results or update UI } } Intent instructionServiceIntent = new Intent(context, InstructionService.class); instr...
My solution might not be the cleanest but it should work with no problems. The logic is simply to create a static variable to store your data on the `Service` and update your view each second on your `Activity`. Let's say that you have a `String` on your `Service` that you want to send it to a `TextView` on your `Acti...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
for me the simplest solution was to send a broadcast, in the activity oncreate i registered and defined the broadcast like this (updateUIReciver is defined as a class instance) : ``` IntentFilter filter = new IntentFilter(); filter.addAction("com.hello.action"); updateUIReciver = new BroadcastReceiver() { ...
My solution might not be the cleanest but it should work with no problems. The logic is simply to create a static variable to store your data on the `Service` and update your view each second on your `Activity`. Let's say that you have a `String` on your `Service` that you want to send it to a `TextView` on your `Acti...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
I would use a [bound service](http://developer.android.com/guide/components/bound-services.html) to do that and communicate with it by implementing a listener in my activity. So if your app implements myServiceListener, you can register it as a listener in your service after you have bound with it, call listener.onUpda...
My solution might not be the cleanest but it should work with no problems. The logic is simply to create a static variable to store your data on the `Service` and update your view each second on your `Activity`. Let's say that you have a `String` on your `Service` that you want to send it to a `TextView` on your `Acti...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
Clyde's solution works, but it is a broadcast, which I am pretty sure will be less efficient than calling a method directly. I could be mistaken, but I think the broadcasts are meant more for inter-application communication. I'm assuming you already know how to bind a service with an Activity. I do something sort of l...
You could use android Jetpack's [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) As per the documentation: > > You can extend a `LiveData` object using the singleton pattern to wrap > system services so that they can be shared in your app. The LiveData > object connects to the system s...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
See below for my original answer - that pattern has worked well, but recently I've started using a different approach to Service/Activity communication: * Use a [bound service](https://developer.android.com/guide/components/bound-services.html) which enables the Activity to get a direct reference to the Service, thus ...
You could use android Jetpack's [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) As per the documentation: > > You can extend a `LiveData` object using the singleton pattern to wrap > system services so that they can be shared in your app. The LiveData > object connects to the system s...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
I would use a [bound service](http://developer.android.com/guide/components/bound-services.html) to do that and communicate with it by implementing a listener in my activity. So if your app implements myServiceListener, you can register it as a listener in your service after you have bound with it, call listener.onUpda...
You could use android Jetpack's [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) As per the documentation: > > You can extend a `LiveData` object using the singleton pattern to wrap > system services so that they can be shared in your app. The LiveData > object connects to the system s...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
See below for my original answer - that pattern has worked well, but recently I've started using a different approach to Service/Activity communication: * Use a [bound service](https://developer.android.com/guide/components/bound-services.html) which enables the Activity to get a direct reference to the Service, thus ...
for me the simplest solution was to send a broadcast, in the activity oncreate i registered and defined the broadcast like this (updateUIReciver is defined as a class instance) : ``` IntentFilter filter = new IntentFilter(); filter.addAction("com.hello.action"); updateUIReciver = new BroadcastReceiver() { ...
14,695,580
I have a solution with two projects in it. A portable areas project, and a web site that references the portable areas project, and Both reference MvcContrib. The problem I am have is with the embedded resources, they are giving me a 404 error when I try to get to them. It seems like it's trying to access a physical p...
2013/02/04
['https://Stackoverflow.com/questions/14695580', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/937294/']
for me the simplest solution was to send a broadcast, in the activity oncreate i registered and defined the broadcast like this (updateUIReciver is defined as a class instance) : ``` IntentFilter filter = new IntentFilter(); filter.addAction("com.hello.action"); updateUIReciver = new BroadcastReceiver() { ...
I would use a [bound service](http://developer.android.com/guide/components/bound-services.html) to do that and communicate with it by implementing a listener in my activity. So if your app implements myServiceListener, you can register it as a listener in your service after you have bound with it, call listener.onUpda...
57,344,515
I am trying to get serialized data for the below model with foreign keys but in the output i am only getting the ids instead of the fields of the model associated with hyperlink. I have tried getting all the fields of the Skills model using the commented lines in the profile serializer but no luck models.py ``` clas...
2019/08/04
['https://Stackoverflow.com/questions/57344515', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11879807/']
This should normally work with the following in serializer.py: ``` class ProfileSerializer(serializers.ModelSerializer): skills = SkillSerializer(many=True, read_only=True) # serializes child model's data inside this model's data url = HyperlinkedIdentityField( view_name="profile-detail", lookup_field = "id")...
You can use the concept of nested serializer for the solution. Create two serializer `ProfileReadSerializer` and `ProfileWriteSerializer` serializers.py ```py class SkillSerializer(serializers.ModelSerializer): class Meta: model = Skill fields = ('user', 'skill', 'level') class ProfileReadSe...
53,660,611
I'm trying to chunk 100 lists from a nestled list. I have looked looked through multiple examples on Stack Overflow, but I still cannot get something working correctly. My primary list is named data\_to\_insert and it contains other lists. I would like to extract (chunk) 100 lists from the primary nestled list. How d...
2018/12/06
['https://Stackoverflow.com/questions/53660611', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6083423/']
You can use `random` to select `100` random nested lists from your given list. This will output `3` random nested list from original list, ``` import random l = [[1,2], [3,4], [1,1], [2,3], [3,5], [0,0]] print(random.sample(l, 3)) # output, [[3, 4], [1, 2], [2, 3]] ``` If you do not want a list output then replac...
If i did understand your question correctly, you need first to flatten your list of list then create a chunks of it. Here is an example using `chain.from_iterable` from `itertools module` along with the code you've used to create chunks: ``` from itertools import chain def chunks(elm, length): for k in range(0, l...
53,660,611
I'm trying to chunk 100 lists from a nestled list. I have looked looked through multiple examples on Stack Overflow, but I still cannot get something working correctly. My primary list is named data\_to\_insert and it contains other lists. I would like to extract (chunk) 100 lists from the primary nestled list. How d...
2018/12/06
['https://Stackoverflow.com/questions/53660611', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6083423/']
You can use `random` to select `100` random nested lists from your given list. This will output `3` random nested list from original list, ``` import random l = [[1,2], [3,4], [1,1], [2,3], [3,5], [0,0]] print(random.sample(l, 3)) # output, [[3, 4], [1, 2], [2, 3]] ``` If you do not want a list output then replac...
After some time-consuming research, I developed a solution that worked. The solution below loops through a list of lists and extract 100 lists. ``` # Verifies that the list data_to_insert isn't empty if len(data_to_insert) > 0: # Obtains the length of the data to insert. # The length is the number of sublists #...
53,660,611
I'm trying to chunk 100 lists from a nestled list. I have looked looked through multiple examples on Stack Overflow, but I still cannot get something working correctly. My primary list is named data\_to\_insert and it contains other lists. I would like to extract (chunk) 100 lists from the primary nestled list. How d...
2018/12/06
['https://Stackoverflow.com/questions/53660611', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6083423/']
You can use `random` to select `100` random nested lists from your given list. This will output `3` random nested list from original list, ``` import random l = [[1,2], [3,4], [1,1], [2,3], [3,5], [0,0]] print(random.sample(l, 3)) # output, [[3, 4], [1, 2], [2, 3]] ``` If you do not want a list output then replac...
I developed a second method to accomplish my objective, which is based on [Sufiyan Ghori](https://stackoverflow.com/users/1149423/sufiyan-ghori) suggestion of using `random.` ``` if len(my_nestled_list) > 0: # Obtains the length of the data to insert. # The length is the number of sublists # contained in the ma...
53,660,611
I'm trying to chunk 100 lists from a nestled list. I have looked looked through multiple examples on Stack Overflow, but I still cannot get something working correctly. My primary list is named data\_to\_insert and it contains other lists. I would like to extract (chunk) 100 lists from the primary nestled list. How d...
2018/12/06
['https://Stackoverflow.com/questions/53660611', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6083423/']
If i did understand your question correctly, you need first to flatten your list of list then create a chunks of it. Here is an example using `chain.from_iterable` from `itertools module` along with the code you've used to create chunks: ``` from itertools import chain def chunks(elm, length): for k in range(0, l...
After some time-consuming research, I developed a solution that worked. The solution below loops through a list of lists and extract 100 lists. ``` # Verifies that the list data_to_insert isn't empty if len(data_to_insert) > 0: # Obtains the length of the data to insert. # The length is the number of sublists #...
53,660,611
I'm trying to chunk 100 lists from a nestled list. I have looked looked through multiple examples on Stack Overflow, but I still cannot get something working correctly. My primary list is named data\_to\_insert and it contains other lists. I would like to extract (chunk) 100 lists from the primary nestled list. How d...
2018/12/06
['https://Stackoverflow.com/questions/53660611', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6083423/']
If i did understand your question correctly, you need first to flatten your list of list then create a chunks of it. Here is an example using `chain.from_iterable` from `itertools module` along with the code you've used to create chunks: ``` from itertools import chain def chunks(elm, length): for k in range(0, l...
I developed a second method to accomplish my objective, which is based on [Sufiyan Ghori](https://stackoverflow.com/users/1149423/sufiyan-ghori) suggestion of using `random.` ``` if len(my_nestled_list) > 0: # Obtains the length of the data to insert. # The length is the number of sublists # contained in the ma...
39,947
I noticed the phrase “What gives?” in the following lines of the article of Washington Post (August 29) article, titled “Is Ron Paul being ignored?” > > “And yet talk to almost anyone in politics — Republicans or Democrats — and the idea of Ron Paul as a top-tier candidate for president is greeted with either a laugh...
2011/08/30
['https://english.stackexchange.com/questions/39947', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/3119/']
*What gives?* [means](http://idioms.thefreedictionary.com/What+Gives%3f): > > Inf. What happened?; What went wrong?; What's the problem? > > > Bill: Hi, you guys. What gives? Bob: Nothing, just a little misunderstanding. Tom's a little angry. > > > Bob: Where's my wallet? What gives? > > > Tom: I think one of t...
I've been living in Germany for 17 years, and this morning the similarity of the phrase "What gives?" to the German "Was gibt's?" occurred to me, so I checked the net ... The article ["What Gives with What Gives?"](http://babel.ucsc.edu/Jorge/joseph.html) by Brian Joseph of Ohio State University - also cited above - s...
39,947
I noticed the phrase “What gives?” in the following lines of the article of Washington Post (August 29) article, titled “Is Ron Paul being ignored?” > > “And yet talk to almost anyone in politics — Republicans or Democrats — and the idea of Ron Paul as a top-tier candidate for president is greeted with either a laugh...
2011/08/30
['https://english.stackexchange.com/questions/39947', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/3119/']
*What gives?* [means](http://idioms.thefreedictionary.com/What+Gives%3f): > > Inf. What happened?; What went wrong?; What's the problem? > > > Bill: Hi, you guys. What gives? Bob: Nothing, just a little misunderstanding. Tom's a little angry. > > > Bob: Where's my wallet? What gives? > > > Tom: I think one of t...
[As already observed](https://english.stackexchange.com/a/178303/16833), *What gives?* may well be derived from German *Was gibt es* via the more common contracted form *Was gibt's?*. As a native speaker of German who has spent some years in English-speaking countries I consider this particularly convincing because con...
39,947
I noticed the phrase “What gives?” in the following lines of the article of Washington Post (August 29) article, titled “Is Ron Paul being ignored?” > > “And yet talk to almost anyone in politics — Republicans or Democrats — and the idea of Ron Paul as a top-tier candidate for president is greeted with either a laugh...
2011/08/30
['https://english.stackexchange.com/questions/39947', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/3119/']
*What gives?* [means](http://idioms.thefreedictionary.com/What+Gives%3f): > > Inf. What happened?; What went wrong?; What's the problem? > > > Bill: Hi, you guys. What gives? Bob: Nothing, just a little misunderstanding. Tom's a little angry. > > > Bob: Where's my wallet? What gives? > > > Tom: I think one of t...
Leo Rosten, *The Joys of Yinglish* (1989) claims "What gives" as a characteristic element of what he calls "Yinglish" (hybridized English/Yiddish or Yiddish-inflected English): > > **What gives?** > > > This is a stellar addition to the colloquial phrases of conversational Yinglish. From Yiddish: *Vi geyt's*?" "How...
39,947
I noticed the phrase “What gives?” in the following lines of the article of Washington Post (August 29) article, titled “Is Ron Paul being ignored?” > > “And yet talk to almost anyone in politics — Republicans or Democrats — and the idea of Ron Paul as a top-tier candidate for president is greeted with either a laugh...
2011/08/30
['https://english.stackexchange.com/questions/39947', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/3119/']
I've been living in Germany for 17 years, and this morning the similarity of the phrase "What gives?" to the German "Was gibt's?" occurred to me, so I checked the net ... The article ["What Gives with What Gives?"](http://babel.ucsc.edu/Jorge/joseph.html) by Brian Joseph of Ohio State University - also cited above - s...
Leo Rosten, *The Joys of Yinglish* (1989) claims "What gives" as a characteristic element of what he calls "Yinglish" (hybridized English/Yiddish or Yiddish-inflected English): > > **What gives?** > > > This is a stellar addition to the colloquial phrases of conversational Yinglish. From Yiddish: *Vi geyt's*?" "How...
39,947
I noticed the phrase “What gives?” in the following lines of the article of Washington Post (August 29) article, titled “Is Ron Paul being ignored?” > > “And yet talk to almost anyone in politics — Republicans or Democrats — and the idea of Ron Paul as a top-tier candidate for president is greeted with either a laugh...
2011/08/30
['https://english.stackexchange.com/questions/39947', 'https://english.stackexchange.com', 'https://english.stackexchange.com/users/3119/']
[As already observed](https://english.stackexchange.com/a/178303/16833), *What gives?* may well be derived from German *Was gibt es* via the more common contracted form *Was gibt's?*. As a native speaker of German who has spent some years in English-speaking countries I consider this particularly convincing because con...
Leo Rosten, *The Joys of Yinglish* (1989) claims "What gives" as a characteristic element of what he calls "Yinglish" (hybridized English/Yiddish or Yiddish-inflected English): > > **What gives?** > > > This is a stellar addition to the colloquial phrases of conversational Yinglish. From Yiddish: *Vi geyt's*?" "How...
35,937,244
I have an application where I want to filter a long list of products based on value from "select" containing product types. The filter works, but only after I select something. It initially sets the "Show All" option, but filters out everything. If I select something else, it works, and if I re-select "Show All" it wor...
2016/03/11
['https://Stackoverflow.com/questions/35937244', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4233688/']
I recommend using ng-options instead of ng-repeat over the options: ``` <select id="productFilter" ng-model="productFilter" data-ng-options="type.type as type.name for type in productTypes"> <option value selected="selected">Show all</option> </select> <p data-ng-repeat="product in products | filter:(!!productF...
This is a working example based on code above: <http://jsbin.com/buzafisuko/edit?html,js,output> The Slava.N's comment is correct and you should not wrap productTypes and product in {} Also, JavaScript is a case-sensitive language, `product.Name` is always undefined, you should use `product.name` in your HTML instead...
35,937,244
I have an application where I want to filter a long list of products based on value from "select" containing product types. The filter works, but only after I select something. It initially sets the "Show All" option, but filters out everything. If I select something else, it works, and if I re-select "Show All" it wor...
2016/03/11
['https://Stackoverflow.com/questions/35937244', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4233688/']
I recommend using ng-options instead of ng-repeat over the options: ``` <select id="productFilter" ng-model="productFilter" data-ng-options="type.type as type.name for type in productTypes"> <option value selected="selected">Show all</option> </select> <p data-ng-repeat="product in products | filter:(!!productF...
Use product.Type instead ofType inside 2nd ng-repeat filter
35,937,244
I have an application where I want to filter a long list of products based on value from "select" containing product types. The filter works, but only after I select something. It initially sets the "Show All" option, but filters out everything. If I select something else, it works, and if I re-select "Show All" it wor...
2016/03/11
['https://Stackoverflow.com/questions/35937244', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4233688/']
I recommend using ng-options instead of ng-repeat over the options: ``` <select id="productFilter" ng-model="productFilter" data-ng-options="type.type as type.name for type in productTypes"> <option value selected="selected">Show all</option> </select> <p data-ng-repeat="product in products | filter:(!!productF...
you set $scope.productFilter = ''. so its return by default value blank at filter.