qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
19,048,384 | I have found the following code(see below link) to copy and execute the commands on remote windows machine. I could able to run all the windows commands but When I give C:\file.exe as the input windows command line is not executing my command. Can I execute file in remote machine like this or is any other pythonic way ... | 2013/09/27 | [
"https://Stackoverflow.com/questions/19048384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2670216/"
] | <http://opencobol.add1tocobol.com/#what-are-the-xf4-xf5-and-x91-routines>
The CALL's X"F4", X"F5", X"91" are from MF.
You can find them in the online MF doc under
Library Routines.
F4/F5 are for packing/unpacking bits from/to bytes.
91 is a multi-use call. Implemented are the subfunctions
get/set cobol switches (11, ... | `x'91'` is a general library routine, for a complete list of those see the [MF documentation](https://www.microfocus.com/documentation/visual-cobol/VC22/EclWin/HRCLRHCALL17.html).
This documentation also specifies what its [function 11](https://www.microfocus.com/documentation/visual-cobol/VC22/EclWin/HRCLRHCALL6E.h... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Assuming the length is fixed, you can just interleave the bits of the numbers.
For example, if the vector is $(1,2,3)$ we have $1 = 01\_2$, $2=10\_2$, $3=11\_2$, so the result is $53 = 110101\_2$. The first bit of $53$ is the first bit of $1$, the second bit is the first bit of $2$, ..., the sixth bit of $53$ is the s... | You could use an adaptation of Cantor's method of [counting the rational numbers](http://kaumad.blogspot.com/). Take a two-dimensional vector instead of the rational numbers, include the numbers with alternating sign to get the negatives and you are there.
For higher dimension, you could use the same method rescursivel... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Assuming the length is fixed, you can just interleave the bits of the numbers.
For example, if the vector is $(1,2,3)$ we have $1 = 01\_2$, $2=10\_2$, $3=11\_2$, so the result is $53 = 110101\_2$. The first bit of $53$ is the first bit of $1$, the second bit is the first bit of $2$, ..., the sixth bit of $53$ is the s... | If the vector contains fixed-length integers, then you can compute a digest for it, say using MD5, SHA1, SHA2, etc. This is certainly not bijective (because it's not injective) but is unlikely that there'll any be collisions. |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Assuming the length is fixed, you can just interleave the bits of the numbers.
For example, if the vector is $(1,2,3)$ we have $1 = 01\_2$, $2=10\_2$, $3=11\_2$, so the result is $53 = 110101\_2$. The first bit of $53$ is the first bit of $1$, the second bit is the first bit of $2$, ..., the sixth bit of $53$ is the s... | Actually there is an easy way to map a vector of integers to a single integer in a bijective way. First treat numbers as strings say 0 1 00 01 10 11 .. for 0,1,2,3,4,5, ... then bijectively combine the strings a pair at a time using a method like <http://bijective.dogma.net/compres8.htm>
The method on that page is for... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Here's something that almost works: map the integer vector $(a\_1,a\_2,\dots,a\_n)$ to the (rational) number $2^{a\_1}3^{a\_2}\times\cdots\times p\_n^{a\_n}$, where the numbers $2,3,\dots,p\_n$ are the first $n$ primes. The Unique Factorization Theorem almost guarantees that no two distinct vectors go to the same numbe... | You could use an adaptation of Cantor's method of [counting the rational numbers](http://kaumad.blogspot.com/). Take a two-dimensional vector instead of the rational numbers, include the numbers with alternating sign to get the negatives and you are there.
For higher dimension, you could use the same method rescursivel... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | You could use an adaptation of Cantor's method of [counting the rational numbers](http://kaumad.blogspot.com/). Take a two-dimensional vector instead of the rational numbers, include the numbers with alternating sign to get the negatives and you are there.
For higher dimension, you could use the same method rescursivel... | Actually there is an easy way to map a vector of integers to a single integer in a bijective way. First treat numbers as strings say 0 1 00 01 10 11 .. for 0,1,2,3,4,5, ... then bijectively combine the strings a pair at a time using a method like <http://bijective.dogma.net/compres8.htm>
The method on that page is for... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Here's something that almost works: map the integer vector $(a\_1,a\_2,\dots,a\_n)$ to the (rational) number $2^{a\_1}3^{a\_2}\times\cdots\times p\_n^{a\_n}$, where the numbers $2,3,\dots,p\_n$ are the first $n$ primes. The Unique Factorization Theorem almost guarantees that no two distinct vectors go to the same numbe... | If the vector contains fixed-length integers, then you can compute a digest for it, say using MD5, SHA1, SHA2, etc. This is certainly not bijective (because it's not injective) but is unlikely that there'll any be collisions. |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | Here's something that almost works: map the integer vector $(a\_1,a\_2,\dots,a\_n)$ to the (rational) number $2^{a\_1}3^{a\_2}\times\cdots\times p\_n^{a\_n}$, where the numbers $2,3,\dots,p\_n$ are the first $n$ primes. The Unique Factorization Theorem almost guarantees that no two distinct vectors go to the same numbe... | Actually there is an easy way to map a vector of integers to a single integer in a bijective way. First treat numbers as strings say 0 1 00 01 10 11 .. for 0,1,2,3,4,5, ... then bijectively combine the strings a pair at a time using a method like <http://bijective.dogma.net/compres8.htm>
The method on that page is for... |
102,549 | I am trying to solve this equation using the series $$\sum\_0^\infty a\_nx^n$$
$$y'' - xy'+(3x-2)y=0$$
How to do that? I mean that I can replace the variables using the series but then I cannot add this thing cause the limits of the sums are not the same. Maybe I am doing something wrong here. I tried to make all sum... | 2012/01/26 | [
"https://math.stackexchange.com/questions/102549",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/22968/"
] | If the vector contains fixed-length integers, then you can compute a digest for it, say using MD5, SHA1, SHA2, etc. This is certainly not bijective (because it's not injective) but is unlikely that there'll any be collisions. | Actually there is an easy way to map a vector of integers to a single integer in a bijective way. First treat numbers as strings say 0 1 00 01 10 11 .. for 0,1,2,3,4,5, ... then bijectively combine the strings a pair at a time using a method like <http://bijective.dogma.net/compres8.htm>
The method on that page is for... |
218,090 | What does the following mean?
>
> They like me for me.
>
>
>
I have never seen this expression before. | 2019/07/13 | [
"https://ell.stackexchange.com/questions/218090",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/98273/"
] | It means people like you the way that you are and they don't want you to change they like the real you like you're not pretending to be something that you're not it's a compliment | (I originally posted this as a comment to the more-recently-asked [What does “like someone for someone” mean?](https://ell.stackexchange.com/questions/253611/what-does-like-someone-for-someone-mean), which was closed as a duplicate.)
---
The cited text ***is not idiomatic*** (except insofar as it's "deliberately quir... |
450,539 | ```
ubuntu 16.04 LTS
$ sudo apt install virtualbox
$ virtualbox
VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/lib/virtualbox/VirtualBox.so",) failed: /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5: undefined symbol: _ZN6QDebug9putStringEPK5QCharm
```
virtualbox is not run. What's wrong and how can i solve th... | 2018/06/19 | [
"https://unix.stackexchange.com/questions/450539",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/279149/"
] | Unfortunately just about the worst thing you can do is to use `rsync` across NFS. (Or to any remote filesystem that's mounted into the local system.) This switches off almost all of the efficiency enhancements for which `rsync` is known.
For this much data one of the fastest ways to transfer it between systems may be ... | It is far better to use rsync directly between two hosts if possible. Remember, rsync is built to optimise network IO at the cost of increased disk IO; when using rsync on an NFS filesystem, disk IO translates to network IO, so that is a very suboptimal solution. Also if rsync thinks that both source and destination is... |
65,529,865 | This question is similar to: [Does exist application event term in DDD?](https://stackoverflow.com/questions/62054009/does-exist-application-event-term-in-ddd) , but I don't know how to apply the explanations given there to my specific issue.
I have a `SearchFilmUseCase` and I want to raise an event `FilmSearchedEvent... | 2021/01/01 | [
"https://Stackoverflow.com/questions/65529865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2252717/"
] | One solution could be to create a domain service to perform the search and raise the event. | All Domain Events must be raised from domain layer. The best place is an aggregate root where the action should be really done.
The aggregate root could contain all the domain events that have been raised, and in the application layer you could get them and publish them to the event bus. |
32,253,657 | I am trying to filter some row of a table with ssdt (left click on table, view data, sort and filter)
Here I simply need to add `IS NULL` as a condition to an `nvarchar` field.
But as soon as I apply filter I get the error:
>
> Incorrect syntax near the keyword SET
>
>
>
Looking at the query written by edito... | 2015/08/27 | [
"https://Stackoverflow.com/questions/32253657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711395/"
] | It seems to be a bug that IS (NOT) NULL expression is not supported in the filter. | You can work around this by creating a new SQL query for that table and type the filter for "`IS NULL`" manually.
1- Right-click the table
2- Click "New Query"
3- Type the SQL statement using `IS NULL` as a filter
This should work fine. |
32,253,657 | I am trying to filter some row of a table with ssdt (left click on table, view data, sort and filter)
Here I simply need to add `IS NULL` as a condition to an `nvarchar` field.
But as soon as I apply filter I get the error:
>
> Incorrect syntax near the keyword SET
>
>
>
Looking at the query written by edito... | 2015/08/27 | [
"https://Stackoverflow.com/questions/32253657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711395/"
] | It seems to be a bug that IS (NOT) NULL expression is not supported in the filter. | This is a very ugly hack, but it may work for you.
It seems like you need a column name on the left of the = sign to keep the filter parser from changing the query. In my case my column that I was looking for nulls in was an integer, so I needed to get an integer on the left hand side.
I also needed a value for the c... |
32,253,657 | I am trying to filter some row of a table with ssdt (left click on table, view data, sort and filter)
Here I simply need to add `IS NULL` as a condition to an `nvarchar` field.
But as soon as I apply filter I get the error:
>
> Incorrect syntax near the keyword SET
>
>
>
Looking at the query written by edito... | 2015/08/27 | [
"https://Stackoverflow.com/questions/32253657",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711395/"
] | This is a very ugly hack, but it may work for you.
It seems like you need a column name on the left of the = sign to keep the filter parser from changing the query. In my case my column that I was looking for nulls in was an integer, so I needed to get an integer on the left hand side.
I also needed a value for the c... | You can work around this by creating a new SQL query for that table and type the filter for "`IS NULL`" manually.
1- Right-click the table
2- Click "New Query"
3- Type the SQL statement using `IS NULL` as a filter
This should work fine. |
1,487,369 | I have an HTML form, and some users are copy/pasting text from MS Word. When there are single quotes or double quotes, they get translated into funny characters like:
'€™ and ’
The database column is collation utf8\_general\_ci.
How do I get the appropriate characters to show up?
**Edit:**
Problem solved. He... | 2009/09/28 | [
"https://Stackoverflow.com/questions/1487369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21456/"
] | This looks like a classic case of unicode (UTF-8 most likely) characters being interpreted as iso-8859-1. There are a couple places along the way where the characters can get corrupted. First, the client's browser has to send the data. It might corrupt the data if it can't convert the characters properly to the page's ... | Check the encoding that the page uses. Encode it using UTF-8 as well, and add a meta tag describing the encoding:
```
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
``` |
1,487,369 | I have an HTML form, and some users are copy/pasting text from MS Word. When there are single quotes or double quotes, they get translated into funny characters like:
'€™ and ’
The database column is collation utf8\_general\_ci.
How do I get the appropriate characters to show up?
**Edit:**
Problem solved. He... | 2009/09/28 | [
"https://Stackoverflow.com/questions/1487369",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/21456/"
] | This looks like a classic case of unicode (UTF-8 most likely) characters being interpreted as iso-8859-1. There are a couple places along the way where the characters can get corrupted. First, the client's browser has to send the data. It might corrupt the data if it can't convert the characters properly to the page's ... | We have a PHP function that tries to clean up the mess with smart quotes. It's a bit of a mess, since it's grown a bit organically as cases popped up during prototype development. It may be of some help, though:
```
function convert_smart_quotes($string) {
$search = array(chr(0xe2) . chr(0x80) . chr(0x98),
... |
20,598,744 | I did it like this – but it is not working:
```
ma f [] = []
ma f (xs) = foldl (\y ys -> ys++(f y)) [] xs
foldl :: (a -> b -> a) -> a -> [b] -> a
foldr :: (a -> b -> b) -> b -> [a] -> b
```
Why is there a difference in the function that fold takes. I mean, `(a -> b -> a)` and `(a -> b -> b)`?
Is it possible... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20598744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975699/"
] | Not if you want it to work for infinite as well as finite lists. `head $ map id (cycle [1])` must return 1.
`foldl`ing over an infinite list diverges (never stops), because `foldl` is recursive. For example,
```
foldl g z [a,b,c] = g (g (g z a) b) c
```
Before `g` gets a chance to ignore its argument, `foldl` must ... | It becomes more obvious when you swap the type-variable names in one of the functions:
```
foldl :: (b -> a -> b) -> b -> [a] -> b
foldr :: (a -> b -> b) -> b -> [a] -> b
```
...because after all, what we need is the result, i.e. `[a] -> b`. Or, more specially, `[a] -> [b]`, so we might as well substitute that
```
... |
20,598,744 | I did it like this – but it is not working:
```
ma f [] = []
ma f (xs) = foldl (\y ys -> ys++(f y)) [] xs
foldl :: (a -> b -> a) -> a -> [b] -> a
foldr :: (a -> b -> b) -> b -> [a] -> b
```
Why is there a difference in the function that fold takes. I mean, `(a -> b -> a)` and `(a -> b -> b)`?
Is it possible... | 2013/12/15 | [
"https://Stackoverflow.com/questions/20598744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2975699/"
] | Not if you want it to work for infinite as well as finite lists. `head $ map id (cycle [1])` must return 1.
`foldl`ing over an infinite list diverges (never stops), because `foldl` is recursive. For example,
```
foldl g z [a,b,c] = g (g (g z a) b) c
```
Before `g` gets a chance to ignore its argument, `foldl` must ... | ```
ma f [] = []
ma f (xs) = foldl (\ys y -> ys++[(f y)]) [] xs
```
Works but why does order of arg to lambda matter.
`ma f (xs) = foldl (\y ys -> ys++[(f y)]) [] xs` gives error |
60,717,730 | I tried to write a code snippet as shown below. Main goal is to read from 03-10-2020.csv to from 03-16-2020.csv and merge them into one dataframe but only last dataframe is included in the dataframe.
How can I fix it?
```
week_array = []
path = 'URL_ADDRESS'
for i in range(10,17):
dataset_date = "03-" + str(i) +... | 2020/03/17 | [
"https://Stackoverflow.com/questions/60717730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5719229/"
] | This is what the HtmlHelper class is for.
Set the view model in your view file and create a form around it.
```
@model Models.EmployeeModel
@using (Html.BeginForm("Edit", "Employees", FormMethod.Post))
{
@Html.LabelFor(m => m.fname)
@Html.TextBoxFor(m => m.fname)
<input type="submit" value="Submit"/>
}
... | one thig you could try would be to set values in Razor:
```cs
// your controller
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{
return View(new EmployeeModel());// pass the actual viewmodel instance to the view here
}
}
```
```cs... |
63,529,556 | My Javascript build process ends up inserting the keyword `require()` in the file. This is not supported in client side and causes a console error. I have added `browserify` per other SO answers, however, I am in turn getting another error (below).
Additional Information:
I am using:
1. Gulp 4
2. Node (v14.2.0)
Err... | 2020/08/21 | [
"https://Stackoverflow.com/questions/63529556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12369920/"
] | I had the same error. This error means that it cannot find the required js file. Make sure that the file is in the correct folder, as specified in "required", and if it's in the same folder, you might need to add ./ .
browserify main.js -o bundle.js
```
Error: Can't walk dependency graph: Cannot find module 'srt' fro... | My case was slightly different. I had just moved from Windows to Ubuntu (via WSL).
Double checked the package was installed, removed and re-installed locally and globally, still cannot find module.
This previously worked when on windows:
`window.Example = require('Example');`
Turns out **Linux case sensitivity** me... |
15,880,730 | I need to extract the Maven GAV (groupId, artifactId, version) from a large number of `pom.xml` files. Not all of the POMs have a parent POM declaration, so the inheritance between parent GAV and project GAV needs to be taken into account.
I'd only like to use tools that can be easily scripted in a linux shell, e.g. b... | 2013/04/08 | [
"https://Stackoverflow.com/questions/15880730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523648/"
] | ```
grep -v '\[' <( mvn help:evaluate -Dexpression="project.groupId" 2>/dev/null &&
mvn help:evaluate -Dexpression="project.artifactId" 2>/dev/null &&
mvn help:evaluate -Dexpression="project.version" 2>/dev/null )
``` | The best solution I could find is using an XSL transformation. Create a file `extract-gav.xsl` with the following content:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:pom="http://maven.apache.org/POM/4.0.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output ind... |
15,880,730 | I need to extract the Maven GAV (groupId, artifactId, version) from a large number of `pom.xml` files. Not all of the POMs have a parent POM declaration, so the inheritance between parent GAV and project GAV needs to be taken into account.
I'd only like to use tools that can be easily scripted in a linux shell, e.g. b... | 2013/04/08 | [
"https://Stackoverflow.com/questions/15880730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523648/"
] | The best solution I could find is using an XSL transformation. Create a file `extract-gav.xsl` with the following content:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:pom="http://maven.apache.org/POM/4.0.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output ind... | I use a groovy script called **pom** that I placed on PATH. It looks like this:
```
#!/usr/bin/env groovy
def cli = new CliBuilder(usage:'pom')
cli.h('print usage')
cli.n('do not auto-print output')
cli.p(args:1, argName:'pom', 'the POM file to use')
def options = cli.parse(args)
def arguments = options.arguments()
... |
15,880,730 | I need to extract the Maven GAV (groupId, artifactId, version) from a large number of `pom.xml` files. Not all of the POMs have a parent POM declaration, so the inheritance between parent GAV and project GAV needs to be taken into account.
I'd only like to use tools that can be easily scripted in a linux shell, e.g. b... | 2013/04/08 | [
"https://Stackoverflow.com/questions/15880730",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523648/"
] | ```
grep -v '\[' <( mvn help:evaluate -Dexpression="project.groupId" 2>/dev/null &&
mvn help:evaluate -Dexpression="project.artifactId" 2>/dev/null &&
mvn help:evaluate -Dexpression="project.version" 2>/dev/null )
``` | I use a groovy script called **pom** that I placed on PATH. It looks like this:
```
#!/usr/bin/env groovy
def cli = new CliBuilder(usage:'pom')
cli.h('print usage')
cli.n('do not auto-print output')
cli.p(args:1, argName:'pom', 'the POM file to use')
def options = cli.parse(args)
def arguments = options.arguments()
... |
70,050,381 | So I creating a movie-db app and I want to toggle between different categories like `Top Rated`,`Popular` etc.I am trying to do this by setting the state to be the text value of whatever clicked which will be used later on to form the complete url to be fetched.
This is my code:
`App.js`
```
import Movie from "./com... | 2021/11/20 | [
"https://Stackoverflow.com/questions/70050381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13412737/"
] | You should lift state up to a common ancestor, i.e. `App` in this case, where it can be passed down as props to children components.
Example:
```
function App() {
const [category, setCategory] = useState('Trending');
return (
<div className="App">
<Navbar setCategory={setCategory}/>
<div classNam... | You need to lift up your state. It means that your useState 'category' hook have to be in parent component which can pass this data as prop to child. In your case parent component for Movie component is App component so App component have to contain
```
const [category, setCategory] = useState('Trending')
```
Now yo... |
61,967,282 | Write a function called push which accepts two parameters, an array and any value.
The function should add the value to the end of the array and then return the new length of the array.
Do not use the built in `Array.push() function!`
Examples:
```
var arr = [1, 2, 3];
push(arr, 10); // 4
arr; // [1, 2, 3, 10]
`... | 2020/05/23 | [
"https://Stackoverflow.com/questions/61967282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13586804/"
] | To install `Firebase` in your project, prerequisites are :
1. Install the following:
>
> Xcode 10.3 or later CocoaPods 1.4.0 or later
>
>
>
2. Make sure that your project meets these requirements:
>
> Your project must target iOS 8 or later.
>
>
>
[Reference](https://firebase.google.com/docs/ios/setup)
B... | step 1:
To add pod file
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Core’
pod ‘Firebase/Database’
pod ‘Firebase/Auth’
step 2:
pod install |
18,689,447 | [Here's what I've got](http://jsfiddle.net/mnbayazit/KDN8s/):
**HTML**
```html
<div class="combobox">
<input type="text" value="" name="brand" class="text" id="brand">
<span class="dropdown_btn"></span>
</div>
```
**CSS**
```css
.combobox {
margin: 0;
padding: 0;
vertical-align: middle;
}
.comb... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18689447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | Try this to add `vertical-align: middle;` to `.combobox .dropdown_btn` and remove it from the `combobox` class:
```
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -20px;
display: inline-block;
cursor: pointer;
background-color: blue;
vertical-align: middle;
}
``` | ```
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -20px;
display: inline-block;
cursor: pointer;
background-color: blue;
vertical-align: middle;
}
```
<http://jsfiddle.net/KDN8s/5/> |
18,689,447 | [Here's what I've got](http://jsfiddle.net/mnbayazit/KDN8s/):
**HTML**
```html
<div class="combobox">
<input type="text" value="" name="brand" class="text" id="brand">
<span class="dropdown_btn"></span>
</div>
```
**CSS**
```css
.combobox {
margin: 0;
padding: 0;
vertical-align: middle;
}
.comb... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18689447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | Try setting the `vertical-align:top` to `input`
<http://jsfiddle.net/KDN8s/4/>
```css
.combobox {
margin: 0;
padding: 0;
}
.combobox input {
margin: 0;
padding: 0;
height: 20px;
vertical-align: top;
}
.combobox .dropdown_btn {
width: 20px;
height: 24px;
margin-left: -20px;
di... | Try this to add `vertical-align: middle;` to `.combobox .dropdown_btn` and remove it from the `combobox` class:
```
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -20px;
display: inline-block;
cursor: pointer;
background-color: blue;
vertical-align: middle;
}
``` |
18,689,447 | [Here's what I've got](http://jsfiddle.net/mnbayazit/KDN8s/):
**HTML**
```html
<div class="combobox">
<input type="text" value="" name="brand" class="text" id="brand">
<span class="dropdown_btn"></span>
</div>
```
**CSS**
```css
.combobox {
margin: 0;
padding: 0;
vertical-align: middle;
}
.comb... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18689447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | You need to apply `vertical-align: middle` to your inline elements:
```
.combobox {
margin: 0;
padding: 0;
}
.combobox input {
height: 20px;
line-height: 20px;
margin: 0;
padding: 0;
vertical-align: middle;
}
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -2... | ```
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -20px;
display: inline-block;
cursor: pointer;
background-color: blue;
vertical-align: middle;
}
```
<http://jsfiddle.net/KDN8s/5/> |
18,689,447 | [Here's what I've got](http://jsfiddle.net/mnbayazit/KDN8s/):
**HTML**
```html
<div class="combobox">
<input type="text" value="" name="brand" class="text" id="brand">
<span class="dropdown_btn"></span>
</div>
```
**CSS**
```css
.combobox {
margin: 0;
padding: 0;
vertical-align: middle;
}
.comb... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18689447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | Try setting the `vertical-align:top` to `input`
<http://jsfiddle.net/KDN8s/4/>
```css
.combobox {
margin: 0;
padding: 0;
}
.combobox input {
margin: 0;
padding: 0;
height: 20px;
vertical-align: top;
}
.combobox .dropdown_btn {
width: 20px;
height: 24px;
margin-left: -20px;
di... | You need to apply `vertical-align: middle` to your inline elements:
```
.combobox {
margin: 0;
padding: 0;
}
.combobox input {
height: 20px;
line-height: 20px;
margin: 0;
padding: 0;
vertical-align: middle;
}
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -2... |
18,689,447 | [Here's what I've got](http://jsfiddle.net/mnbayazit/KDN8s/):
**HTML**
```html
<div class="combobox">
<input type="text" value="" name="brand" class="text" id="brand">
<span class="dropdown_btn"></span>
</div>
```
**CSS**
```css
.combobox {
margin: 0;
padding: 0;
vertical-align: middle;
}
.comb... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18689447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/65387/"
] | Try setting the `vertical-align:top` to `input`
<http://jsfiddle.net/KDN8s/4/>
```css
.combobox {
margin: 0;
padding: 0;
}
.combobox input {
margin: 0;
padding: 0;
height: 20px;
vertical-align: top;
}
.combobox .dropdown_btn {
width: 20px;
height: 24px;
margin-left: -20px;
di... | ```
.combobox .dropdown_btn {
width: 18px;
height: 20px;
margin-left: -20px;
display: inline-block;
cursor: pointer;
background-color: blue;
vertical-align: middle;
}
```
<http://jsfiddle.net/KDN8s/5/> |
46,653,569 | EDIT: originally I checked only desktop browsers - but with mobile browsers, the picture is even more complicated.
I came across a strange issue with some browsers and its text rendering capabilities and I am not sure if I can do anything to avoid this.
It seems WebKit and (less consistent) Firefox on Android are cre... | 2017/10/09 | [
"https://Stackoverflow.com/questions/46653569",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1764621/"
] | It seems that Safari (and a few others) does support getting at sub-pixel level, but not drawing...
When you set your font-size to `9.5pt`, this value gets converted to 12.6666...**px**.
Even though Safari does return an high precision value for this:
```js
console.log(getComputedStyle(document.body)['font-size'])... | I found below solution from MDN more helpful for scenarios where fonts are slanted/italic which was for me the case with some google fonts
copying the snippet from here - <https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Measuring_text_width>
```
const computetextWidth = (text, font) => {
const canvas... |
346,255 | $n \mathbb{Z}$ with usual addition and multiplication.
Here is what I have: Let $R = \langle n \mathbb{Z}, +, \cdot\rangle$. $R$ is closed under $+$ and under $\cdot$. $R$ is a ring since $\langle n \mathbb{Z}, +\rangle$ is an abelian group, multiplication is associative, and left/right distributive laws hold.
Now, $... | 2013/03/30 | [
"https://math.stackexchange.com/questions/346255",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/66368/"
] | If $n=k$, then $P\_1=P\_2=\mathbb{R}^n$ and you can take the zero subspace. So, we can assume there is a non-zero vector $e\in \mathbb{R}^n-P\_1$.
Case 1: $e\notin P\_2$. Set $e\_1:=e$.
Case 2: $e\in P\_2$. Find $x\in P\_1$ such that $x\notin P\_2$, then $e+x\notin P\_1$ and $e+x\notin P\_2$. Set $e\_1:=e+x$.
It i... | For $j=1,2,\ldots,m$, let $B\_j$ be a basis of $P\_j$. It suffices to find a set of vectors $S=\{v\_1,v\_2,\ldots,v\_{n-k}\}$ such that $S\cup B\_j$ is a linearly independent set of vectors for each $j$. We will begin with $S=\phi$ and put vectors into $S$ one by one.
Suppose $S$ already contains $i<n-k$ vectors. Now ... |
52,502,401 | I'm trying to figure out how to split up spring integration flows into multiple sub flows and compose them together. Ultimately, I'm trying to lay out a pattern in which I can create modules of subflows that can be pieced together for common integration recipes.
This test case represents a minimal example of trying (b... | 2018/09/25 | [
"https://Stackoverflow.com/questions/52502401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3377183/"
] | Try this:
```
SELECT *
FROM
(SELECT
SomeColumn, ...,
ROW_NUMBER() OVER (ORDER BY SomeColumn) AS RowNumber
FROM
table) Aux
WHERE
RowNumber >= @start AND RowNumber < (@start + @length)
```
Notes: You need mandatory order by a column and also you have to make a subquery to ... | You can try this approach:
```
SELECT ID, ItemID, ItemName, UnitCost, UnitPrice
FROM
(
SELECT ID, ItemID, ItemName, UnitCost, UnitPrice,
ROW_NUMBER() OVER (ORDER BY UnitCost) AS Seq
FROM dbo.Inventory
)t
WHERE Seq BETWEEN 100 AND 200
```
you will basically use row\_number to fetch they information that y... |
1,177,066 | I really want to dump my Windows 7 on my other computer, because Ubuntu is much better. But on that computer, I get no sound on Ubuntu but when it's on Windows, it works fine.
I have checked settings, it lists my onboard audio and that is what is selected, and turned on (not muted). I installed Ubuntu on this compute... | 2019/09/27 | [
"https://askubuntu.com/questions/1177066",
"https://askubuntu.com",
"https://askubuntu.com/users/661173/"
] | `sudo apt install telegram-desktop` | need use:
```
snap changes
```
and find status Doing and kill this ID
```
snap abort <ID>
```
PROFIT! |
1,177,066 | I really want to dump my Windows 7 on my other computer, because Ubuntu is much better. But on that computer, I get no sound on Ubuntu but when it's on Windows, it works fine.
I have checked settings, it lists my onboard audio and that is what is selected, and turned on (not muted). I installed Ubuntu on this compute... | 2019/09/27 | [
"https://askubuntu.com/questions/1177066",
"https://askubuntu.com",
"https://askubuntu.com/users/661173/"
] | `sudo apt install telegram-desktop` | Just wait a little bit
While the software is being downloaded and installed, hitting the install button again and again, pops up that message. |
1,177,066 | I really want to dump my Windows 7 on my other computer, because Ubuntu is much better. But on that computer, I get no sound on Ubuntu but when it's on Windows, it works fine.
I have checked settings, it lists my onboard audio and that is what is selected, and turned on (not muted). I installed Ubuntu on this compute... | 2019/09/27 | [
"https://askubuntu.com/questions/1177066",
"https://askubuntu.com",
"https://askubuntu.com/users/661173/"
] | need use:
```
snap changes
```
and find status Doing and kill this ID
```
snap abort <ID>
```
PROFIT! | Just wait a little bit
While the software is being downloaded and installed, hitting the install button again and again, pops up that message. |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | Note: Most on-line commentaries seem ascribe this verse to mean the Son of God and the Arian heresy tried to use it as a means for arguing that the Son was created and therefore not eternal. See these commentaries [here](http://bible.cc/proverbs/8-22.htm).
---
Anyway, when thinking of the Eternal Son as the wisdom of... | This article by CRI is useful: <https://www.equip.org/article/who-is-wisdom-in-proverbs-8/>
They make the case that the literary form of encomium is being used. An encomium is the praise of a character quality, offered so as to persuade others to imitate it. It is poetic and it is fiction. It uses personification. Ano... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | I can tell you who wisdom is [in Sirach](http://www.newadvent.org/bible/sir024.htm)...
>
> Wisdom shall praise her own self, and shall be honoured in God, and shall glory in the midst of her people, and shall open her mouth in the churches of the most High, and shall glorify herself in the sight of his power, and in... | *Hold on a moment...I thought God the Son wasn't created, having coexisted with God the Father since before time?*
**Answer**
No need to panic, all the commentaries coming from Catholic sources and teaching of the Church Father's are not yet definitive more so defined as a Dogma regarding the definite identification... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | Note: Most on-line commentaries seem ascribe this verse to mean the Son of God and the Arian heresy tried to use it as a means for arguing that the Son was created and therefore not eternal. See these commentaries [here](http://bible.cc/proverbs/8-22.htm).
---
Anyway, when thinking of the Eternal Son as the wisdom of... | *Hold on a moment...I thought God the Son wasn't created, having coexisted with God the Father since before time?*
**Answer**
No need to panic, all the commentaries coming from Catholic sources and teaching of the Church Father's are not yet definitive more so defined as a Dogma regarding the definite identification... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | There are two common interpretations among Protestants:
1. "Wisdom" refers to the Word of God; that is, Jesus
2. "Wisdom" is the personification of a divine attribute, and perhaps a type of Christ, but should not be understood to be Jesus himself
The first view [was widely held by the church fathers](https://christia... | Note: Most on-line commentaries seem ascribe this verse to mean the Son of God and the Arian heresy tried to use it as a means for arguing that the Son was created and therefore not eternal. See these commentaries [here](http://bible.cc/proverbs/8-22.htm).
---
Anyway, when thinking of the Eternal Son as the wisdom of... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | "Wisdom" in the context of these verses isn't anybody. It's wisdom, as you or I would understand the word, literally, but in this particular context, Solomon is Anthropomorphizing the character trait of wisdom.
I've never once seen a commentary, or heard a message that gives any indication that "Wisdom" in these passa... | This article by CRI is useful: <https://www.equip.org/article/who-is-wisdom-in-proverbs-8/>
They make the case that the literary form of encomium is being used. An encomium is the praise of a character quality, offered so as to persuade others to imitate it. It is poetic and it is fiction. It uses personification. Ano... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | There are two common interpretations among Protestants:
1. "Wisdom" refers to the Word of God; that is, Jesus
2. "Wisdom" is the personification of a divine attribute, and perhaps a type of Christ, but should not be understood to be Jesus himself
The first view [was widely held by the church fathers](https://christia... | I can tell you who wisdom is [in Sirach](http://www.newadvent.org/bible/sir024.htm)...
>
> Wisdom shall praise her own self, and shall be honoured in God, and shall glory in the midst of her people, and shall open her mouth in the churches of the most High, and shall glorify herself in the sight of his power, and in... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | There are two common interpretations among Protestants:
1. "Wisdom" refers to the Word of God; that is, Jesus
2. "Wisdom" is the personification of a divine attribute, and perhaps a type of Christ, but should not be understood to be Jesus himself
The first view [was widely held by the church fathers](https://christia... | *Hold on a moment...I thought God the Son wasn't created, having coexisted with God the Father since before time?*
**Answer**
No need to panic, all the commentaries coming from Catholic sources and teaching of the Church Father's are not yet definitive more so defined as a Dogma regarding the definite identification... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | There are two common interpretations among Protestants:
1. "Wisdom" refers to the Word of God; that is, Jesus
2. "Wisdom" is the personification of a divine attribute, and perhaps a type of Christ, but should not be understood to be Jesus himself
The first view [was widely held by the church fathers](https://christia... | This article by CRI is useful: <https://www.equip.org/article/who-is-wisdom-in-proverbs-8/>
They make the case that the literary form of encomium is being used. An encomium is the praise of a character quality, offered so as to persuade others to imitate it. It is poetic and it is fiction. It uses personification. Ano... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | I can tell you who wisdom is [in Sirach](http://www.newadvent.org/bible/sir024.htm)...
>
> Wisdom shall praise her own self, and shall be honoured in God, and shall glory in the midst of her people, and shall open her mouth in the churches of the most High, and shall glorify herself in the sight of his power, and in... | This article by CRI is useful: <https://www.equip.org/article/who-is-wisdom-in-proverbs-8/>
They make the case that the literary form of encomium is being used. An encomium is the praise of a character quality, offered so as to persuade others to imitate it. It is poetic and it is fiction. It uses personification. Ano... |
8,946 | In general, Wisdom can be (and is, and was) identified as Jesus. However, there is this verse:
>
> [**Proverbs 8:22 (NLT)**](http://www.biblegateway.com/passage/?search=proverbs%208:22&version=NLT)
>
> 22 "The Lord formed me from the beginning,
>
> before he created anything else."
>
>
>
Hold on ... | 2012/08/07 | [
"https://christianity.stackexchange.com/questions/8946",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/58/"
] | "Wisdom" in the context of these verses isn't anybody. It's wisdom, as you or I would understand the word, literally, but in this particular context, Solomon is Anthropomorphizing the character trait of wisdom.
I've never once seen a commentary, or heard a message that gives any indication that "Wisdom" in these passa... | *Hold on a moment...I thought God the Son wasn't created, having coexisted with God the Father since before time?*
**Answer**
No need to panic, all the commentaries coming from Catholic sources and teaching of the Church Father's are not yet definitive more so defined as a Dogma regarding the definite identification... |
195,146 | Consider the ring $\mathbb Z\_4[x]$. Clearly the elements of the form $2f(x)$ are zero divisors.
>
> **1**. Is it true that they are *all* the zero divisors? I mean is it true that if $p(x)$ is a zero divisor then it is of the form
> $$
> 2f(x)
> $$
> for some $f(x) \in \mathbb Z\_4[x]$? In other words, is the set... | 2012/09/13 | [
"https://math.stackexchange.com/questions/195146",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/28746/"
] | Both results follow from general characterizations of zero-divisors and units in polynomial rings. It's more insightful (and just as simple) to give the general proofs, then specialize them as below.
$\rm(1)\ $ [McCoy's theorem](https://math.stackexchange.com/a/83171/242) states: $ $ if $\rm\:f\in R[x]\:$ is a zero-di... | You're right on both accounts.
**1.** First notice that if $p(x)$ has zero constant coefficient, say $p(x)=x^mq(x)$, then $p(x)$ is a zero divisor if and only if $q(x)$ is.
So suppose $p(x) = \sum\_0^n a\_ix^i \in \mathbb{Z}\_4[x]$ has an odd coefficient and a nonzero constant coefficient, and let $k \le n$ be least ... |
195,146 | Consider the ring $\mathbb Z\_4[x]$. Clearly the elements of the form $2f(x)$ are zero divisors.
>
> **1**. Is it true that they are *all* the zero divisors? I mean is it true that if $p(x)$ is a zero divisor then it is of the form
> $$
> 2f(x)
> $$
> for some $f(x) \in \mathbb Z\_4[x]$? In other words, is the set... | 2012/09/13 | [
"https://math.stackexchange.com/questions/195146",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/28746/"
] | You're right on both accounts.
**1.** First notice that if $p(x)$ has zero constant coefficient, say $p(x)=x^mq(x)$, then $p(x)$ is a zero divisor if and only if $q(x)$ is.
So suppose $p(x) = \sum\_0^n a\_ix^i \in \mathbb{Z}\_4[x]$ has an odd coefficient and a nonzero constant coefficient, and let $k \le n$ be least ... | Your first conjecture can be easily deduced by translating the problem to that of $\mathbb{Z}[x]$.
The ring $\mathbb{Z}\_4[x]$ is (isomorphic to) the quotient ring $\mathbb{Z}[x] / (4)$, so we can write elements of $\mathbb{Z}\_4[x]$ as (equivalence classes of) integer polynomials. The condition to be a zero divisor o... |
195,146 | Consider the ring $\mathbb Z\_4[x]$. Clearly the elements of the form $2f(x)$ are zero divisors.
>
> **1**. Is it true that they are *all* the zero divisors? I mean is it true that if $p(x)$ is a zero divisor then it is of the form
> $$
> 2f(x)
> $$
> for some $f(x) \in \mathbb Z\_4[x]$? In other words, is the set... | 2012/09/13 | [
"https://math.stackexchange.com/questions/195146",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/28746/"
] | Both results follow from general characterizations of zero-divisors and units in polynomial rings. It's more insightful (and just as simple) to give the general proofs, then specialize them as below.
$\rm(1)\ $ [McCoy's theorem](https://math.stackexchange.com/a/83171/242) states: $ $ if $\rm\:f\in R[x]\:$ is a zero-di... | Your first conjecture can be easily deduced by translating the problem to that of $\mathbb{Z}[x]$.
The ring $\mathbb{Z}\_4[x]$ is (isomorphic to) the quotient ring $\mathbb{Z}[x] / (4)$, so we can write elements of $\mathbb{Z}\_4[x]$ as (equivalence classes of) integer polynomials. The condition to be a zero divisor o... |
158,936 | I am designing a testing box that has as a specification supplying power safely to a product range that requires the following voltages: 24Vdc, 24Vac, 110Vac and 230Vac. I am intending to use transformers controlled by PLC's and a HMI screen.
However, I am stuck with a health and safety issue. Currently one end of the... | 2015/03/09 | [
"https://electronics.stackexchange.com/questions/158936",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/69541/"
] | A classic, if complex solution to this, is to superimpose a defined signal on the source test lead. It can be a simple low level square wave, or a digital pattern. Say somewhere around 20kHz to 40kHz.
On the other other wire in your continuity tester, you look for the transmitted signal, and only energize the test volt... | I once had to make a continuity test (part of a machine) that was fed to 120Vac PLC input card. It also had to be ungrounded, because the tested material was grounded. I have used 2 transformers, and the continuity test was done with a low voltage. I have actually used 120 to 3 V transformers. I am not sure what exact... |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Make `Student` and `Staff` interfaces implemented by `Tutor`.
`Student` will declare a `getStudentId()` method, and `Staff` will declare `getLectures()`, `getProjects()` etc.. | As others have noted, to do this in Java you need to define interfaces rather than superclasses. Java does not allow multiple extends.
But there may be a better alternative than inheritance. In this, and almost any situation where I find myself tempted to have a subclass extend multiple superclasses, I try to find a w... |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Don't use inheritance, use composition: everybody is a Person, but has one or more roles: Student, Tutor, Professor, Staff.
Or optionally make a division between Staff and Student and allow them to have the roles. The roles then dictate what they can or cannot do. | Make `Student` and `Staff` interfaces implemented by `Tutor`.
`Student` will declare a `getStudentId()` method, and `Staff` will declare `getLectures()`, `getProjects()` etc.. |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Make Person, Staff, and Student interfaces. If you need common functionality, use encapsulation. | As others have noted, to do this in Java you need to define interfaces rather than superclasses. Java does not allow multiple extends.
But there may be a better alternative than inheritance. In this, and almost any situation where I find myself tempted to have a subclass extend multiple superclasses, I try to find a w... |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Don't use inheritance, use composition: everybody is a Person, but has one or more roles: Student, Tutor, Professor, Staff.
Or optionally make a division between Staff and Student and allow them to have the roles. The roles then dictate what they can or cannot do. | Make Person, Staff, and Student interfaces. If you need common functionality, use encapsulation. |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | You can do something like this.
```
interface Person { ... }
interface Staff extends Person { ... }
interface Student extends Person { ... }
class Tutor implements Staff, Student { ... }
class Professor implements Staff { ... }
```
Unfortunately, you can't put logic (i.e., fields or non-abstract methods) in both... | As others have noted, to do this in Java you need to define interfaces rather than superclasses. Java does not allow multiple extends.
But there may be a better alternative than inheritance. In this, and almost any situation where I find myself tempted to have a subclass extend multiple superclasses, I try to find a w... |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Don't use inheritance, use composition: everybody is a Person, but has one or more roles: Student, Tutor, Professor, Staff.
Or optionally make a division between Staff and Student and allow them to have the roles. The roles then dictate what they can or cannot do. | You can do something like this.
```
interface Person { ... }
interface Staff extends Person { ... }
interface Student extends Person { ... }
class Tutor implements Staff, Student { ... }
class Professor implements Staff { ... }
```
Unfortunately, you can't put logic (i.e., fields or non-abstract methods) in both... |
7,901,904 | I'm trying to make a model of our universities Course management system (for the course). I stumbled upon a small limitation of **extends**, that is, it's impossible for a certain class to extend two classes. Here's the model:
```
Professor
/
Sta... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7901904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/602385/"
] | Don't use inheritance, use composition: everybody is a Person, but has one or more roles: Student, Tutor, Professor, Staff.
Or optionally make a division between Staff and Student and allow them to have the roles. The roles then dictate what they can or cannot do. | As others have noted, to do this in Java you need to define interfaces rather than superclasses. Java does not allow multiple extends.
But there may be a better alternative than inheritance. In this, and almost any situation where I find myself tempted to have a subclass extend multiple superclasses, I try to find a w... |
235,490 | I am watching a movie in which two people fight with two zombies. One of them says "Do you want to switch?" and
other says "How would that benefit me?"
In the second sentence can I replace "would" with "will"? | 2020/01/18 | [
"https://ell.stackexchange.com/questions/235490",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/106867/"
] | Yes, however the word "would" is a "lets just say this happened" or "might" but "not guaranteed" situation. When you change it to say "will", it changes the story to mean something that is going to happen . | You can do it.
But, the meaning of the sentence, which paraphrase looks like that 'How do you imagine my benefit from switching ? ' will change to the meaning of 'What is your sure knowledge about my benefit from switching?' |
41,455 | So, I've read in several books -- particularly [the novelization of Episode III](https://starwars.fandom.com/wiki/Star_Wars_Episode_III:_Revenge_of_the_Sith_%28novel%29) -- that Mace Windu created the Vaapad form of lightsaber combat. However, I recently read the first two Darth Bane novels, and a mention is made to Va... | 2013/10/10 | [
"https://scifi.stackexchange.com/questions/41455",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/9154/"
] | **TL;DR** Both answers are actually correct, as the differences stem from a technicality. The relevant quotes are:
>
> Vaapad is as aggressive and powerful as its namesake, but its power comes at great risk: immersion in Vaapad opens the gates that restrain one's inner darkness. To use Vaapad, a Jedi must allow himse... | It depends on which canon you wish to follow.
As per [Wookieepedia](https://starwars.fandom.com/wiki/Canon):
>
> **G-canon is George Lucas Canon**; the six Episodes and any statements by George Lucas (including unpublished production notes from him or his production department that are never seen by the public). Ele... |
41,455 | So, I've read in several books -- particularly [the novelization of Episode III](https://starwars.fandom.com/wiki/Star_Wars_Episode_III:_Revenge_of_the_Sith_%28novel%29) -- that Mace Windu created the Vaapad form of lightsaber combat. However, I recently read the first two Darth Bane novels, and a mention is made to Va... | 2013/10/10 | [
"https://scifi.stackexchange.com/questions/41455",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/9154/"
] | The book [*The Jedi Path*](https://starwars.fandom.com/wiki/The_Jedi_Path:_A_Manual_for_Students_of_the_Force_%28real-life_book%29) has a "handwritten note" from Obi-Wan Kenobi on the page about Form VII - Juyo:
>
> Master Windu has developed a variant of Form VII called Vaapad.
>
>
>
This suggests that while the... | It depends on which canon you wish to follow.
As per [Wookieepedia](https://starwars.fandom.com/wiki/Canon):
>
> **G-canon is George Lucas Canon**; the six Episodes and any statements by George Lucas (including unpublished production notes from him or his production department that are never seen by the public). Ele... |
41,455 | So, I've read in several books -- particularly [the novelization of Episode III](https://starwars.fandom.com/wiki/Star_Wars_Episode_III:_Revenge_of_the_Sith_%28novel%29) -- that Mace Windu created the Vaapad form of lightsaber combat. However, I recently read the first two Darth Bane novels, and a mention is made to Va... | 2013/10/10 | [
"https://scifi.stackexchange.com/questions/41455",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/9154/"
] | **TL;DR** Both answers are actually correct, as the differences stem from a technicality. The relevant quotes are:
>
> Vaapad is as aggressive and powerful as its namesake, but its power comes at great risk: immersion in Vaapad opens the gates that restrain one's inner darkness. To use Vaapad, a Jedi must allow himse... | The book [*The Jedi Path*](https://starwars.fandom.com/wiki/The_Jedi_Path:_A_Manual_for_Students_of_the_Force_%28real-life_book%29) has a "handwritten note" from Obi-Wan Kenobi on the page about Form VII - Juyo:
>
> Master Windu has developed a variant of Form VII called Vaapad.
>
>
>
This suggests that while the... |
25,273,784 | I'm testing the observable pattern in javascript. My callbacks in the array never seem to execute. What is wrong with my syntax?
```
<script type="text/javascript">
var Book = function (value) {
var onChanging = [];
this.name = function () {
for (var i = 0; i < onChanging.length; i++... | 2014/08/12 | [
"https://Stackoverflow.com/questions/25273784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/995864/"
] | Your function has to have arguments `a`, `b` and `c`, yet you're only passing it `a`. Thus the error.
I don't understand why you're doing the `get` within the function, and I would instead do:
```
# whatever function
fun = function(a, b, c) a + b + c
# evaluate inside the data.table, *then* pass it to your function
... | I would keep it simple:
```
fun <- function(a1, a2, b1, b2, c1, c2) {
res1 = (a1 - constants$V2 * (b1 - c1))
res2 = (a2 - constants$V2 * (b2 - c2))
return(list(res1, res2))
}
# no get or apply function
input1a[, fun(a1, a2, b1, b2, c1, c2), by=ID]
input1a
ID V1 V2
1: 37 7344.6993 -1... |
30,388,035 | I'm trying to update a single table in my record using the session.getCurrentSession().save(Bean);
And I'm getting this error. I have cross checked my table and column names in my Database with the attributes in my POJO class. The hibernate.hbm2ddl.auto property is set to auto in my configuration file. Please help
```... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30388035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3934294/"
] | I don't see how that statement could run in SQL\*Plus or SQL Developer.
The name of one of your columns "**`SIZE`**" is an Oracle reserved word. It would need to be enclosed in double quotes, in order for it to be referenced in an INSERT statement.
```
INSERT INTO foo ("SIZE") VALUES ( ? )
^ ^
``... | I changed my column name from Size to Phone\_Size and was able to insert the queries.
Thanks. :) |
31,326,710 | I am using `clang-format` (version 3.5) with Emacs (version 24.5.2). Here is a simple piece of code formatted by `clang-format` in LLVM style:
```
int main() {
std::cout << "> ";
std::string word;
while (std::cin >> word) {
std::cout << std::accumulate(word.cbegin(), word.cend(), 0,
... | 2015/07/09 | [
"https://Stackoverflow.com/questions/31326710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2725810/"
] | `std::accumulate(word.cbegin(), word.cend(), 0, [](int cur, char ch) { return cur + (ch - '0'); })`
Here we have a long function call. To clean it up, we take the long argument, and we split it onto its own line:
```
std::accumulate(word.cbegin(), word.cend(), 0,
[](int cur, char ch) { return cur + (ch - '0'); })
``... | You might want [`AlignAfterOpenBracket: false`](http://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options) to bring that `[]` left.
Aligning after open bracket causes too much wasted space in my opinion, it is a wonder that it is so popular. Use `ContinuationIndentWidth` to control how ... |
14,891,385 | I got a script that expects two args (filename and MD5hashval). I can extract just the hex output of MD5sum using md5sum test.sh | grep -om1 '^[0-9a-f]\*.' For some reason, the same cmd fails when invoked from a script. Whats the best way to check cmdline arguments passed to a Bash script? Here's what the code looks li... | 2013/02/15 | [
"https://Stackoverflow.com/questions/14891385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1999114/"
] | Since the `s` option requires an argument, you need to place a colon after it. It should be:
```
while getopts "f:s:" opt; do
...
```
From the `getopts` man page:
>
> if a character is followed by a colon, the option is expected
> to have an argument, which should be separated from it by white space.
>
>
> | My first action would be to place a debug line before your actual command:
```
echo "[$OPTARG]"
MD5SUM=`echo $OPTARG | grep -om1 '^[0-9a-f]*'`
```
But it actually has to do with the fact that `s` is not followed by a colon in your `getopts` options string. You should use `f:s:` instead:
>
> ... optstring contains ... |
29,014,716 | I'm trying to change the user's current culture via AJAX POST:
```
$.ajax({
type: 'POST',
url: '/Account/SetDefaultCulture',
data: data,
dataType: 'JSON',
success: function (result) {
location.reload(true);
}
});
```
With this controller method:
```
private readonly AspEntities db = ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29014716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246329/"
] | Cant comment yet, but have you checked [this other stack overflow question](https://stackoverflow.com/questions/8226514/best-place-to-set-currentculture-for-multilingual-asp-net-mvc-web-applications)
According to that link it seems that the action filter is already too late to set the culture for the request. | I think you first have to attach the user to your DbContext.
```
db.AspNetUsers.Attach(user);
```
Then call save changes. Every time I have run into issues updating my DB, this has been the cause. I do believe you have to refresh the page after this update too. |
29,014,716 | I'm trying to change the user's current culture via AJAX POST:
```
$.ajax({
type: 'POST',
url: '/Account/SetDefaultCulture',
data: data,
dataType: 'JSON',
success: function (result) {
location.reload(true);
}
});
```
With this controller method:
```
private readonly AspEntities db = ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29014716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246329/"
] | Seems like EF is not tracking your changes.
Try something like this,
db.Entry(AspNetUsers).State = EntityState.Modified;
before: db.SaveChanges();
Also you are quering \_db context while i can see that your context is
private readonly AspEntities db = new AspEntities();
Which hints ur context is not set right? Don... | I think you first have to attach the user to your DbContext.
```
db.AspNetUsers.Attach(user);
```
Then call save changes. Every time I have run into issues updating my DB, this has been the cause. I do believe you have to refresh the page after this update too. |
29,014,716 | I'm trying to change the user's current culture via AJAX POST:
```
$.ajax({
type: 'POST',
url: '/Account/SetDefaultCulture',
data: data,
dataType: 'JSON',
success: function (result) {
location.reload(true);
}
});
```
With this controller method:
```
private readonly AspEntities db = ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29014716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246329/"
] | Check to see if you are referencing data from an already instantiated database context (`AspEntities db`) in the controller that is supposed to produce the updates. The `readonly` modifier will prevent changes after declaration, unless you are always creating a new controller object. | I think you first have to attach the user to your DbContext.
```
db.AspNetUsers.Attach(user);
```
Then call save changes. Every time I have run into issues updating my DB, this has been the cause. I do believe you have to refresh the page after this update too. |
29,014,716 | I'm trying to change the user's current culture via AJAX POST:
```
$.ajax({
type: 'POST',
url: '/Account/SetDefaultCulture',
data: data,
dataType: 'JSON',
success: function (result) {
location.reload(true);
}
});
```
With this controller method:
```
private readonly AspEntities db = ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29014716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246329/"
] | Seems like EF is not tracking your changes.
Try something like this,
db.Entry(AspNetUsers).State = EntityState.Modified;
before: db.SaveChanges();
Also you are quering \_db context while i can see that your context is
private readonly AspEntities db = new AspEntities();
Which hints ur context is not set right? Don... | Cant comment yet, but have you checked [this other stack overflow question](https://stackoverflow.com/questions/8226514/best-place-to-set-currentculture-for-multilingual-asp-net-mvc-web-applications)
According to that link it seems that the action filter is already too late to set the culture for the request. |
29,014,716 | I'm trying to change the user's current culture via AJAX POST:
```
$.ajax({
type: 'POST',
url: '/Account/SetDefaultCulture',
data: data,
dataType: 'JSON',
success: function (result) {
location.reload(true);
}
});
```
With this controller method:
```
private readonly AspEntities db = ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29014716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2246329/"
] | Seems like EF is not tracking your changes.
Try something like this,
db.Entry(AspNetUsers).State = EntityState.Modified;
before: db.SaveChanges();
Also you are quering \_db context while i can see that your context is
private readonly AspEntities db = new AspEntities();
Which hints ur context is not set right? Don... | Check to see if you are referencing data from an already instantiated database context (`AspEntities db`) in the controller that is supposed to produce the updates. The `readonly` modifier will prevent changes after declaration, unless you are always creating a new controller object. |
19,671,348 | I have a function that has a few possible return values. As a trivial example, let's imagine it took in a positive int and returned "small", "medium", or "large":
```
def size(x):
if x < 10:
return SMALL
if x < 20:
return MEDIUM
return LARGE
```
I am wondering the best way to write & defi... | 2013/10/29 | [
"https://Stackoverflow.com/questions/19671348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38146/"
] | While you can, I wouldn't, especially now that Python has an [Enum type](http://www.python.org/dev/peps/pep-0435/) in 3.4 which has been [backported](https://pypi.python.org/pypi/enum34).
Your example above might look like this as an `Enum`:
```
class Size(Enum):
small = 1
medium = 2
large = 3
@clas... | [`namedtuple`](http://docs.python.org/2/library/collections.html#collections.namedtuple), perhaps?
```
>>> from collections import namedtuple
>>>
>>> SizeSpec = namedtuple('SizeSpec', ['small', 'medium', 'large'])
>>>
>>> size = SizeSpec(small=1, medium=2, large=3)
>>>
>>> size.small
1
>>> size.medium
2
>>> size.la... |
11,007,509 | I'm in a struts project. I wanted to create reusable custom tags.
So heres the thing, for example i have this set of struts UI tags:
```
<s:form action="some.action" namespace="/somenamespace">
<s:textfield name="username" label="Username"/>
<s:textfield name="pwd" label="Password" />
<s:submit value="logi... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11007509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1297154/"
] | You are confusing two different styles of parameters in SQL queries. The ODBC syntax uses simple placeholder '?' character for each parameter, and the parameters are replaced in the same order that you add them to the parameters collection. For an `OdbcCommand`, the name you give the parameters is ignored, and only the... | You should assign parameters like this and in your case you missed providing value for "CONECTION" parameter. Also as an additional note, you should always enclose connection objects in using blocks. See [this](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx) and look at the "Remarks" s... |
11,007,509 | I'm in a struts project. I wanted to create reusable custom tags.
So heres the thing, for example i have this set of struts UI tags:
```
<s:form action="some.action" namespace="/somenamespace">
<s:textfield name="username" label="Username"/>
<s:textfield name="pwd" label="Password" />
<s:submit value="logi... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11007509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1297154/"
] | You should assign parameters like this and in your case you missed providing value for "CONECTION" parameter. Also as an additional note, you should always enclose connection objects in using blocks. See [this](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx) and look at the "Remarks" s... | Please make sure that `Dim cmd As SqlCommand = New SqlCommand(sql, conn)` uses `conn` with an open connection.
Then verify your parameters type to be in accordance with the database table definition. Plus, If your using string type you may add an ' before and after any text inserted.
To be sure, you can break on `cmd... |
11,007,509 | I'm in a struts project. I wanted to create reusable custom tags.
So heres the thing, for example i have this set of struts UI tags:
```
<s:form action="some.action" namespace="/somenamespace">
<s:textfield name="username" label="Username"/>
<s:textfield name="pwd" label="Password" />
<s:submit value="logi... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11007509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1297154/"
] | You are confusing two different styles of parameters in SQL queries. The ODBC syntax uses simple placeholder '?' character for each parameter, and the parameters are replaced in the same order that you add them to the parameters collection. For an `OdbcCommand`, the name you give the parameters is ignored, and only the... | Please make sure that `Dim cmd As SqlCommand = New SqlCommand(sql, conn)` uses `conn` with an open connection.
Then verify your parameters type to be in accordance with the database table definition. Plus, If your using string type you may add an ' before and after any text inserted.
To be sure, you can break on `cmd... |
41,745,735 | I want to:
1. pass a block to a method call, and then
2. pass that entire method call as the condition of a `while` loop,
3. even though I don't need to put any logic inside the loop itself.
Specifically, I have an array that I'd like to `#reject!` certain elements from based on rather complicated logic. Subsequent c... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41745735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4865822/"
] | It's not just vim, `while array.reject! do |element|` is invalid syntax:
```
$ ruby -c -e 'while array.reject! do |element| end'
-e:1: syntax error, unexpected '|'
while array.reject! do |element| end
^
```
You could use `{ ... }` instead of `do ... end`:
```
while array.reject! { |element|
... | You're right that the Ruby parser thinks that `do` belongs to `while`, and doesn't understand where the second `end` is coming from. It's a precedence problem.
This code is just to show that it **can** be done. For how it **should** be done, see Stefan's [answer](https://stackoverflow.com/a/41746233/6419007) :
```
ar... |
41,745,735 | I want to:
1. pass a block to a method call, and then
2. pass that entire method call as the condition of a `while` loop,
3. even though I don't need to put any logic inside the loop itself.
Specifically, I have an array that I'd like to `#reject!` certain elements from based on rather complicated logic. Subsequent c... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41745735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4865822/"
] | It's not just vim, `while array.reject! do |element|` is invalid syntax:
```
$ ruby -c -e 'while array.reject! do |element| end'
-e:1: syntax error, unexpected '|'
while array.reject! do |element| end
^
```
You could use `{ ... }` instead of `do ... end`:
```
while array.reject! { |element|
... | My personal preference in situations where I need to call a method until the return value is what I want is:
```
:keep_going while my_method
```
Or more tersely I sometimes use:
```
:go while my_method
```
It's one line, and you can use the contents of the symbol to help document what's going on. With your block,... |
41,745,735 | I want to:
1. pass a block to a method call, and then
2. pass that entire method call as the condition of a `while` loop,
3. even though I don't need to put any logic inside the loop itself.
Specifically, I have an array that I'd like to `#reject!` certain elements from based on rather complicated logic. Subsequent c... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41745735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4865822/"
] | Ruby lets you move your condition to the end of the loop statement. This makes it easy to store a result inside of the loop and check it against the conditional:
```
begin
any_rejected = arr.reject! { … }
end while any_rejected
```
This would work the same as doing `end while arr.reject! { … }`, but it's much clea... | You're right that the Ruby parser thinks that `do` belongs to `while`, and doesn't understand where the second `end` is coming from. It's a precedence problem.
This code is just to show that it **can** be done. For how it **should** be done, see Stefan's [answer](https://stackoverflow.com/a/41746233/6419007) :
```
ar... |
41,745,735 | I want to:
1. pass a block to a method call, and then
2. pass that entire method call as the condition of a `while` loop,
3. even though I don't need to put any logic inside the loop itself.
Specifically, I have an array that I'd like to `#reject!` certain elements from based on rather complicated logic. Subsequent c... | 2017/01/19 | [
"https://Stackoverflow.com/questions/41745735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4865822/"
] | Ruby lets you move your condition to the end of the loop statement. This makes it easy to store a result inside of the loop and check it against the conditional:
```
begin
any_rejected = arr.reject! { … }
end while any_rejected
```
This would work the same as doing `end while arr.reject! { … }`, but it's much clea... | My personal preference in situations where I need to call a method until the return value is what I want is:
```
:keep_going while my_method
```
Or more tersely I sometimes use:
```
:go while my_method
```
It's one line, and you can use the contents of the symbol to help document what's going on. With your block,... |
6,561,828 | Greerings all
Is there a way to compress data sent from php (server) and then uncompress the data using javascript (client)?
Thanking you | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447429/"
] | Yes; if you configure your server to serve up the data, which hopefully you are sending in a sane format like JSON, using GZIP compression, then you can just do an Ajax call in JavaScript and it will be automatically decompressed by the browser.
To set this up, copy [these lines](https://github.com/paulirish/html5-boi... | If keeping your response overhead small as possible is your goal then [JSON DB: a compressed JSON format](http://peter.michaux.ca/articles/json-db-a-compressed-json-format) might also be of interest to you. |
6,561,828 | Greerings all
Is there a way to compress data sent from php (server) and then uncompress the data using javascript (client)?
Thanking you | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447429/"
] | I have to agree with @Domenic's answer here. @Nishchay Sharma is way off.
The only thing I'll add is if you want to do this on a per-script basis rather than configuring your entire server to compress everything, it's trivial to accomplish your goal by using PHP's gzencode() function coupled with a header call:
<http... | Yes; if you configure your server to serve up the data, which hopefully you are sending in a sane format like JSON, using GZIP compression, then you can just do an Ajax call in JavaScript and it will be automatically decompressed by the browser.
To set this up, copy [these lines](https://github.com/paulirish/html5-boi... |
6,561,828 | Greerings all
Is there a way to compress data sent from php (server) and then uncompress the data using javascript (client)?
Thanking you | 2011/07/03 | [
"https://Stackoverflow.com/questions/6561828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447429/"
] | I have to agree with @Domenic's answer here. @Nishchay Sharma is way off.
The only thing I'll add is if you want to do this on a per-script basis rather than configuring your entire server to compress everything, it's trivial to accomplish your goal by using PHP's gzencode() function coupled with a header call:
<http... | If keeping your response overhead small as possible is your goal then [JSON DB: a compressed JSON format](http://peter.michaux.ca/articles/json-db-a-compressed-json-format) might also be of interest to you. |
57,414,152 | I have 2 Laravel(5.8) apps. One is a user application, the other is more of an API.
The Api has pdfs stored in the storage directory, I need to be able to allow a user to download the pdfs in the other application.
Really got no clue how to send the file over from app to the other.
The user app makes an api to the ... | 2019/08/08 | [
"https://Stackoverflow.com/questions/57414152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3233770/"
] | The laravel code you posted is basically correct, you can use one of `stream()`, `download()` or `file()` helper to serve a file.
`file()`
========
Serve a file using a binary response, the most straightforward solution.
```php
// optional headers
$headers = [];
return response()->file(storage_path('myfile.zip'), $o... | So if I understand correctly you have two systems: user app and api. You want to serve a pdf from user app to the actual user. The user app does a call to api, which works fine. Your issue is converting the response of the api to a response which you can serve from your user app, correct?
In that case I'd say you want... |
57,414,152 | I have 2 Laravel(5.8) apps. One is a user application, the other is more of an API.
The Api has pdfs stored in the storage directory, I need to be able to allow a user to download the pdfs in the other application.
Really got no clue how to send the file over from app to the other.
The user app makes an api to the ... | 2019/08/08 | [
"https://Stackoverflow.com/questions/57414152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3233770/"
] | The laravel code you posted is basically correct, you can use one of `stream()`, `download()` or `file()` helper to serve a file.
`file()`
========
Serve a file using a binary response, the most straightforward solution.
```php
// optional headers
$headers = [];
return response()->file(storage_path('myfile.zip'), $o... | Here are the steps you should follow to get the PDF:
1. Make an API call using AJAX ( you are probably already doing it ) from your public site ( User site ) to the API server, with file ID.
2. API server fetches the PDF, copy it to the public/users/ directory, generate the URL of that PDF file.
3. Send the URL as a r... |
54,703,452 | I have huge data frame of multiple columns, one of the column contain data like that
```
No
"48.8.1.1."
"48.8.1.2."
"48.8.2."
"48.9."
"48.10."
"48.11."
"48.11.1."
"48.11.1.1."
"48.11.1.2."
"48.11.1.2.2.2.2.1."
```
there is no fixed sequence in sub ordering of dat... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54703452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8992815/"
] | Use the below code based on Base R
```
X <- c(T,F,T,F,F,T,F,T,T,F,F,F)
Y <- as.data.frame(matrix(X,nrow = 6, ncol = 2))
unique(Y$V1)
Y$condition <- ifelse(Y$V1 == "TRUE" | Y$V2 == "TRUE","TRUE","FALSE")
``` | Here is a possible solution using `apply()` and logical operator `|` that will work for any number of columns of `Y`.
```
result = cbind(Y, apply(Y, 1, FUN = function (x) Reduce(f="|", x)))
result
# [,1] [,2] [,3]
# [1,] TRUE FALSE TRUE
# [2,] FALSE TRUE TRUE
# [3,] TRUE TRUE TRUE
# [4,] FALSE FALSE FAL... |
54,703,452 | I have huge data frame of multiple columns, one of the column contain data like that
```
No
"48.8.1.1."
"48.8.1.2."
"48.8.2."
"48.9."
"48.10."
"48.11."
"48.11.1."
"48.11.1.1."
"48.11.1.2."
"48.11.1.2.2.2.2.1."
```
there is no fixed sequence in sub ordering of dat... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54703452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8992815/"
] | If you have logical vectors in all the columns, you can use `rowSums`
```
cbind(Y, rowSums(Y) > 0)
# [,1] [,2] [,3]
#[1,] TRUE FALSE TRUE
#[2,] FALSE TRUE TRUE
#[3,] TRUE TRUE TRUE
#[4,] FALSE FALSE FALSE
#[5,] FALSE FALSE FALSE
#[6,] TRUE FALSE TRUE
```
This will return `TRUE` if there is at least ... | Use the below code based on Base R
```
X <- c(T,F,T,F,F,T,F,T,T,F,F,F)
Y <- as.data.frame(matrix(X,nrow = 6, ncol = 2))
unique(Y$V1)
Y$condition <- ifelse(Y$V1 == "TRUE" | Y$V2 == "TRUE","TRUE","FALSE")
``` |
54,703,452 | I have huge data frame of multiple columns, one of the column contain data like that
```
No
"48.8.1.1."
"48.8.1.2."
"48.8.2."
"48.9."
"48.10."
"48.11."
"48.11.1."
"48.11.1.1."
"48.11.1.2."
"48.11.1.2.2.2.2.1."
```
there is no fixed sequence in sub ordering of dat... | 2019/02/15 | [
"https://Stackoverflow.com/questions/54703452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8992815/"
] | If you have logical vectors in all the columns, you can use `rowSums`
```
cbind(Y, rowSums(Y) > 0)
# [,1] [,2] [,3]
#[1,] TRUE FALSE TRUE
#[2,] FALSE TRUE TRUE
#[3,] TRUE TRUE TRUE
#[4,] FALSE FALSE FALSE
#[5,] FALSE FALSE FALSE
#[6,] TRUE FALSE TRUE
```
This will return `TRUE` if there is at least ... | Here is a possible solution using `apply()` and logical operator `|` that will work for any number of columns of `Y`.
```
result = cbind(Y, apply(Y, 1, FUN = function (x) Reduce(f="|", x)))
result
# [,1] [,2] [,3]
# [1,] TRUE FALSE TRUE
# [2,] FALSE TRUE TRUE
# [3,] TRUE TRUE TRUE
# [4,] FALSE FALSE FAL... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Have you tried setting cmd.exe into another codepage before you feed the file names to gnupg? Issue `chcp 65001` to set cmd.exe to Unicode beforehand and try again.
If that fails, the following VBScript would do it:
```vb
Option Explicit
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim invalidChars:... | From <http://www.robvanderwoude.com/bht.html>:
use NT's SET's string substitution to replace or remove characters anywhere in a string:
```
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=%
SET STRING=%STRING:]=%
ECHO String: %STRING%
will display
String: ABCDEFG
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=(%
SET STRING=... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Have you tried setting cmd.exe into another codepage before you feed the file names to gnupg? Issue `chcp 65001` to set cmd.exe to Unicode beforehand and try again.
If that fails, the following VBScript would do it:
```vb
Option Explicit
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim invalidChars:... | Following 'RenameFilesWithAccentedAndDiacriticalLatinChars.pl' PERL script renames files with accented and diacritical Latin characters :
* This PERL script starts from the folder given in parameter, or else from
the current folder.
* It recursively searches for files with characters belonging to 80 - FF of
CP 1250, C... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Have you tried setting cmd.exe into another codepage before you feed the file names to gnupg? Issue `chcp 65001` to set cmd.exe to Unicode beforehand and try again.
If that fails, the following VBScript would do it:
```vb
Option Explicit
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim invalidChars:... | I'm using this batch to rename folders and seems to work fine so far...
In my case codepage is 1252, yours might be different.
```
mode con codepage select=1252
@echo off
Setlocal enabledelayedexpansion
::folder only (/D option)
for /R /D %%d in (*) do (
set an=%%~nd
set bn=!an:.=_!
set cn=!bn:-=_!
set dn=!cn: =_!
se... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Thanks to Tomalak who actually pointed me in the right direction. Thought I'd post here for completeness.
The problem seems to be that the codepage used by GPG is fixed (Latin I) independent of the codepage configured in the console. But once he pointed this out, I figured out how to workaraound this.
The trick is to... | From <http://www.robvanderwoude.com/bht.html>:
use NT's SET's string substitution to replace or remove characters anywhere in a string:
```
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=%
SET STRING=%STRING:]=%
ECHO String: %STRING%
will display
String: ABCDEFG
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=(%
SET STRING=... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | From <http://www.robvanderwoude.com/bht.html>:
use NT's SET's string substitution to replace or remove characters anywhere in a string:
```
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=%
SET STRING=%STRING:]=%
ECHO String: %STRING%
will display
String: ABCDEFG
SET STRING=[ABCDEFG]
SET STRING=%STRING:[=(%
SET STRING=... | I'm using this batch to rename folders and seems to work fine so far...
In my case codepage is 1252, yours might be different.
```
mode con codepage select=1252
@echo off
Setlocal enabledelayedexpansion
::folder only (/D option)
for /R /D %%d in (*) do (
set an=%%~nd
set bn=!an:.=_!
set cn=!bn:-=_!
set dn=!cn: =_!
se... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Thanks to Tomalak who actually pointed me in the right direction. Thought I'd post here for completeness.
The problem seems to be that the codepage used by GPG is fixed (Latin I) independent of the codepage configured in the console. But once he pointed this out, I figured out how to workaraound this.
The trick is to... | Following 'RenameFilesWithAccentedAndDiacriticalLatinChars.pl' PERL script renames files with accented and diacritical Latin characters :
* This PERL script starts from the folder given in parameter, or else from
the current folder.
* It recursively searches for files with characters belonging to 80 - FF of
CP 1250, C... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Thanks to Tomalak who actually pointed me in the right direction. Thought I'd post here for completeness.
The problem seems to be that the codepage used by GPG is fixed (Latin I) independent of the codepage configured in the console. But once he pointed this out, I figured out how to workaraound this.
The trick is to... | I'm using this batch to rename folders and seems to work fine so far...
In my case codepage is 1252, yours might be different.
```
mode con codepage select=1252
@echo off
Setlocal enabledelayedexpansion
::folder only (/D option)
for /R /D %%d in (*) do (
set an=%%~nd
set bn=!an:.=_!
set cn=!bn:-=_!
set dn=!cn: =_!
se... |
261,515 | I have a large set of files, some of which contain special characters in the filename (e.g. ä,ö,%, and others). I'd like a script file to iterate over these files and rename them removing the special characters. I don't really mind what it does, but it could replace them with underscores for example e.g.
Störung%20.do... | 2008/11/04 | [
"https://Stackoverflow.com/questions/261515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9625/"
] | Following 'RenameFilesWithAccentedAndDiacriticalLatinChars.pl' PERL script renames files with accented and diacritical Latin characters :
* This PERL script starts from the folder given in parameter, or else from
the current folder.
* It recursively searches for files with characters belonging to 80 - FF of
CP 1250, C... | I'm using this batch to rename folders and seems to work fine so far...
In my case codepage is 1252, yours might be different.
```
mode con codepage select=1252
@echo off
Setlocal enabledelayedexpansion
::folder only (/D option)
for /R /D %%d in (*) do (
set an=%%~nd
set bn=!an:.=_!
set cn=!bn:-=_!
set dn=!cn: =_!
se... |
779,788 | I want my machine to work only on Ethernet. I mean I want to remove the WiFi access in my Ubuntu. | 2016/05/31 | [
"https://askubuntu.com/questions/779788",
"https://askubuntu.com",
"https://askubuntu.com/users/545611/"
] | If you want to hard block wifi (that means completely turn the wifi chip off) then you must do it from bios settings (my laptop has also an external switch).
If you want to soft block wifi (that means disable wifi from within the os) then you can do it with these 3 ways:
* with a combination of `Fn` key and some othe... | The easiest way is to click the Network manager icon on top of the screen and disable Wi-Fi there. |
779,788 | I want my machine to work only on Ethernet. I mean I want to remove the WiFi access in my Ubuntu. | 2016/05/31 | [
"https://askubuntu.com/questions/779788",
"https://askubuntu.com",
"https://askubuntu.com/users/545611/"
] | If you want to hard block wifi (that means completely turn the wifi chip off) then you must do it from bios settings (my laptop has also an external switch).
If you want to soft block wifi (that means disable wifi from within the os) then you can do it with these 3 ways:
* with a combination of `Fn` key and some othe... | In `/etc/modprobe.d` add the below and reboot:
```
install iwlwifi /bin/true
``` |
46,689,384 | There is a css file and I want to make two things:
1) Remove all webkit keyframes and surrounding whitespace characters like:
```
@keyframes outToLeft {
to {
opacity: 0;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
```
2) Remove all webkit pre... | 2017/10/11 | [
"https://Stackoverflow.com/questions/46689384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7013674/"
] | You need to add permission to your manifest first
```
<uses-permission android:name="android.permission.CALL_PHONE" />
```
After permission added in manifest following code would work fine for you "Number\_to\_call" will be youe number that is need to be replaced
```
val call = Intent(Intent.ACTION_DIAL)
call.set... | You need to request the runtime permission, since Android 6.0 certain permissions require you to ask at install and again at runtime.
Following the instructions [here](https://developer.android.com/training/permissions/requesting.html?hl=en-419) explains how to ask for permission at runtime. |
46,689,384 | There is a css file and I want to make two things:
1) Remove all webkit keyframes and surrounding whitespace characters like:
```
@keyframes outToLeft {
to {
opacity: 0;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
```
2) Remove all webkit pre... | 2017/10/11 | [
"https://Stackoverflow.com/questions/46689384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7013674/"
] | You need to add the run time permission. [Download the source code from here](http://deepshikhapuri.blogspot.in/2017/11/runtime-permission-in-android-kotlin.html)
//Click function of layout:
```
rl_call.setOnClickListener {
if (boolean_call) {
phonecall()
}else {
fn_permissio... | You need to request the runtime permission, since Android 6.0 certain permissions require you to ask at install and again at runtime.
Following the instructions [here](https://developer.android.com/training/permissions/requesting.html?hl=en-419) explains how to ask for permission at runtime. |
46,689,384 | There is a css file and I want to make two things:
1) Remove all webkit keyframes and surrounding whitespace characters like:
```
@keyframes outToLeft {
to {
opacity: 0;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
```
2) Remove all webkit pre... | 2017/10/11 | [
"https://Stackoverflow.com/questions/46689384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7013674/"
] | First you need to add permission to your `manifest` first :
```
<uses-permission android:name="android.permission.CALL_PHONE" />
```
This bit of code is used on the place of your method :
```
fun buChargeEvent(view: View) {
var number: Int = txtCharge.text.toString().toInt()
val callIntent = Intent(Intent.A... | You need to request the runtime permission, since Android 6.0 certain permissions require you to ask at install and again at runtime.
Following the instructions [here](https://developer.android.com/training/permissions/requesting.html?hl=en-419) explains how to ask for permission at runtime. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.