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 |
|---|---|---|---|---|---|
701 | I am using Tridion 2009 SP1 for a client, we have jsp pages and vb script. Our client wants to switch to Tridion 2011 and have told to investigate Experience Manager. I tried searching on sdllivecontent but could find anything with this word. Can anyone direct me what actually is Experience Manager so that i can get ba... | 2013/04/02 | [
"https://tridion.stackexchange.com/questions/701",
"https://tridion.stackexchange.com",
"https://tridion.stackexchange.com/users/396/"
] | Experience Manager is the product formerly known as the SDL Tridion User Interface (UI) update, formerly known as SiteEdit.
You can find information on Tridon World for UI Update
(<https://www.sdltridionworld.com/downloads/documentation/UIU4SDLT2011SP1/index.aspx>) if you have access, as well on SDL Live Content
(<ht... | Though a lot of references are already mentioned in above answers.
Here I would like to suggest you one point regarding the estimate.
There are two possibilities in your case first is upgrade and other is migrate. Effort will vary in both the cases.
Though you have already mentioned migrate in your question but I ... |
772,713 | Determine whether the following series converge absolutely, converge conditionally or diverge
$$\sum\_{1}^{+ \infty}\frac{1}{n! + n}$$
I tried using the ratio test but i can seem to find the value of limit. For comparison test there seems to be no other suitable series to be compared with. Divergence test does not wor... | 2014/04/28 | [
"https://math.stackexchange.com/questions/772713",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/133532/"
] | $$0 \leq \sum\_{n = 1}^{k}\frac{1}{n! + n} \leq \sum\_{n = 1}^{k}\frac{1}{n!}$$ and the series $\sum\_{n = 1}^{+ \infty}\frac{1}{n!}$ is convergent by the ratio test | Well, for $n \geq 1 $,
$$ n! + n \geq 2^n \implies \frac{1}{n!+n} \leq \frac{1}{2^n} $$
Now, compare! |
772,713 | Determine whether the following series converge absolutely, converge conditionally or diverge
$$\sum\_{1}^{+ \infty}\frac{1}{n! + n}$$
I tried using the ratio test but i can seem to find the value of limit. For comparison test there seems to be no other suitable series to be compared with. Divergence test does not wor... | 2014/04/28 | [
"https://math.stackexchange.com/questions/772713",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/133532/"
] | $$0 \leq \sum\_{n = 1}^{k}\frac{1}{n! + n} \leq \sum\_{n = 1}^{k}\frac{1}{n!}$$ and the series $\sum\_{n = 1}^{+ \infty}\frac{1}{n!}$ is convergent by the ratio test | For the ratio test (since all terms are positive, we drop the absolute values):
$$L = \lim\_{n\to\infty} \frac{n!+n}{(n+1)!+(n+1)} = \lim\_{n\to\infty} \frac{n!}{(n+1)!+n+1} + \lim\_{n\to\infty} \frac{n}{(n+1)!+n+1}$$
$$= \lim\_{n\to\infty} \frac{n!}{(n+1)!+n+1} + \lim\_{n\to\infty} \frac{n+1}{(n+1)!+n+1} - \lim\_{n\to... |
53,033,300 | I have a list of values that I want to dynamically assign to another list of values:
```
var activeMachines = [41,44,46]
for(i = 0; i < activeMachines.length; i++){
var temp + activeMachines[i] = document.getElementById("tempData"+activeMachines[i]);
var humid + activeMachines[i] = document.getElementById("hu... | 2018/10/28 | [
"https://Stackoverflow.com/questions/53033300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9643220/"
] | You can use the `window` object for doing that, however, I recommend you to create your own object to store those "variables" as properties within that new `key-value` object.
```
var activeMachines = [41,44,46]
var obj = {};
for(i = 0; i < activeMachines.length; i++){
obj['temp' + activeMachines[i]] = document.g... | You can use an object and create properties instead of variables.
```
var context = {};
for (i = 0; i < activeMachines.length; i++) {
context[`temp${activeMachines[i]}`] = document.getElementById("tempData"+activeMachines[i]);
}
```
And the access those data with `context.temp41` or `context["temp41"]` |
53,033,300 | I have a list of values that I want to dynamically assign to another list of values:
```
var activeMachines = [41,44,46]
for(i = 0; i < activeMachines.length; i++){
var temp + activeMachines[i] = document.getElementById("tempData"+activeMachines[i]);
var humid + activeMachines[i] = document.getElementById("hu... | 2018/10/28 | [
"https://Stackoverflow.com/questions/53033300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9643220/"
] | Anytime you're struggling to dynamically define variable names it's an indication that you should step back and reconsider your data structures. It's almost always the wrong choice that leads to difficult, messy code.
In this case it looks like you have three things that have an id and a temp, humidity and time proper... | You can use the `window` object for doing that, however, I recommend you to create your own object to store those "variables" as properties within that new `key-value` object.
```
var activeMachines = [41,44,46]
var obj = {};
for(i = 0; i < activeMachines.length; i++){
obj['temp' + activeMachines[i]] = document.g... |
53,033,300 | I have a list of values that I want to dynamically assign to another list of values:
```
var activeMachines = [41,44,46]
for(i = 0; i < activeMachines.length; i++){
var temp + activeMachines[i] = document.getElementById("tempData"+activeMachines[i]);
var humid + activeMachines[i] = document.getElementById("hu... | 2018/10/28 | [
"https://Stackoverflow.com/questions/53033300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9643220/"
] | Try this
```
var activeMachines = [41,44,46];
var output = {};
for(i = 0; i < activeMachines.length; i++){
output["temp" + activeMachines[i]] = document.getElementById("tempData"+activeMachines[i]);
output["humid" + activeMachines[i]] = document.getElementById("humidData"+activeMachines[i]);
output["time"... | You can use an object and create properties instead of variables.
```
var context = {};
for (i = 0; i < activeMachines.length; i++) {
context[`temp${activeMachines[i]}`] = document.getElementById("tempData"+activeMachines[i]);
}
```
And the access those data with `context.temp41` or `context["temp41"]` |
53,033,300 | I have a list of values that I want to dynamically assign to another list of values:
```
var activeMachines = [41,44,46]
for(i = 0; i < activeMachines.length; i++){
var temp + activeMachines[i] = document.getElementById("tempData"+activeMachines[i]);
var humid + activeMachines[i] = document.getElementById("hu... | 2018/10/28 | [
"https://Stackoverflow.com/questions/53033300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9643220/"
] | Anytime you're struggling to dynamically define variable names it's an indication that you should step back and reconsider your data structures. It's almost always the wrong choice that leads to difficult, messy code.
In this case it looks like you have three things that have an id and a temp, humidity and time proper... | Try this
```
var activeMachines = [41,44,46];
var output = {};
for(i = 0; i < activeMachines.length; i++){
output["temp" + activeMachines[i]] = document.getElementById("tempData"+activeMachines[i]);
output["humid" + activeMachines[i]] = document.getElementById("humidData"+activeMachines[i]);
output["time"... |
53,033,300 | I have a list of values that I want to dynamically assign to another list of values:
```
var activeMachines = [41,44,46]
for(i = 0; i < activeMachines.length; i++){
var temp + activeMachines[i] = document.getElementById("tempData"+activeMachines[i]);
var humid + activeMachines[i] = document.getElementById("hu... | 2018/10/28 | [
"https://Stackoverflow.com/questions/53033300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9643220/"
] | Anytime you're struggling to dynamically define variable names it's an indication that you should step back and reconsider your data structures. It's almost always the wrong choice that leads to difficult, messy code.
In this case it looks like you have three things that have an id and a temp, humidity and time proper... | You can use an object and create properties instead of variables.
```
var context = {};
for (i = 0; i < activeMachines.length; i++) {
context[`temp${activeMachines[i]}`] = document.getElementById("tempData"+activeMachines[i]);
}
```
And the access those data with `context.temp41` or `context["temp41"]` |
54,623,705 | What's an optimal way to convert this hash:
```
%{
"0" => [
%{"foo" => 1, "baz" => 10}
],
"1" => [
%{"foo" => 2, "baz" => 11}
]
}
```
to a list like this?
```
[
%{"foo" => 1, "baz" => 10},
%{"foo" => 2, "baz" => 11}
]
``` | 2019/02/11 | [
"https://Stackoverflow.com/questions/54623705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538471/"
] | While [`Map.values/2`](https://hexdocs.pm/elixir/master/Map.html#values/2) would definitely work, the [`Kernel.SpecialForms/1`](https://hexdocs.pm/elixir/master/Kernel.SpecialForms.html#for/1) comprehension is probably a more flexible way to go since it allows you to filter and/or modify the result in-place.
```rb
inp... | ```
original = %{
"0" => [
%{"foo" => 1, "baz" => 10}
],
"1" => [
%{"foo" => 2, "baz" => 11}
]
}
values_from_original = original |> Map.values
result = for e <- values_from_original, do: e |> Enum.at(0)
``` |
45,847,436 | As OpenAPI released new 3.0 version and wso2 provides the swagger editor and ui (2.0 version). is there any time when wso2 starts supporting open api(swagger)3.0 | 2017/08/23 | [
"https://Stackoverflow.com/questions/45847436",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8507809/"
] | It will most probably come in the next major release, APIM 3.0.0. Track the progress [here](https://github.com/wso2/product-apim/issues/1568). | Newly released API Manager 2.2.0 has OAS 3.0 and 2.0 support along with the new Swagger editor and Console. |
46,560,800 | I am using DatePickerDialog library to get date picker while clicking on time textField. However, when I click on the Trainer-2 textField which is above the time textField then keyboard appears which is fine but when I click on time textField then the keyboard does not disappear and date picker appears behind it so the... | 2017/10/04 | [
"https://Stackoverflow.com/questions/46560800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6796405/"
] | Rather than doing both an UPDATE *and* an INSERT like your existing stored proc does (which will **guarantee** at least one extra row is added), you should try one of two options.
* Only run the INSERT if the UPDATE had no effect (by checking `@@ROWCOUNT = 0`)
* Use a [MERGE](https://learn.microsoft.com/en-us/sql/t-sq... | I solved my problem by modifiyng this procedure:
```
--UPDATE EXISTING RECORDS
UPDATE [ENVNDIVDB].[dbo].[TBL_PROC_PMS] SET _GOODS_CD=@_GOODS_CD,_GOODS_NAME=@_GOODS_NAME, _UNIT = @_UNIT,_QTY=@_QTY,
[_UPDATE_DATE]=(select LEFT(CONVERT(VARCHAR, GETDATE(), 111), 10)) ... |
67,461,115 | I just got started writing some C programs.
To start with I was just running them through VS code. Nice and easy, I just had to press a button and bam, there it was.
But now I need to pass files as arguments to my program, which creates the need of running it from the command line.
The way I do it now, is using this... | 2021/05/09 | [
"https://Stackoverflow.com/questions/67461115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15793617/"
] | You could do that with a **makefile**. More about **GNU Make** [here](https://www.gnu.org/software/make/).
```
all:
gcc test.c -o test
./test
```
The file should be called **Makefile** or **makefile** *(it can have different names,just keeping it simple)*, and you can run it by executing:
`make`
Assuming you h... | >
> This is a bit tedious in the long run. Is there any way I could do this process in one step?
>
>
>
Yes. You could create a shell function (or an alias if your shell supports alias arguments, which bash does not), e.g.:
```
ccr() { gcc "$1" -o x.$$ && ./x.$$; rm -f x.$$ }
$ ccr hello.c
Hello, world!
$
```
w... |
67,461,115 | I just got started writing some C programs.
To start with I was just running them through VS code. Nice and easy, I just had to press a button and bam, there it was.
But now I need to pass files as arguments to my program, which creates the need of running it from the command line.
The way I do it now, is using this... | 2021/05/09 | [
"https://Stackoverflow.com/questions/67461115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15793617/"
] | You could do that with a **makefile**. More about **GNU Make** [here](https://www.gnu.org/software/make/).
```
all:
gcc test.c -o test
./test
```
The file should be called **Makefile** or **makefile** *(it can have different names,just keeping it simple)*, and you can run it by executing:
`make`
Assuming you h... | As @alex01011 correctly stated, what you need is a `Makefile`, and his solution should work. What I want to suggest here is a better `Makefile`.
First `make` already know how to use build `test` from `test.c` in the simple case. It will add parameters to the preprocessor, compilation and linker steps from `Makefile` v... |
67,461,115 | I just got started writing some C programs.
To start with I was just running them through VS code. Nice and easy, I just had to press a button and bam, there it was.
But now I need to pass files as arguments to my program, which creates the need of running it from the command line.
The way I do it now, is using this... | 2021/05/09 | [
"https://Stackoverflow.com/questions/67461115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15793617/"
] | You could do that with a **makefile**. More about **GNU Make** [here](https://www.gnu.org/software/make/).
```
all:
gcc test.c -o test
./test
```
The file should be called **Makefile** or **makefile** *(it can have different names,just keeping it simple)*, and you can run it by executing:
`make`
Assuming you h... | I am wondering that nobody is issuing the general comparison between an IDE and shell. So yes IDE may give you some comfort. But you will be happy if you learnt the fundamentals of linking & Co from scratch - otherwise the configuration of the
IDE can get pretty challenging, when you start stuff that does not work out ... |
67,461,115 | I just got started writing some C programs.
To start with I was just running them through VS code. Nice and easy, I just had to press a button and bam, there it was.
But now I need to pass files as arguments to my program, which creates the need of running it from the command line.
The way I do it now, is using this... | 2021/05/09 | [
"https://Stackoverflow.com/questions/67461115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15793617/"
] | >
> This is a bit tedious in the long run. Is there any way I could do this process in one step?
>
>
>
Yes. You could create a shell function (or an alias if your shell supports alias arguments, which bash does not), e.g.:
```
ccr() { gcc "$1" -o x.$$ && ./x.$$; rm -f x.$$ }
$ ccr hello.c
Hello, world!
$
```
w... | As @alex01011 correctly stated, what you need is a `Makefile`, and his solution should work. What I want to suggest here is a better `Makefile`.
First `make` already know how to use build `test` from `test.c` in the simple case. It will add parameters to the preprocessor, compilation and linker steps from `Makefile` v... |
67,461,115 | I just got started writing some C programs.
To start with I was just running them through VS code. Nice and easy, I just had to press a button and bam, there it was.
But now I need to pass files as arguments to my program, which creates the need of running it from the command line.
The way I do it now, is using this... | 2021/05/09 | [
"https://Stackoverflow.com/questions/67461115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15793617/"
] | >
> This is a bit tedious in the long run. Is there any way I could do this process in one step?
>
>
>
Yes. You could create a shell function (or an alias if your shell supports alias arguments, which bash does not), e.g.:
```
ccr() { gcc "$1" -o x.$$ && ./x.$$; rm -f x.$$ }
$ ccr hello.c
Hello, world!
$
```
w... | I am wondering that nobody is issuing the general comparison between an IDE and shell. So yes IDE may give you some comfort. But you will be happy if you learnt the fundamentals of linking & Co from scratch - otherwise the configuration of the
IDE can get pretty challenging, when you start stuff that does not work out ... |
38,797,417 | I have a program that is incrementing requests on a session cookie and printing them out to the console. Initially, I was trying to figure out how I could save this data. After logging in a couple places, I realized that the data was being saved/changed despite me having a seperate variable to hold what I *thought* was... | 2016/08/05 | [
"https://Stackoverflow.com/questions/38797417",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3680517/"
] | I would default to object destructuring working essentially the same as normal assignments. Consider:
```
const req = {session: {requestsPerSecond: {"0.0.0.0": "foo"}}};
const requestsPerSecond = req.session.requestsPerSecond;
// updates to `requestsPerSecond` will also update `req`.
```
I'm not sure you can use des... | [From MDN:](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Description)
>
> The destructuring assignment syntax is a JavaScript expression that makes it possible to extract data from arrays or objects into distinct variables.
>
>
>
If this data happens to be a... |
354,482 | The quintic del Pezzo $3$-fold $V(5)$ of degree $5$ is defined as the intersection of $Grass(2,5)$ and a codimension $3$ linear subspace. I would like to show the following:
**For every point $p$ in $V(5)$ there is a line contained in $V(5)$ not passing through $p$.**
I know that $\operatorname{Gr}(2,5)$ is defined ... | 2020/03/08 | [
"https://mathoverflow.net/questions/354482",
"https://mathoverflow.net",
"https://mathoverflow.net/users/-1/"
] | For Q1, the sequence corresponding to [Stat19](http://www.findstat.org/StatisticsDatabase/St000019) is given in [A263484](http://oeis.org/A263484) and comes from a 2005 article by Richard Stanley (developing ideas from Comtet) on connectivity sets, connectedness, cut points, etc.
It may not have a standard name becaus... | For the first part of your question, *support* doesn't appear to be an appropriate word, as in the context of permutations it is normally used for the set of non-fixed points. In general, a mathematical *support* means as an assistance to the main act.
To try to define the term, we can first define the process that ar... |
55,153,691 | I want my React `render` method to return objects from an API in a similar way to what I get from Postman. For example:
```
{
"meta": {
"count": 807,
"countReturned": 10,
"requestTime": 1552524395,
"responseTime": 1552524395,
"responseMs": 7
},
"data": [
{
"type": "breeds",
... | 2019/03/14 | [
"https://Stackoverflow.com/questions/55153691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8075291/"
] | According to Vue.js official [documentation](https://vue-loader.vuejs.org/guide/pre-processors.html#pug), to use `vue-loader` with `pug-plain-loader`, you need to configure loader rule as follows:
>
> If you also intend to use it to import `.pug` files as HTML strings in JavaScript, you will need to chain `raw-loader... | The working solution is:
```
{
test: /\.pug$/,
oneOf: [{
resourceQuery: /^\?vue/,
use: ["pug-plain-loader"]
}, {
use: [
"html-loader",
"pug-html-loader"
]
}]
}
``` |
50,454,857 | We are working on sentences extracted from a PDF. The problem is that it includes the title, footers, table of contents, etc. Is there a way to determine if the sentence we get when pass the document to spacy is a complete sentence. Is there a way to filter parts of sentences like titles? | 2018/05/21 | [
"https://Stackoverflow.com/questions/50454857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/686334/"
] | A complete sentence contains at least one subject, one predicate, one object, and closes with punctuation.
Subject and object are almost always nouns, and the predicate is always a verb.
Thus you need to check if your sentence contains two nouns, one verb and closes with punctuation:
```
import spacy
nlp = spacy.loa... | Try looking for the first noun chunk in each sentence. That is usually (but not always) is the title subject of the sentence.
```
sentence_title = [chunk.text for chunk in doc.noun_chunks][0]
``` |
50,454,857 | We are working on sentences extracted from a PDF. The problem is that it includes the title, footers, table of contents, etc. Is there a way to determine if the sentence we get when pass the document to spacy is a complete sentence. Is there a way to filter parts of sentences like titles? | 2018/05/21 | [
"https://Stackoverflow.com/questions/50454857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/686334/"
] | A complete sentence contains at least one subject, one predicate, one object, and closes with punctuation.
Subject and object are almost always nouns, and the predicate is always a verb.
Thus you need to check if your sentence contains two nouns, one verb and closes with punctuation:
```
import spacy
nlp = spacy.loa... | You can perform sentence segmentation using trainable pipeline component in Spacy.
<https://spacy.io/api/sentencerecognizer>
Additionally, if you can come up with some pattern in the text string then use python regex
lib `re` <https://docs.python.org/3/library/re.html>. |
33,897,423 | I'm really keen to develop a web browser application for Android Wear devices. To make such application I need a **WebView** object, but the major problem is that Google has made the **android.webkit** API unavailable in that OS.
Since Android is open-source, is it technically possible to manually include the needed l... | 2015/11/24 | [
"https://Stackoverflow.com/questions/33897423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5126604/"
] | Setup:
* Debian 8.2 (Jessie)
* PHP version: 7.0.0-4 | from Sid
* lighttpd/1.4.35 (ssl)
* 10.0.19-MariaDB-log | mysqlnd 5.0.12-dev - 20150407
Tested with phpMyAdmin versions 4.4.7, 4.5.2 & 4.6.0-dev using a socket connection.
Encountered the same problem as you and traced it to the secure connection to the MySQL-Serv... | It might be just me and maybe I'm missing something but in your upper script you don't appear to be passing a user unlike in the testscript, same goes for password.
```
$cfg['Servers'][$i]['user']='root';
$cfg['Servers'][$i]['password']='mysupersecretpassword';
```
Perhaps adding that will work. |
28,592,484 | While using the `Boot` function from the `car` package I get the error message
```
Error in get(".y.boot", envir = .carEnv) : object '.carEnv' not found
```
I suspect I have inadvertently changed/set something in my OS and have no idea what it might be. Running the code below returns an error on my desktop but runs... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28592484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1884192/"
] | In styles.xml, select a theme with no action bar.
For example
```
Theme.AppCompat.Light.NoActionBar
```
Also
1) exend your class from Activity instead of ActionBarActivity
2) remove method onCreateOptionsMenu (if present) from your activty
3) remove method onOptionsItemSelected (if present) from your activity | Your activity likely extends ActionBarActivity and the OnCreateOptionsMenu method is created by default.
To note, you should put the Activity back into the Manifest and edit the Actvity Java class file. |
28,592,484 | While using the `Boot` function from the `car` package I get the error message
```
Error in get(".y.boot", envir = .carEnv) : object '.carEnv' not found
```
I suspect I have inadvertently changed/set something in my OS and have no idea what it might be. Running the code below returns an error on my desktop but runs... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28592484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1884192/"
] | In the Android Manifest change the theme to the following
```
android:theme="@android:style/Theme.NoTitleBar"
``` | Your activity likely extends ActionBarActivity and the OnCreateOptionsMenu method is created by default.
To note, you should put the Activity back into the Manifest and edit the Actvity Java class file. |
28,592,484 | While using the `Boot` function from the `car` package I get the error message
```
Error in get(".y.boot", envir = .carEnv) : object '.carEnv' not found
```
I suspect I have inadvertently changed/set something in my OS and have no idea what it might be. Running the code below returns an error on my desktop but runs... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28592484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1884192/"
] | Sorry but i am confused that whether you want to remove the whole bar (ActionBar) or you want to remove the "three dots (menu)" on the right of the bar...
If you want to remove the whole bar then try this:
Put this under your activity tag in android manifest
```
`android:theme="@android:style/Theme.NoTitleBar"`
... | Your activity likely extends ActionBarActivity and the OnCreateOptionsMenu method is created by default.
To note, you should put the Activity back into the Manifest and edit the Actvity Java class file. |
28,592,484 | While using the `Boot` function from the `car` package I get the error message
```
Error in get(".y.boot", envir = .carEnv) : object '.carEnv' not found
```
I suspect I have inadvertently changed/set something in my OS and have no idea what it might be. Running the code below returns an error on my desktop but runs... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28592484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1884192/"
] | In styles.xml, select a theme with no action bar.
For example
```
Theme.AppCompat.Light.NoActionBar
```
Also
1) exend your class from Activity instead of ActionBarActivity
2) remove method onCreateOptionsMenu (if present) from your activty
3) remove method onOptionsItemSelected (if present) from your activity | In the Android Manifest change the theme to the following
```
android:theme="@android:style/Theme.NoTitleBar"
``` |
28,592,484 | While using the `Boot` function from the `car` package I get the error message
```
Error in get(".y.boot", envir = .carEnv) : object '.carEnv' not found
```
I suspect I have inadvertently changed/set something in my OS and have no idea what it might be. Running the code below returns an error on my desktop but runs... | 2015/02/18 | [
"https://Stackoverflow.com/questions/28592484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1884192/"
] | In styles.xml, select a theme with no action bar.
For example
```
Theme.AppCompat.Light.NoActionBar
```
Also
1) exend your class from Activity instead of ActionBarActivity
2) remove method onCreateOptionsMenu (if present) from your activty
3) remove method onOptionsItemSelected (if present) from your activity | Sorry but i am confused that whether you want to remove the whole bar (ActionBar) or you want to remove the "three dots (menu)" on the right of the bar...
If you want to remove the whole bar then try this:
Put this under your activity tag in android manifest
```
`android:theme="@android:style/Theme.NoTitleBar"`
... |
20,634,111 | I created a module then use upgrade script to add a multiselect attribute. the attribute is using 'source' to get it values dynamically. the code is the following:
**Add Attribute:**
```
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
$installer->startSetup();
$productEntityId = $installer->g... | 2013/12/17 | [
"https://Stackoverflow.com/questions/20634111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1068927/"
] | The issue is because it is already save in db - eav attribute table.
One solution that i implemented is to add a button using system xml for the module. add a script to empty the source model field in the database when click the button.
click on the button everytime you need to disable the module.
the more important... | First of all did you flush the cache after you disabled the module?
Or maybe it's an compilation error? Try [this](http://kb.magenting.com/content/22/29/en/solution-failed-to-open-stream-no-such-file-or-directory-in-includes-src-varien_autoloadphp-on-line-93.html) out.
Try to track down where exactly the issue is com... |
14,566,374 | I am trying to create a conditional statement that doesn't appear to be working in my Python code. I have tried to read and understand why, and discretely stated there doesn't appear to be a flaw in the booleans. But when I try to place them into a conditional statement, I get syntax errors. Maybe someone can take a lo... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14566374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016889/"
] | ~~Because the input string retains the `\n` character causing the input to fail:~~
~~Consider using `userinput = raw_input("Please enter a word: ").strip()` instead...~~
---
Also, `isalpha()` already checks if the length is one or more, reducing your code to:
```
if userinput.isalpha():
# whatever
```
And th... | I made three corrections:
* The first is in the if statement (isalpha() already returns a boolean)
* The second is the strip function in order to remove extra spaces at the end of the input
* The third are brackets around print strings (in order to make it compatible with python3)
The final code is:
```
userinput = ... |
14,566,374 | I am trying to create a conditional statement that doesn't appear to be working in my Python code. I have tried to read and understand why, and discretely stated there doesn't appear to be a flaw in the booleans. But when I try to place them into a conditional statement, I get syntax errors. Maybe someone can take a lo... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14566374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016889/"
] | ~~Because the input string retains the `\n` character causing the input to fail:~~
~~Consider using `userinput = raw_input("Please enter a word: ").strip()` instead...~~
---
Also, `isalpha()` already checks if the length is one or more, reducing your code to:
```
if userinput.isalpha():
# whatever
```
And th... | The traceback you've pasted shows different code from your original snippet. You have an extra close bracket after `len(userinput)`, which is the cause of the error. |
14,566,374 | I am trying to create a conditional statement that doesn't appear to be working in my Python code. I have tried to read and understand why, and discretely stated there doesn't appear to be a flaw in the booleans. But when I try to place them into a conditional statement, I get syntax errors. Maybe someone can take a lo... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14566374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2016889/"
] | The traceback you've pasted shows different code from your original snippet. You have an extra close bracket after `len(userinput)`, which is the cause of the error. | I made three corrections:
* The first is in the if statement (isalpha() already returns a boolean)
* The second is the strip function in order to remove extra spaces at the end of the input
* The third are brackets around print strings (in order to make it compatible with python3)
The final code is:
```
userinput = ... |
21,297 | I am creating a Minecraft-like engine in XNA. What I want to do is create floating islands similar to the one shown in this video:
<http://www.youtube.com/watch?v=gqHVOEPQK5g&feature=related>
How would I replicate this using a world generator? Would I have to use some Perlin noise algorithm? I don't know how that wo... | 2011/12/20 | [
"https://gamedev.stackexchange.com/questions/21297",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/11956/"
] | For the base land, make two 2D continuous noise fields (Perlin, Simplex, Wavelet, a combination thereof - whatever works for you), one with mostly low frequency. low amplitude parts for the upper limit of the land, the other with both high frequency, high amplitude parts and low frequency, high amplitude for the lower ... | 1. Using your existing 3D grid, decide on the height at which you want island tops to be. Create a set of islands in that 2D plane (lets call it the XY plane) by scattering points through the plane, then placing cubes at those points. Use cohesion to pull them closer together in clumps. Fill in any holes and you have a... |
21,297 | I am creating a Minecraft-like engine in XNA. What I want to do is create floating islands similar to the one shown in this video:
<http://www.youtube.com/watch?v=gqHVOEPQK5g&feature=related>
How would I replicate this using a world generator? Would I have to use some Perlin noise algorithm? I don't know how that wo... | 2011/12/20 | [
"https://gamedev.stackexchange.com/questions/21297",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/11956/"
] | For the base land, make two 2D continuous noise fields (Perlin, Simplex, Wavelet, a combination thereof - whatever works for you), one with mostly low frequency. low amplitude parts for the upper limit of the land, the other with both high frequency, high amplitude parts and low frequency, high amplitude for the lower ... | Would something like this be enough?

If so, check [this article](http://codeflow.org/entries/2010/dec/09/minecraft-like-rendering-experiments-in-opengl-4/#more-interesting-noise). Quoting the most relevant parts:
>
> In order to get more interesti... |
21,297 | I am creating a Minecraft-like engine in XNA. What I want to do is create floating islands similar to the one shown in this video:
<http://www.youtube.com/watch?v=gqHVOEPQK5g&feature=related>
How would I replicate this using a world generator? Would I have to use some Perlin noise algorithm? I don't know how that wo... | 2011/12/20 | [
"https://gamedev.stackexchange.com/questions/21297",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/11956/"
] | Would something like this be enough?

If so, check [this article](http://codeflow.org/entries/2010/dec/09/minecraft-like-rendering-experiments-in-opengl-4/#more-interesting-noise). Quoting the most relevant parts:
>
> In order to get more interesti... | 1. Using your existing 3D grid, decide on the height at which you want island tops to be. Create a set of islands in that 2D plane (lets call it the XY plane) by scattering points through the plane, then placing cubes at those points. Use cohesion to pull them closer together in clumps. Fill in any holes and you have a... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I achieved a good solution with this one:
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape>
<solid android:color="@android:color/t... | I've used following code.
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetTop="-2dp" android:insetLeft="-2dp" android:insetRight="-2dp"
>
<shap... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I achieved a good solution with this one:
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape>
<solid android:color="@android:color/t... | I solved this by using a list-layer, combining two shapes, one of which with height 1dp placed at the bottom
optionscreen\_bottomrectangle.xml:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<solid android:color="#535353" />
... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | @Maragues's answer is backwards, as layer-list drawables draw from top to bottom (meaning the last item in the list is drawn on top):
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<solid android:color="#535353" />
</shape>
<... | Simple and efficient
--------------------
To have a transparent view and everything that is outside has an overlay of some color, what you can do is **build the views that encapsulate the center view without the outside views stepping on the center view**.
This way you avoid having a drawable external to the layout a... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I achieved a good solution with this one:
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape>
<solid android:color="@android:color/t... | I know this question was posted long ago, so the answer will not be used by the person who posted this question, but it may still help others.
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schem... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I achieved a good solution with this one:
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape>
<solid android:color="@android:color/t... | Simple and efficient
--------------------
To have a transparent view and everything that is outside has an overlay of some color, what you can do is **build the views that encapsulate the center view without the outside views stepping on the center view**.
This way you avoid having a drawable external to the layout a... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I know this question was posted long ago, so the answer will not be used by the person who posted this question, but it may still help others.
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schem... | Simple and efficient
--------------------
To have a transparent view and everything that is outside has an overlay of some color, what you can do is **build the views that encapsulate the center view without the outside views stepping on the center view**.
This way you avoid having a drawable external to the layout a... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | Another take on the other responses using padding instead. This little snipplet makes a border on top and bottom.
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<padding android:left="0dp" android:top="1dp" android:... | Simple and efficient
--------------------
To have a transparent view and everything that is outside has an overlay of some color, what you can do is **build the views that encapsulate the center view without the outside views stepping on the center view**.
This way you avoid having a drawable external to the layout a... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I know this question was posted long ago, so the answer will not be used by the person who posted this question, but it may still help others.
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schem... | I solved this by using a list-layer, combining two shapes, one of which with height 1dp placed at the bottom
optionscreen\_bottomrectangle.xml:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<solid android:color="#535353" />
... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | I solved this by using a list-layer, combining two shapes, one of which with height 1dp placed at the bottom
optionscreen\_bottomrectangle.xml:
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<solid android:color="#535353" />
... | ```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<stroke android:width="2dp"
android:color="#BBBBBB" />
<solid android:color="@android:color/transparent" />
</shape>
</item>
<item android:bottom="2dp" >
... |
2,422,120 | Is it possible to create an Android shape object with stroke on only certain sides?
Eg I have:
```
<stroke
android:width="3dip"
android:color="#000000"
android:dashWidth="10dip"
android:dashGap="6dip" />
```
Which is similar to this CSS:
```
border: 3px dashed black;
```
How can I set the stroke on ... | 2010/03/11 | [
"https://Stackoverflow.com/questions/2422120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/291112/"
] | Another take on the other responses using padding instead. This little snipplet makes a border on top and bottom.
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the line -->
<item>
<shape>
<padding android:left="0dp" android:top="1dp" android:... | I've used following code.
```
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetTop="-2dp" android:insetLeft="-2dp" android:insetRight="-2dp"
>
<shap... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | Please don't put '/' when you pass string in RegExp option
Following would be fine
```
var strRegExPattern = '\\b'+searchStr+'\\b';
"32:width: 900px;".match(new RegExp(strRegExPattern,'g'));
``` | Notice that '\\b' is a single slash in a string followed by the letter 'b', '\b' is the escape code `\b`, which doesn't exist, and collapses to 'b'.
Also consider escaping metacharacters in the string if you intend them to only match their literal values.
```
var string = 'width';
var quotemeta_string = string.replac... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | Please don't put '/' when you pass string in RegExp option
Following would be fine
```
var strRegExPattern = '\\b'+searchStr+'\\b';
"32:width: 900px;".match(new RegExp(strRegExPattern,'g'));
``` | The right tool for this job is not regex, but String.indexOf:
```
var str = '32:width: 900px;',
search = 'width',
isInString = !(str.indexOf(search) == -1);
// isInString will be a boolean. true in this case
```
Documentation: <https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | Please don't put '/' when you pass string in RegExp option
Following would be fine
```
var strRegExPattern = '\\b'+searchStr+'\\b';
"32:width: 900px;".match(new RegExp(strRegExPattern,'g'));
``` | You're mixing up the two ways of creating regexes in JavaScript. If you use a regex literal, `/` is the regex delimiter, the `g` modifier immediately follows the closing delimiter, and `\b` is the escape sequence for a word boundary:
```
var regex = /width\b/g;
```
If you create it in the form of a string literal fo... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | Please don't put '/' when you pass string in RegExp option
Following would be fine
```
var strRegExPattern = '\\b'+searchStr+'\\b';
"32:width: 900px;".match(new RegExp(strRegExPattern,'g'));
``` | You can use **back tick** symbol to make your string dynamic **"`"**.
```
var colName = 'Col1';
var result = strTest.match(`xxxxxxx${colName}`);
```
by injecting `${colName}` in to the text, it can be editable dynamically. |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | The right tool for this job is not regex, but String.indexOf:
```
var str = '32:width: 900px;',
search = 'width',
isInString = !(str.indexOf(search) == -1);
// isInString will be a boolean. true in this case
```
Documentation: <https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/... | Notice that '\\b' is a single slash in a string followed by the letter 'b', '\b' is the escape code `\b`, which doesn't exist, and collapses to 'b'.
Also consider escaping metacharacters in the string if you intend them to only match their literal values.
```
var string = 'width';
var quotemeta_string = string.replac... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | You're mixing up the two ways of creating regexes in JavaScript. If you use a regex literal, `/` is the regex delimiter, the `g` modifier immediately follows the closing delimiter, and `\b` is the escape sequence for a word boundary:
```
var regex = /width\b/g;
```
If you create it in the form of a string literal fo... | Notice that '\\b' is a single slash in a string followed by the letter 'b', '\b' is the escape code `\b`, which doesn't exist, and collapses to 'b'.
Also consider escaping metacharacters in the string if you intend them to only match their literal values.
```
var string = 'width';
var quotemeta_string = string.replac... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | Notice that '\\b' is a single slash in a string followed by the letter 'b', '\b' is the escape code `\b`, which doesn't exist, and collapses to 'b'.
Also consider escaping metacharacters in the string if you intend them to only match their literal values.
```
var string = 'width';
var quotemeta_string = string.replac... | You can use **back tick** symbol to make your string dynamic **"`"**.
```
var colName = 'Col1';
var result = strTest.match(`xxxxxxx${colName}`);
```
by injecting `${colName}` in to the text, it can be editable dynamically. |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | You're mixing up the two ways of creating regexes in JavaScript. If you use a regex literal, `/` is the regex delimiter, the `g` modifier immediately follows the closing delimiter, and `\b` is the escape sequence for a word boundary:
```
var regex = /width\b/g;
```
If you create it in the form of a string literal fo... | The right tool for this job is not regex, but String.indexOf:
```
var str = '32:width: 900px;',
search = 'width',
isInString = !(str.indexOf(search) == -1);
// isInString will be a boolean. true in this case
```
Documentation: <https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/... |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | The right tool for this job is not regex, but String.indexOf:
```
var str = '32:width: 900px;',
search = 'width',
isInString = !(str.indexOf(search) == -1);
// isInString will be a boolean. true in this case
```
Documentation: <https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String/... | You can use **back tick** symbol to make your string dynamic **"`"**.
```
var colName = 'Col1';
var result = strTest.match(`xxxxxxx${colName}`);
```
by injecting `${colName}` in to the text, it can be editable dynamically. |
2,145,073 | I'm trying to detect an occurrence of a string within string. But the code below always returns "null". Obviously something went wrong, but since I'm a newbie, I can't spot it. I'm expecting that the code returns "true" instead of "null"
```
var searchStr = 'width';
var strRegExPattern = '/'+searchStr+'\b/';
"32:wid... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2145073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198823/"
] | You're mixing up the two ways of creating regexes in JavaScript. If you use a regex literal, `/` is the regex delimiter, the `g` modifier immediately follows the closing delimiter, and `\b` is the escape sequence for a word boundary:
```
var regex = /width\b/g;
```
If you create it in the form of a string literal fo... | You can use **back tick** symbol to make your string dynamic **"`"**.
```
var colName = 'Col1';
var result = strTest.match(`xxxxxxx${colName}`);
```
by injecting `${colName}` in to the text, it can be editable dynamically. |
15,024 | I have an aluminum single-speed frame that was marketed as a fixie. I'm wanting to convert it to a single-speed commuter. (I'm getting older and the fixie doesn't agree with my knees anymore.) It has enough clearance in the rear for 700x35 tires. It has a brake bridge but it doesn't have posts to mount v-brakes or cant... | 2013/03/29 | [
"https://bicycles.stackexchange.com/questions/15024",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/4239/"
] | Adapters like this do exist, e.g. <http://www.danscomp.com/489051.php?cat=PARTS> or <http://www.bentechbikes.com/vbrakes.htm> (Edit: Links are now dead, but they were basically the same as the one in the photo below. Sourcing one might be even harder now though.)
In fact I used one on my old folding bike - but you can... | I do not think anything bolted on could be good enough. Since it is aluminum frame, brazing or welding the bosses would also be complicated.
But instead of replacing the whole frame, you might just change front fork with one that has bosses. That way on front where it makes more difference you would have V-brake, and ... |
15,024 | I have an aluminum single-speed frame that was marketed as a fixie. I'm wanting to convert it to a single-speed commuter. (I'm getting older and the fixie doesn't agree with my knees anymore.) It has enough clearance in the rear for 700x35 tires. It has a brake bridge but it doesn't have posts to mount v-brakes or cant... | 2013/03/29 | [
"https://bicycles.stackexchange.com/questions/15024",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/4239/"
] | I do not think anything bolted on could be good enough. Since it is aluminum frame, brazing or welding the bosses would also be complicated.
But instead of replacing the whole frame, you might just change front fork with one that has bosses. That way on front where it makes more difference you would have V-brake, and ... | They are not cheap ($130 front & rear), but Campagnolo makes a lateral pull TT brake that mounts on the center post:
[http://www.amazon.com/Campagnolo-TT-Brake-Front-Lateral/dp/B0057P8SFM/ref=pd\_sim\_sbs\_sg\_1](http://rads.stackoverflow.com/amzn/click/B0057P8SFM)
But, wouldn't it be easier to mount side-pull calipe... |
15,024 | I have an aluminum single-speed frame that was marketed as a fixie. I'm wanting to convert it to a single-speed commuter. (I'm getting older and the fixie doesn't agree with my knees anymore.) It has enough clearance in the rear for 700x35 tires. It has a brake bridge but it doesn't have posts to mount v-brakes or cant... | 2013/03/29 | [
"https://bicycles.stackexchange.com/questions/15024",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/4239/"
] | Adapters like this do exist, e.g. <http://www.danscomp.com/489051.php?cat=PARTS> or <http://www.bentechbikes.com/vbrakes.htm> (Edit: Links are now dead, but they were basically the same as the one in the photo below. Sourcing one might be even harder now though.)
In fact I used one on my old folding bike - but you can... | There used to be castings that were designed to fit over existing brake studs and stiffen frames that had too much side-to-side flex for the cantis to be effective. Don't know if they could be adapted to your purpose, though, and don't know if they're still available. |
15,024 | I have an aluminum single-speed frame that was marketed as a fixie. I'm wanting to convert it to a single-speed commuter. (I'm getting older and the fixie doesn't agree with my knees anymore.) It has enough clearance in the rear for 700x35 tires. It has a brake bridge but it doesn't have posts to mount v-brakes or cant... | 2013/03/29 | [
"https://bicycles.stackexchange.com/questions/15024",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/4239/"
] | There used to be castings that were designed to fit over existing brake studs and stiffen frames that had too much side-to-side flex for the cantis to be effective. Don't know if they could be adapted to your purpose, though, and don't know if they're still available. | They are not cheap ($130 front & rear), but Campagnolo makes a lateral pull TT brake that mounts on the center post:
[http://www.amazon.com/Campagnolo-TT-Brake-Front-Lateral/dp/B0057P8SFM/ref=pd\_sim\_sbs\_sg\_1](http://rads.stackoverflow.com/amzn/click/B0057P8SFM)
But, wouldn't it be easier to mount side-pull calipe... |
15,024 | I have an aluminum single-speed frame that was marketed as a fixie. I'm wanting to convert it to a single-speed commuter. (I'm getting older and the fixie doesn't agree with my knees anymore.) It has enough clearance in the rear for 700x35 tires. It has a brake bridge but it doesn't have posts to mount v-brakes or cant... | 2013/03/29 | [
"https://bicycles.stackexchange.com/questions/15024",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/4239/"
] | Adapters like this do exist, e.g. <http://www.danscomp.com/489051.php?cat=PARTS> or <http://www.bentechbikes.com/vbrakes.htm> (Edit: Links are now dead, but they were basically the same as the one in the photo below. Sourcing one might be even harder now though.)
In fact I used one on my old folding bike - but you can... | They are not cheap ($130 front & rear), but Campagnolo makes a lateral pull TT brake that mounts on the center post:
[http://www.amazon.com/Campagnolo-TT-Brake-Front-Lateral/dp/B0057P8SFM/ref=pd\_sim\_sbs\_sg\_1](http://rads.stackoverflow.com/amzn/click/B0057P8SFM)
But, wouldn't it be easier to mount side-pull calipe... |
23,565 | I'm fresh out of college and am currently in my first full-time job. I would like to get a few books to improve myself in my job (I'm a developer). Are there any tax-related benefits to this, or would I be better off borrowing them from my local library? | 2013/07/31 | [
"https://money.stackexchange.com/questions/23565",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/10796/"
] | As some of the comments indicated, you could ask your employer to give you a book buying budget, but if not....
As a developer there are books that should sit on your shelf, one those being Design Patterns. A quick search of Amazon or Half.com show these books retail new for about $40, or you can buy used for $20 or l... | Some companies pay for access to the electronic versions of the O'Reilly Books or Safari Books online or something similar as part of their package of benefits. When you leave the company you will lose access to the books, but that will also be true if the company buys the hard copy version of the book for you.
You mi... |
34,405,057 | My app will pull some json data when it is started and realistically, once the data has been pulled, I really won't need to pull it again for the duration of the user experience. The backend data may update a few times a day at most, so I think I would like to just grab the data upon app start and then use that same da... | 2015/12/21 | [
"https://Stackoverflow.com/questions/34405057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/732334/"
] | You should think about OS killing your app process on low-memory, so backing your data on disk is a good thing to do. Doing so you have an ability to show user data from disk cache while refreshing it in background from server.
Choosing the tool for data storage depends on the way you need to work with data.
Of cours... | I would still recommend a SQLite Databse, you can easily declare it as a 'in-memory' database, if that is what you want.
However.... I would be rather upset as a user of your application if it downloaded redundant data over and over. I would just recommend making a content provider and being done with it. This gives y... |
34,405,057 | My app will pull some json data when it is started and realistically, once the data has been pulled, I really won't need to pull it again for the duration of the user experience. The backend data may update a few times a day at most, so I think I would like to just grab the data upon app start and then use that same da... | 2015/12/21 | [
"https://Stackoverflow.com/questions/34405057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/732334/"
] | You should think about OS killing your app process on low-memory, so backing your data on disk is a good thing to do. Doing so you have an ability to show user data from disk cache while refreshing it in background from server.
Choosing the tool for data storage depends on the way you need to work with data.
Of cours... | Easiest thing is to do is store the json file in Apps data storage and parse the json every time you need.
But this is **not recommended** as it is costly to parse data every time.
**Best option** is to implement [Realm](https://realm.io/news/realm-for-android/) (Replacement for Sqlite) which is very easy to implemen... |
16,844,155 | As far as I know you call the copy constructor in the following cases:
1 When instantiating one object and initializing it with values from another object
2 When passing an object by value.
3 When an object is returned from a function by value.
I decided to put this to the test and I made this small progra... | 2013/05/30 | [
"https://Stackoverflow.com/questions/16844155",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846979/"
] | Because of [Return Value Optimization](http://en.wikipedia.org/wiki/Return_value_optimization) the 3rd test case's copy constructor call is optimized away by the compiler. | In virtually all cases, the compiler is not allowed to change the meaning of your code. It can (and will when optimising) change your code dramatically from what you wrote into something more optimal whilst never changing the observable behaviour of your code.
This is why when debugging you'll see many confusing thing... |
65,231,824 | By clicking on a button, I can find the id of the button through `findViewById(v.getId())`. How can I replace it with View Binding?
This is my code:
```
fun TastoClick(v: View) {
val btn = findViewById(v.getId()) as Button
var name = btn.text.toString().toInt()
}
``` | 2020/12/10 | [
"https://Stackoverflow.com/questions/65231824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13015646/"
] | Please do give the documentation for [View Binding](https://developer.android.com/topic/libraries/view-binding) a look I'm sure you will find it answers your question.
But in summary:
1. in the module-level **build.gradle** add:
```
android {
...
buildFeatures {
viewBinding true
}
}
```
2. For a... | Kotlin
```
val btn = binding.root.findViewById<Button>(v.id)
``` |
14,464,088 | I've an instance of ubuntu on amazon; it also gives a public DNS for me like ec2-XX-XXX-XX-XX.compute-1.amazonaws.com which is opened to world.
I've my own DNS which I link with amazon hosting/instance and I would like to hide public DNS from amazon to avoid duplicate of content for google SEO.
Is it possible and if ... | 2013/01/22 | [
"https://Stackoverflow.com/questions/14464088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/850366/"
] | All you need to do is configure your web server to respond just to the domain name. Technically speaking, you could access the web server on the ip address if you do not use virtual hosts. | You could set up both domains as your's in the Google Webmaster Tools and then set your "real" DNS name to be the preferred one. You are not hiding it you are just telling google that they are the same site. |
14,464,088 | I've an instance of ubuntu on amazon; it also gives a public DNS for me like ec2-XX-XXX-XX-XX.compute-1.amazonaws.com which is opened to world.
I've my own DNS which I link with amazon hosting/instance and I would like to hide public DNS from amazon to avoid duplicate of content for google SEO.
Is it possible and if ... | 2013/01/22 | [
"https://Stackoverflow.com/questions/14464088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/850366/"
] | * set up your hostname accordingly
* adjust your reverse-DNS entry
* delete the A-entry for the amazon-hostname (be sure to have your server-IP at hand in case you mistyped something!)
* double-check every service for configuration-mistakes, make the services bind themselves explicitly on your own domain | You could set up both domains as your's in the Google Webmaster Tools and then set your "real" DNS name to be the preferred one. You are not hiding it you are just telling google that they are the same site. |
14,464,088 | I've an instance of ubuntu on amazon; it also gives a public DNS for me like ec2-XX-XXX-XX-XX.compute-1.amazonaws.com which is opened to world.
I've my own DNS which I link with amazon hosting/instance and I would like to hide public DNS from amazon to avoid duplicate of content for google SEO.
Is it possible and if ... | 2013/01/22 | [
"https://Stackoverflow.com/questions/14464088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/850366/"
] | All you need to do is configure your web server to respond just to the domain name. Technically speaking, you could access the web server on the ip address if you do not use virtual hosts. | * set up your hostname accordingly
* adjust your reverse-DNS entry
* delete the A-entry for the amazon-hostname (be sure to have your server-IP at hand in case you mistyped something!)
* double-check every service for configuration-mistakes, make the services bind themselves explicitly on your own domain |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... | The Firefox add-on called [YouTube Play All](https://addons.mozilla.org/en-US/firefox/addon/222206/) seems to do what you want. |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Much easier way now:
1. Go to the user's Youtube home page (e.g. <https://www.youtube.com/user/xyz/> ).
2. Hover over the "Uploads" section. You will see a "Play all" button appear next to "Uploads".
3. Click on "Play all" and it will generate a playlist with all the user's uploaded videos from newest to oldest. (I ju... | You could also use this site here: <http://youtube.nestharion.de>
It creates a playlist with all the videos from a user and plays them continually. |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Much easier way now:
1. Go to the user's Youtube home page (e.g. <https://www.youtube.com/user/xyz/> ).
2. Hover over the "Uploads" section. You will see a "Play all" button appear next to "Uploads".
3. Click on "Play all" and it will generate a playlist with all the user's uploaded videos from newest to oldest. (I ju... | It's subtle, and it's cheeky, but it can be done:
Given a particular channel URL:
<https://www.youtube.com/channel/UC9mPk8yIk1AUC8PDsUYFBaA>
You can fiddle a little bit and:
<https://www.youtube.com/playlist?list=UU9mPk8yIk1AUC8PDsUYFBaA>
Note that you change `channel/UC` to `playlist?list=UU`.
`$ echo "$URL" | s... |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... | If you have subscribed to the user, Youtube TV is an alternative:
<https://www.youtube.com/tv>
All you need to do is link your account with the app. No apps, plugins, or 3rd party webapps needed. |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Much easier way now:
1. Go to the user's Youtube home page (e.g. <https://www.youtube.com/user/xyz/> ).
2. Hover over the "Uploads" section. You will see a "Play all" button appear next to "Uploads".
3. Click on "Play all" and it will generate a playlist with all the user's uploaded videos from newest to oldest. (I ju... | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | It's subtle, and it's cheeky, but it can be done:
Given a particular channel URL:
<https://www.youtube.com/channel/UC9mPk8yIk1AUC8PDsUYFBaA>
You can fiddle a little bit and:
<https://www.youtube.com/playlist?list=UU9mPk8yIk1AUC8PDsUYFBaA>
Note that you change `channel/UC` to `playlist?list=UU`.
`$ echo "$URL" | s... | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... | This is a much simpler way...
Just go to the uploads tab of the YouTube channel, then press "Play all"
[](https://i.stack.imgur.com/EoBsa.png)
That should play the playlist of all videos from a channel |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | It's subtle, and it's cheeky, but it can be done:
Given a particular channel URL:
<https://www.youtube.com/channel/UC9mPk8yIk1AUC8PDsUYFBaA>
You can fiddle a little bit and:
<https://www.youtube.com/playlist?list=UU9mPk8yIk1AUC8PDsUYFBaA>
Note that you change `channel/UC` to `playlist?list=UU`.
`$ echo "$URL" | s... | If you have subscribed to the user, Youtube TV is an alternative:
<https://www.youtube.com/tv>
All you need to do is link your account with the app. No apps, plugins, or 3rd party webapps needed. |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... | Here's a bookmarklet & code for uploads playlist. Copy and save the line below as a bookmark, open a YouTube video and click the bookmark to load the user's uploads playlist. I don't think a public or auto-generated playlist of all uploads exists, only recent uploads, which is the same as what you see when you click pl... |
9,702 | For example, I want to play all 58 videos uploaded by a single user.
Obviously I could create a playlist, add each video to it, then play the entire playlist, but is there a simpler way? | 2010/11/26 | [
"https://webapps.stackexchange.com/questions/9702",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/7727/"
] | URL hacking for the rescue! You can append `&list=UL` to the end of a video URL from that user.
So, if you have:
```
https://www.youtube.com/watch?v=zucBfXpCA6s
```
it should become:
[`https://www.youtube.com/watch?v=zucBfXpCA6s&list=UL`](https://www.youtube.com/watch?v=zucBfXpCA6s&list=UL)
```
... | Little trick I found is to get a user's unique code/string from their profile page's source. Here's how to do it:
* Go to their user page and right-click -> "view page source".
* Search for "vnd" and copy the code that you find (It should start with "UC").
* Open one of the user's videos. In the URL address, add the f... |
40,324,288 | Just that. [Mozilla's Introduction to OOP in Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript) explains that `console.log()` function isn't actually part of Javascript itself. So I'm very interested to know why these? | 2016/10/29 | [
"https://Stackoverflow.com/questions/40324288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4826848/"
] | JavaScript is a language specification (strictly speaking, [ECMAScript](https://en.wikipedia.org/wiki/ECMAScript)).
`console`, on the other hand, *is an API*. There are currently [669 Web APIs listed on MDN](https://developer.mozilla.org/en-US/docs/Web/API) (to answer your second question). Same goes for `window`, for... | Javascript-Interpreters are very complex packages of software.
However, as Chromium (a.k.a Google Chrome), Microsoft Chakra and Mozilla Firefox are open source, feel free to explore their source code.
Here is the source-code for Microsoft Chakra:
[Microsoft/ChakraCore on Github](https://github.com/Microsoft/ChakraCore... |
33,594,696 | I'm using RSA encryption in an application I was working on, and it felt pretty much secure... You got a public key that encrypts it and a private key that decrypts it.
Now I wish to use AES in a different application, and the idea of having the same key for client-side and server-side bothers me... Isn't the server-s... | 2015/11/08 | [
"https://Stackoverflow.com/questions/33594696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4051349/"
] | >
> Isn't the server-side key should be kept secret from the client?
>
>
>
Depends if they trust each other, then no, it should not be secret. Moreover it can't be secret if you want to use symmetric cryptography because both parties need to share a secret key.
>
> Since otherwise, if the encryption key ain't se... | AES is a symmetric algorithm. Both ends *must* have the same key. You
need a secure way to share that key between the two endpoints. That is
the problem that public-key cryptography solves. |
33,594,696 | I'm using RSA encryption in an application I was working on, and it felt pretty much secure... You got a public key that encrypts it and a private key that decrypts it.
Now I wish to use AES in a different application, and the idea of having the same key for client-side and server-side bothers me... Isn't the server-s... | 2015/11/08 | [
"https://Stackoverflow.com/questions/33594696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4051349/"
] | >
> Isn't the server-side key should be kept secret from the client?
>
>
>
Depends if they trust each other, then no, it should not be secret. Moreover it can't be secret if you want to use symmetric cryptography because both parties need to share a secret key.
>
> Since otherwise, if the encryption key ain't se... | One important factor is that **RSA** is very slow compared to **AES**. Something like 500 times slower (depending on key length and if you have hw support etc.).
This is why **RSA** is often used in combination with a fast **symmetric algorithm** like **AES**. This is refered to as hybrid encryption. With this methode... |
59,579,859 | How can I set the niceness for each process in a `multiprocessing.Pool`? I understand that I can increment niceness with `os.nice()`, but how do call it in the child process after creating the pool? If I call it in the mapped function it will be called every time the function executes, rather than once when the process... | 2020/01/03 | [
"https://Stackoverflow.com/questions/59579859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/694195/"
] | What about using an initializer for that? <https://docs.python.org/3.8/library/multiprocessing.html#multiprocessing.pool.Pool>
The function is called once when the pool is started so the os.nice() call in the initializer sets the niceness for the proces after that.
I've added some additional statements to show that it... | You can access the worker processes via `pool._pool`.
With this you can probably set the nicesness of each worker individually.
```
import time
import psutil
import multiprocessing as mp
NICENESS =19
DATA = range(15)
def foo(bar):
time.sleep(bar)
return bar*2
if __name__=='__main__':
pool = mp.Pool(8) # 1... |
3,455,798 | Here is the question:
Define a sequence by $x\_0=5$ and
$$
x\_{n+1}=\frac{x\_{n}^{2}+5 x\_{n}+4}{x\_{n}+6}.
$$
Let $m$ be the least positive integer such that
$$
x\_{m} \leq 4+\frac{1}{2^{20}},
$$
In which of the following intervals does $m$ lie?
$$
[9,26],[27,80],[81,242],[243,728],[729,+\infty].
$$
I noticed that ... | 2019/11/29 | [
"https://math.stackexchange.com/questions/3455798",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/649783/"
] | Write $x\_n:=4+y\_n$ $(n\geq0)$ with $y\_0:=1$. Then you obtain the recursion
$$y\_{n+1}={9y\_n+y\_n^2\over 10+y\_n}=y\_n\left({9\over10}+{y\_n\over100+10 y\_n}\right)\qquad(n\geq0)\ .\tag{1}$$
This shows that the $y\_n$ are approximately multiplied with ${9\over10}$ at each step. Solving $$\left({9\over10}\right)^m=2^... | Seems like I've got an approximation.
Let $y\_n=x\_n-4$, then
$$
y\_{n}=y\_n\left(1-\frac{1}{y\_{n-1}+10}\right)<\frac{9}{10}y\_{n-1}<\cdots<\left(\frac{9}{10}\right)^ny\_0=\left(\frac{9}{10}\right)^n.
$$
Let $\left(\frac{9}{10}\right)^n\leqslant \frac{1}{2^{20}}$, we get
$$
n\leqslant \log\_{9/10} \frac{1}{2^{20}}\... |
3,563,766 | If i use Natural joins than what is the use of primary key and foreign key? | 2010/08/25 | [
"https://Stackoverflow.com/questions/3563766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/430395/"
] | Primary keys and foreign keys are types of database **constraint**: their purpose is to ensure the integrity of the data, not to facilitate joins.
**Primary Key**: there must not be more than one row with the same value for the primary key column(s).
**Foreign Key**: every value in the foreign key column(s) of each r... | Not sure quite what you are asking. Joins do something different to PKs/FKs - and they are clearly not a substitute for each other. PKs and FKs implement constraints to ensure correctness of the data. Joins are a type of query operation. |
3,563,766 | If i use Natural joins than what is the use of primary key and foreign key? | 2010/08/25 | [
"https://Stackoverflow.com/questions/3563766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/430395/"
] | Primary keys and foreign keys are types of database **constraint**: their purpose is to ensure the integrity of the data, not to facilitate joins.
**Primary Key**: there must not be more than one row with the same value for the primary key column(s).
**Foreign Key**: every value in the foreign key column(s) of each r... | Natural joins are usually a bad idea. You can accidentally join to the wrong field and then your results are all wrong but may appear to be right. Even if they work at first, changes to the database at a later time could drastically alter your query results and be hard to figure out. I would under no circumstances use ... |
68,375,397 | Now I am using this code to generate an JWT token(I am using [jjwt](https://github.com/jwtk/jjwt) lib), this is my mini example of code:
```
package com.dolphin.soa.post;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
imp... | 2021/07/14 | [
"https://Stackoverflow.com/questions/68375397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2628868/"
] | TLDR: **private key and secret key are different**
There are two radically different kinds of digital cryptography used in the last half-century: traditional or symmetric, also called conventional, and public-key or asymmetric. In Java crypto, and thus in jjwt, the `SecretKey[Spec]` classes and their subclasses are us... | Thanks for dave\_thompson\_085 patient,I am solving the problem using this code:
```
public static String generateToken(AppleJwtHeader jwtHeader, AppleJwtPayload jwtPayload ) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
byte[] p8der = Files.readAllBytes(Path.of("/opt/apps/dolphin-pos... |
326,883 | I have a very long conditional statement and I would like to make it multiline. I know how to do:
```
\begin{equation}
A=
\begin{cases}
1, & \text{if}\ x=1, x=2 \\
2, & \text{else}
\end{cases}
\end{equation}
```
but would like something like:
[](https://i.stack.imgur.com/ctSMu.png)
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
A=
\begin{cases}
1, & \text{if $x=1$}\\
& \text{\phantom{if }$x=2$}\\
... | Well, this should do:
```
\begin{equation}
A=
\begin{cases}
1, & x=1 \\
& x=2 \\
2, & \text{else}
\end{cases}
\end{equation}
```
Or do I miss something? |
326,883 | I have a very long conditional statement and I would like to make it multiline. I know how to do:
```
\begin{equation}
A=
\begin{cases}
1, & \text{if}\ x=1, x=2 \\
2, & \text{else}
\end{cases}
\end{equation}
```
but would like something like:
[](https://i.stack.imgur.com/ctSMu.png)
```
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
A=
\begin{cases}
1, & \text{if $x=1$}\\
& \text{\phantom{if }$x=2$}\\
... |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | How about [this](http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en) - Microsoft Visual Studio 2008 Service Pack 1 (iso)? | Tried [MSDN](http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)? |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | You can get Visual Studio 2008 SP1 ISO here - <http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en>
It is 831.3 MB | Tried [MSDN](http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)? |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | <http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en> | Tried [MSDN](http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)? |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | How about [this](http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en) - Microsoft Visual Studio 2008 Service Pack 1 (iso)? | You can get Visual Studio 2008 SP1 ISO here - <http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en>
It is 831.3 MB |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | How about [this](http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en) - Microsoft Visual Studio 2008 Service Pack 1 (iso)? | <http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en> |
834,979 | Does anyone know where to download the Visual Studio 2008 SP1 Redistributable?
I sure would like to have it so I don't have to download the service pack for every install. | 2009/05/07 | [
"https://Stackoverflow.com/questions/834979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/64334/"
] | You can get Visual Studio 2008 SP1 ISO here - <http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&displaylang=en>
It is 831.3 MB | <http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en> |
64,108 | I saw a Solidity smart contract where some variables were declared with the type `address` and some were declared with the type `address payable`. What are the differences between the two?
* Do they store the same data?
* How do you convert a value from one address type to the other type? | 2018/12/15 | [
"https://ethereum.stackexchange.com/questions/64108",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/14115/"
] | Data storage and representation in the EVM
------------------------------------------
The `address` and `address payable` types both store a 160-bit Ethereum address. The concept of payable and non-payable addresses only exists in the Solidity type system at compile-time. The difference between payable and non-payable... | Yes, they store the same data, that is a valid ethereum address.
The difference is that the compiler (at compile time) when encounter an “address payable” is ready to allow (if required in the following code) that address to access primitives useful to manage ethers (namely call, transfer, send).
In that sense, after... |
64,108 | I saw a Solidity smart contract where some variables were declared with the type `address` and some were declared with the type `address payable`. What are the differences between the two?
* Do they store the same data?
* How do you convert a value from one address type to the other type? | 2018/12/15 | [
"https://ethereum.stackexchange.com/questions/64108",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/14115/"
] | Data storage and representation in the EVM
------------------------------------------
The `address` and `address payable` types both store a 160-bit Ethereum address. The concept of payable and non-payable addresses only exists in the Solidity type system at compile-time. The difference between payable and non-payable... | I was confused about the payable address but after a lot of searching, I find the best use case of a payable address.
when you are working with a solidity smart contract then you use the payable function which receives ethers and stores it in your contract, not your personal address.
so if you want to directly send eth... |
64,108 | I saw a Solidity smart contract where some variables were declared with the type `address` and some were declared with the type `address payable`. What are the differences between the two?
* Do they store the same data?
* How do you convert a value from one address type to the other type? | 2018/12/15 | [
"https://ethereum.stackexchange.com/questions/64108",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/14115/"
] | Yes, they store the same data, that is a valid ethereum address.
The difference is that the compiler (at compile time) when encounter an “address payable” is ready to allow (if required in the following code) that address to access primitives useful to manage ethers (namely call, transfer, send).
In that sense, after... | I was confused about the payable address but after a lot of searching, I find the best use case of a payable address.
when you are working with a solidity smart contract then you use the payable function which receives ethers and stores it in your contract, not your personal address.
so if you want to directly send eth... |
377,687 | I am able to connect to a wireless network using `nm-applet` when running it in lightdm, however, it does not work in an openBox session that I start as myself (a user started X Session), but am not able to do so using nmcli.
I am running `nmcli` using `sudo`. After 90 seconds, I get a time out message. What could be ... | 2013/11/15 | [
"https://askubuntu.com/questions/377687",
"https://askubuntu.com",
"https://askubuntu.com/users/46543/"
] | 1. In case the wireless interface is already connected to some other AP, first disconnect it using
```
nmcli con down <AP name>
```
**Example**: Supposing interface is already connected to '*PreviousAP*', then disconnect it using
```
nmcli con down PreviousAP
```
2. Now for Connecting to new AP
Considering you ... | **To turn on WiFi**
```
sudo rfkill unblock wifi
nmcli networking on
```
**To list WiFi Networks**
```
nmcli connection show
```
Output should be something like this
```
NAME UUID TYPE TIMESTAMP-REAL
Rishbh-Q1000 ... |
12,585,720 | I know about [singleton](https://en.wikipedia.org/wiki/Singleton_pattern), but I can't use it in an Android project. I am a beginner in Android.
How and where can we use singleton in an Android project for *large data*? I have used it for simple values. | 2012/09/25 | [
"https://Stackoverflow.com/questions/12585720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1719208/"
] | Singleton in Android is the same as singleton in Java:
A basic singleton class example:
```
public class AppManager
{
private static AppManager _instance;
private AppManager()
{
}
public synchronized static AppManager getInstance()
{
if (_instance == null)
{
_... | 1. For "large data" use a database. Android gives you SQLite.
2. Of course you can use singletons in Android. What makes you think you cannot?
For more information on the singleton pattern, read *[Singleton pattern](http://en.wikipedia.org/wiki/Singleton_pattern)*.
For more information on SQLite in Android, read: *[D... |
70,382,388 | I've tried installing rxjs with "npm install rxjs" but it still can't find the module after installing. I've tried installing "npm install --save rxjs-compat" as well as reinstalling and uninstalling the modules, but it still doesn't work. Thanks a lot for the help in advance!
[. It can't know that the NAS will do the move to its own recycle folder. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.