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 |
|---|---|---|---|---|---|
43,729,199 | I have a problem when i query using mongoose.I coding follow this [Mongoose.js: Find user by username LIKE value](https://stackoverflow.com/questions/9824010/mongoose-js-find-user-by-username-like-value). But it return blank.
This my code return blank.
```
var promise = UserSchema.find({name: /req.params.keyword/ })... | 2017/05/02 | [
"https://Stackoverflow.com/questions/43729199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5361328/"
] | use `$regex` in mongodb
[how to use regex](https://docs.mongodb.com/manual/reference/operator/query/regex/)
example
```
select * from table where abc like %v%
```
in mongo
```
var colName="v";
models.customer.find({ "abc": { $regex: '.*' + colName + '.*' } },
function(err,data){
console.log('data'... | ```
select * from table where abc like %_keyword%
```
in mongo it is
```
const list = await ProductModel.find({{ pname :{ $regex : '.*'+ _keyword + '.*' }});
```
here `_keyword` can be any text eg. fruit, pen, etc. as i am searching products model. |
35,165,245 | So I am wondering how to compute HTML in an AngularJS object (Like this: `{{names}}`) but I have an `'<a>'` element inside the object.
It comes out like this:
```
<a href="http://www.example.com">link text</a>
```
I want this: [link text](http://www.example.com)
I want the links in [this page](http://sixty.netne... | 2016/02/02 | [
"https://Stackoverflow.com/questions/35165245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Im pretty sure the answer you are looking for can be found [here](https://docs.angularjs.org/api/ng/directive/ngHref) `ng-href` will allow you to use the `{{}}` syntax to dynamically generate a url from your angular controller. | I think you need something like this `<div ng-bind-html="name"></div>`.
Note: you may need to do an '$sce.trustAsHtml()' if your HTML contents contain links. But be sure that what content goes in the HTML is safe before doing this. See more details [Here](https://docs.angularjs.org/api/ng/directive/ngBindHtml) |
1,131,767 | Using the bash language with the following architecture
```
- directory1
- entries
- directory2
- entries
```
I want to delete the duplicate entries, and just keep one of them.
I am using the following script :
```
for dir in *
do
[ -d "$dir" ] && for file in "$dir"/*
do
filename... | 2016/10/05 | [
"https://superuser.com/questions/1131767",
"https://superuser.com",
"https://superuser.com/users/345392/"
] | Adding the following test did the trick:
```
for dir in *
do
[ -d "$dir" ] && [ "$(ls -A $dir)" ] && for file in "$dir"/*
do
filename=$(basename "$file")
find . -name "$filename" -not -path "*$dir*" -exec rm "{}" \;
done
done
``` | With your solution, I don't see how you *keep one*. If file 'f' is in directories 'A' and 'B':
* when your outer for loop is on 'A', the find will print B/f.
* -------------------------------'B', ------------------- A/f.
However, you don't do anything, you just print.
I propose this, without nesting a find in a for... |
38,457,904 | I have the following requirements:
* I need a `div` with an image + text inside.
* The `div` should keep its aspect ratio and all images inside of the `divs` should have the same height (to do this, I use: [Maintain the aspect ratio of a div with CSS](https://stackoverflow.com/questions/1495407/maintain-the-aspect-rat... | 2016/07/19 | [
"https://Stackoverflow.com/questions/38457904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/973158/"
] | Add text as `position:absolute`
```
.inner-text{
position:absolute;
width:100%;
height:100%;
text-align:center;
z-index:1;
}
.event:hover .inner-text{
background:rgba(255,255,255,0.5)
}
<div class="bit-3">
<div class="event" style="background-image: url(https://container25.at/wpdev/wp-content/uploads/20... | try adding background-size: contain;height: 0;
```css
.bit-3 {
width: 33.33333%;
float: left;
max-resolution: res;-left: 20px;
}
.event {
margin: 0 auto;
position: relative;
border: 2px solid #000000;
padding-bottom: 150%;
background-size: cover;
}
```
```html
<div class="bit-3"... |
53,963,653 | Here is my js code:
```
import axios from 'axios';
const quotes = document.querySelector('.quotes');
const getResults = async () => {
try {
const res = await axios('http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1');
quotes.innerHTML = res.data[0].content;
... | 2018/12/28 | [
"https://Stackoverflow.com/questions/53963653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10807685/"
] | `__null` is a `g++` internal thing that serves roughly the same purpose as the standard `nullptr` added in C++11 (acting consistently as a pointer, never an integer).
`NULL` is defined as `0`, which can be implicitly used as integer, boolean, floating point value or pointer, which is a problem when it comes to overloa... | `NULL` is the old C symbol for a null pointer. C++ traditionally have used `0` for null pointers, and since the C++11 standard `nullptr`.
Considering that `x` doesn't seem to be a pointer then you can't initialize `x` to be a null pointer, and the `__null` symbol is perhaps some compiler-internal symbol for a null *va... |
53,963,653 | Here is my js code:
```
import axios from 'axios';
const quotes = document.querySelector('.quotes');
const getResults = async () => {
try {
const res = await axios('http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1');
quotes.innerHTML = res.data[0].content;
... | 2018/12/28 | [
"https://Stackoverflow.com/questions/53963653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10807685/"
] | `__null` is a `g++` internal thing that serves roughly the same purpose as the standard `nullptr` added in C++11 (acting consistently as a pointer, never an integer).
`NULL` is defined as `0`, which can be implicitly used as integer, boolean, floating point value or pointer, which is a problem when it comes to overloa... | `NULL` has been overtaken from C into C++ and - prior to C++11 - adopted its C meaning:
>
> until C++11: The macro NULL is an implementation-defined null pointer
> constant, which may be an integral constant expression rvalue of
> integer type that evaluates to zero.
>
>
>
C++11 then introduced a dedicated null... |
53,963,653 | Here is my js code:
```
import axios from 'axios';
const quotes = document.querySelector('.quotes');
const getResults = async () => {
try {
const res = await axios('http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1');
quotes.innerHTML = res.data[0].content;
... | 2018/12/28 | [
"https://Stackoverflow.com/questions/53963653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10807685/"
] | `NULL` has been overtaken from C into C++ and - prior to C++11 - adopted its C meaning:
>
> until C++11: The macro NULL is an implementation-defined null pointer
> constant, which may be an integral constant expression rvalue of
> integer type that evaluates to zero.
>
>
>
C++11 then introduced a dedicated null... | `NULL` is the old C symbol for a null pointer. C++ traditionally have used `0` for null pointers, and since the C++11 standard `nullptr`.
Considering that `x` doesn't seem to be a pointer then you can't initialize `x` to be a null pointer, and the `__null` symbol is perhaps some compiler-internal symbol for a null *va... |
23,922,142 | First of all, the dbf module is great. I've been using it with great success.
I'm trying to open a dbf file on a network share which is a read-only file system. When I try to open it like this, I get an error which says that the .dbf file is read-only.
```
thisTable = dbf.Table('/volumes/readOnlyVolume/thisFile.dbf... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23922142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2390697/"
] | Cool, thanks! :)
At this point, you need to specify the open mode when you call `thisTable.open()`, like this:
```
thisTable.open(mode='read-only')
```
or
```
thisTable.open(mode=dbf.READ_ONLY)
```
Oh, and here's the [PyPI link](https://pypi.python.org/pypi/dbf) to the module. | Assuming you're using [this module](http://dbfpy.sourceforge.net/), the magic incantation to open read only is:
```
dbf1 = Dbf()
dbf1.openFile('county.dbf', readOnly=1)
```
Hope that helped, if not, do add more detail to your question. |
62,528,487 | ```
template<int... Is>
struct seq { };
template<int N, int... Is>
struct gen_seq : gen_seq<N - 1, N - 1, Is...> { };
template<int... Is>
struct gen_seq<0, Is...> : seq<Is...> { };
```
when call gen\_seq<3> get the final struct seq<0, 1, 2>{} type, I can not understand the "struct seq<0, 1, ... | 2020/06/23 | [
"https://Stackoverflow.com/questions/62528487",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13796174/"
] | It is the usage of [Variadic template](https://en.wikipedia.org/wiki/Variadic_template), which can take any number of parameters. You can check call stack using `__PRETTY_FUNCTION__` in the constructor of these structs.
```
#include <iostream>
template<int... Is>
struct seq {
seq(){std::cout<<__PRETTY_FUNCTION__<... | It's an object of a *type* containing three numbers. The object has no data members.
It's used to carry around a template parameter pack (of `int`s) as a single value, e.g.
```
template <typename UnaryOperation, typename... Ts, int... Is>
std::tuple<Ts...> tuple_for_impl(UnaryOperation op, std::tuple<Ts...> input, se... |
39,421,292 | I keep getting this message when I try to compile:
```none
task.c++:54:102: error: invalid use of non-static member function
this->createTask(&otherTask, this->otherMain, mainTask.regs.eflags, (uint32_t*)mainTask.regs.cr3);
```
Here is my task.c++ function:
```
#include "task.h"
static task_q *runningTask;
s... | 2016/09/10 | [
"https://Stackoverflow.com/questions/39421292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5768335/"
] | First off:
A `<div>` is a block element by nature. It will always become 100% wide. If you want it to not be 100% wide, give it a `display:inline-block` so it won't get bigger than it needs to be. Then give it a `margin:0 auto;` or a `text-align:center` on the parent to center it.
HOWEVER, You are *not allowed to put ... | can you post your code?
You should NOT need a div inside the button. If you need the button to have a specific style give it a class. You could do something like this
CSS:
```
button.something {
padding: 25px;
border-radius: 100%;
font-size: 20px;
border: none;
}
```
HTML:
```
... |
39,421,292 | I keep getting this message when I try to compile:
```none
task.c++:54:102: error: invalid use of non-static member function
this->createTask(&otherTask, this->otherMain, mainTask.regs.eflags, (uint32_t*)mainTask.regs.cr3);
```
Here is my task.c++ function:
```
#include "task.h"
static task_q *runningTask;
s... | 2016/09/10 | [
"https://Stackoverflow.com/questions/39421292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5768335/"
] | First off:
A `<div>` is a block element by nature. It will always become 100% wide. If you want it to not be 100% wide, give it a `display:inline-block` so it won't get bigger than it needs to be. Then give it a `margin:0 auto;` or a `text-align:center` on the parent to center it.
HOWEVER, You are *not allowed to put ... | For clean and valid code, you'd better use a :before or :after pseudo-element. This would also take care of the centering by default.
It's even easy to set the content. Either in css only, like this:
1.
`button:before {content:"\25b6";}`
(put your unicode value there and classes/ids as needed, then specify them in... |
39,421,292 | I keep getting this message when I try to compile:
```none
task.c++:54:102: error: invalid use of non-static member function
this->createTask(&otherTask, this->otherMain, mainTask.regs.eflags, (uint32_t*)mainTask.regs.cr3);
```
Here is my task.c++ function:
```
#include "task.h"
static task_q *runningTask;
s... | 2016/09/10 | [
"https://Stackoverflow.com/questions/39421292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5768335/"
] | First off:
A `<div>` is a block element by nature. It will always become 100% wide. If you want it to not be 100% wide, give it a `display:inline-block` so it won't get bigger than it needs to be. Then give it a `margin:0 auto;` or a `text-align:center` on the parent to center it.
HOWEVER, You are *not allowed to put ... | Before answering, let's clear some things out.
`div` is a block level element, used in an inline element, which is the `button` element. **Browsers will consider this invalid and will fix it by removing the block element from the inline element**. For more about CSS concepts like *box model*, *box generation* please r... |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | ```
# Use: array.slice!(range)
a = [0,2,8,2,4,5,]
a.slice!(1..2)
a # => [0, 2, 4, 5]
```
Or for indices range 3 to 4
```
a.slice!(3..4)
a # => [0, 2, 8, 5]
``` | ```
class Array
def remove_range(f,l)
self[0..f-1].concat(self[l+1..-1])
end
end
a = [0,2,8,2,4,5]
b = a.remove_range(1,2)
[0, 2, 4, 5]
c = a.remove_range(3,4)
[0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | You can do some cool tricks with the Enumerable module:
```
a = [0, 2, 8, 2, 4, 5]
r = 1..2
a.reject.with_index { |v, i| r.include?(i) } # => [0, 2, 4, 5]
```
Note that this does not modify the original array, but returns a new one. You can use `reject!` if you want to modify the array. | ```
a = [0,2,8,2,4,5]
j = 1
(3..4).each do |i|
j == 1 ? a.delete_at(i) : a.delete_at(i-1)
j += 1
end
b = a
[0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | ```
# Use: array.slice!(range)
a = [0,2,8,2,4,5,]
a.slice!(1..2)
a # => [0, 2, 4, 5]
```
Or for indices range 3 to 4
```
a.slice!(3..4)
a # => [0, 2, 8, 5]
``` | ```
class Array
def remove_range(sp, ep)
raise ArgumentError if sp < 0 || ep > size - 1
slice(0...sp).concat(slice(ep+1..-1))
end
end
```
Thank Cary Swoveland for his good advise |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | You can do some cool tricks with the Enumerable module:
```
a = [0, 2, 8, 2, 4, 5]
r = 1..2
a.reject.with_index { |v, i| r.include?(i) } # => [0, 2, 4, 5]
```
Note that this does not modify the original array, but returns a new one. You can use `reject!` if you want to modify the array. | ```
class Array
def remove_range(f,l)
self[0..f-1].concat(self[l+1..-1])
end
end
a = [0,2,8,2,4,5]
b = a.remove_range(1,2)
[0, 2, 4, 5]
c = a.remove_range(3,4)
[0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | ```
# Use: array.slice!(range)
a = [0,2,8,2,4,5,]
a.slice!(1..2)
a # => [0, 2, 4, 5]
```
Or for indices range 3 to 4
```
a.slice!(3..4)
a # => [0, 2, 8, 5]
``` | This is built into the array class. Just subtract the piece that you don't want:
```
2.0.0-p353 :001 > ar = [0,2,8,2,4,5]
=> [0, 2, 8, 2, 4, 5]
2.0.0-p353 :002 > ar - ar[2..3]
=> [0, 4, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | ```
# Use: array.slice!(range)
a = [0,2,8,2,4,5,]
a.slice!(1..2)
a # => [0, 2, 4, 5]
```
Or for indices range 3 to 4
```
a.slice!(3..4)
a # => [0, 2, 8, 5]
``` | Tried something funky with string manipulation. I think it's O(4\*M) though if that's even a thing!
```
a.join.gsub(/#{a.join[1..2]}/,'').split('').map{|i| i.to_i}
=> [0, 2, 4, 5]
a.join.gsub(/#{a.join[3..4]}/,'').split('').map{|i| i.to_i}
=> [0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | This is built into the array class. Just subtract the piece that you don't want:
```
2.0.0-p353 :001 > ar = [0,2,8,2,4,5]
=> [0, 2, 8, 2, 4, 5]
2.0.0-p353 :002 > ar - ar[2..3]
=> [0, 4, 5]
``` | Tried something funky with string manipulation. I think it's O(4\*M) though if that's even a thing!
```
a.join.gsub(/#{a.join[1..2]}/,'').split('').map{|i| i.to_i}
=> [0, 2, 4, 5]
a.join.gsub(/#{a.join[3..4]}/,'').split('').map{|i| i.to_i}
=> [0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | This is built into the array class. Just subtract the piece that you don't want:
```
2.0.0-p353 :001 > ar = [0,2,8,2,4,5]
=> [0, 2, 8, 2, 4, 5]
2.0.0-p353 :002 > ar - ar[2..3]
=> [0, 4, 5]
``` | ```
a = [0,2,8,2,4,5]
j = 1
(3..4).each do |i|
j == 1 ? a.delete_at(i) : a.delete_at(i-1)
j += 1
end
b = a
[0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | ```
# Use: array.slice!(range)
a = [0,2,8,2,4,5,]
a.slice!(1..2)
a # => [0, 2, 4, 5]
```
Or for indices range 3 to 4
```
a.slice!(3..4)
a # => [0, 2, 8, 5]
``` | ```
a = [0,2,8,2,4,5]
j = 1
(3..4).each do |i|
j == 1 ? a.delete_at(i) : a.delete_at(i-1)
j += 1
end
b = a
[0, 2, 8, 5]
``` |
30,180,474 | I'm trying to find something equivalent to `remove_range` (which does not exist of course) as shown below. Seems there is no easy way to implement this functionality.
```
a = [0,2,8,2,4,5,]
b = a.remove_range(1,2) #remove items between index 1 and 2 ,inclusively
#expect b == [0,2,4,5]
b = a.remove_range(3,4)
#expect b... | 2015/05/12 | [
"https://Stackoverflow.com/questions/30180474",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115722/"
] | You can do some cool tricks with the Enumerable module:
```
a = [0, 2, 8, 2, 4, 5]
r = 1..2
a.reject.with_index { |v, i| r.include?(i) } # => [0, 2, 4, 5]
```
Note that this does not modify the original array, but returns a new one. You can use `reject!` if you want to modify the array. | ```
class Array
def remove_range(sp, ep)
raise ArgumentError if sp < 0 || ep > size - 1
slice(0...sp).concat(slice(ep+1..-1))
end
end
```
Thank Cary Swoveland for his good advise |
27,400,378 | I'm trying to understand if there is any difference between:
```
bool String_Init(String *str, char * s, uint32_t len){};
```
and
```
bool String_Init(String *str, char *s, uint32_t len){};
```
Also,
```
const char * String_GetCString(const String * const str){};
```
and
```
const char *String_GetCString(cons... | 2014/12/10 | [
"https://Stackoverflow.com/questions/27400378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3571571/"
] | As explained in more detail [here](http://en.wikipedia.org/wiki/C_data_types), for any type `T`, the expression `T*` means 'pointer to `T`'. It does not matter whether the asterisk is put to the argument name in the function name or to the type name for which the pointer type is referred to. The argument declarations `... | There is no differecne in the code pairs you've shown. They are same.
* `char *s`
* `char * s`
* `char* s`
all are same. *Most of the time* **extra** whitespace(s) is(are) ignored in `c`.
To clear your confusion, in case of
```
char *s
```
the `*` should be *read* as a part of the data type, it is not a part of ... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | For those who are migrating from Windows XP (yes, I know this is 2012) you can find these files in:
```
C:\Documents and Settings\[User Name]\Application Data\Notepad++\
``` | I just did this.
Had to copy both folders below to get everything
```
C:\Program Files (x86)\Notepad++
C:\Users\"User_name"\AppData\Roaming\Notepad++
``` |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | For those who are migrating from Windows XP (yes, I know this is 2012) you can find these files in:
```
C:\Documents and Settings\[User Name]\Application Data\Notepad++\
``` | About specific points:
* To save/restore the changed made through Style Configurator:
If you modify the default theme, then the changes are saved in `%APPDATA%\Notepad++\stylers.xml`, if you changed another theme (like choco), then the changes ares saved in `%APPDATA%\Notepad++\themes\choco.xml`
You will also find th... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | I found the configuration files under
`%appdata%\Notepad++`. | About specific points:
* To save/restore the changed made through Style Configurator:
If you modify the default theme, then the changes are saved in `%APPDATA%\Notepad++\stylers.xml`, if you changed another theme (like choco), then the changes ares saved in `%APPDATA%\Notepad++\themes\choco.xml`
You will also find th... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | I found the configuration files under
`%appdata%\Notepad++`. | You have already found the full list of Notepad++'s configuration files. If I were you, first I would copy the whole Notepad++ folder under the `Program Files`, and save it for some time. Then I'd start to use all the files listed on the [NPP page](http://docs.notepad-plus-plus.org/index.php/Configuration_Files), and a... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | I found the configuration files under
`%appdata%\Notepad++`. | For those who are migrating from Windows XP (yes, I know this is 2012) you can find these files in:
```
C:\Documents and Settings\[User Name]\Application Data\Notepad++\
``` |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | You have already found the full list of Notepad++'s configuration files. If I were you, first I would copy the whole Notepad++ folder under the `Program Files`, and save it for some time. Then I'd start to use all the files listed on the [NPP page](http://docs.notepad-plus-plus.org/index.php/Configuration_Files), and a... | About specific points:
* To save/restore the changed made through Style Configurator:
If you modify the default theme, then the changes are saved in `%APPDATA%\Notepad++\stylers.xml`, if you changed another theme (like choco), then the changes ares saved in `%APPDATA%\Notepad++\themes\choco.xml`
You will also find th... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | Many settings in NP++ can be automatically kept in sync (and migrated) between multiple instances by using **Settings** > **Preferences** > **Cloud**
[](https://i.stack.imgur.com/Dh4n8.png)
The first time you set a cloud location (which can just be any folder... | You have already found the full list of Notepad++'s configuration files. If I were you, first I would copy the whole Notepad++ folder under the `Program Files`, and save it for some time. Then I'd start to use all the files listed on the [NPP page](http://docs.notepad-plus-plus.org/index.php/Configuration_Files), and a... |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | Many settings in NP++ can be automatically kept in sync (and migrated) between multiple instances by using **Settings** > **Preferences** > **Cloud**
[](https://i.stack.imgur.com/Dh4n8.png)
The first time you set a cloud location (which can just be any folder... | I just did this.
Had to copy both folders below to get everything
```
C:\Program Files (x86)\Notepad++
C:\Users\"User_name"\AppData\Roaming\Notepad++
``` |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | Many settings in NP++ can be automatically kept in sync (and migrated) between multiple instances by using **Settings** > **Preferences** > **Cloud**
[](https://i.stack.imgur.com/Dh4n8.png)
The first time you set a cloud location (which can just be any folder... | For those who are migrating from Windows XP (yes, I know this is 2012) you can find these files in:
```
C:\Documents and Settings\[User Name]\Application Data\Notepad++\
``` |
137,481 | I am trying to portabilize every program I use if possible, and Notepad++ is on the list. The only problem is that I've had a native installation until now so that I'm not totally sure which settings files need to be moved to the portable directory.
Surely there's a function tucked away somewhere in NPP exactly for th... | 2010/05/04 | [
"https://superuser.com/questions/137481",
"https://superuser.com",
"https://superuser.com/users/16582/"
] | You have already found the full list of Notepad++'s configuration files. If I were you, first I would copy the whole Notepad++ folder under the `Program Files`, and save it for some time. Then I'd start to use all the files listed on the [NPP page](http://docs.notepad-plus-plus.org/index.php/Configuration_Files), and a... | I just did this.
Had to copy both folders below to get everything
```
C:\Program Files (x86)\Notepad++
C:\Users\"User_name"\AppData\Roaming\Notepad++
``` |
4,578,476 | I learned that Server application makes a ServerSocket in a specific port,
```
ServerSocket ServerSock=new ServerSocket(9000);
```
and client makes a socket connection to the server application,
```
Socket sock=new Socket("127.0.0.1","9000");
```
So client knows the Ip address and port of the server, I'm confused... | 2011/01/02 | [
"https://Stackoverflow.com/questions/4578476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538636/"
] | The server accepts the client with `ServerSock.accept()`. [Here](http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html) is a tutorial. | Well, the client knows the IP and port of the server to connect.
The client then tries to connect with the server.
For this, an ephimeral port will be assigned to the client process so that if the request connection is accepted by the TCP layer of the server's (server is listening and trying to accept connections... |
4,578,476 | I learned that Server application makes a ServerSocket in a specific port,
```
ServerSocket ServerSock=new ServerSocket(9000);
```
and client makes a socket connection to the server application,
```
Socket sock=new Socket("127.0.0.1","9000");
```
So client knows the Ip address and port of the server, I'm confused... | 2011/01/02 | [
"https://Stackoverflow.com/questions/4578476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538636/"
] | The Server is 'listening' for incoming connections from clients. Just imagine the port number as being the door number and the server is waiting at that door for guests.
So when the server application does serverSock.accept() it in fact blocks and waits for clients to arrive.
Once a client tries to connect, the [acc... | The server accepts the client with `ServerSock.accept()`. [Here](http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html) is a tutorial. |
4,578,476 | I learned that Server application makes a ServerSocket in a specific port,
```
ServerSocket ServerSock=new ServerSocket(9000);
```
and client makes a socket connection to the server application,
```
Socket sock=new Socket("127.0.0.1","9000");
```
So client knows the Ip address and port of the server, I'm confused... | 2011/01/02 | [
"https://Stackoverflow.com/questions/4578476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/538636/"
] | The Server is 'listening' for incoming connections from clients. Just imagine the port number as being the door number and the server is waiting at that door for guests.
So when the server application does serverSock.accept() it in fact blocks and waits for clients to arrive.
Once a client tries to connect, the [acc... | Well, the client knows the IP and port of the server to connect.
The client then tries to connect with the server.
For this, an ephimeral port will be assigned to the client process so that if the request connection is accepted by the TCP layer of the server's (server is listening and trying to accept connections... |
32,935,343 | I got confused by the following perfect forwarding function, where the template parameter `T` can match rvalue or lvalue references:
```
template<typename T>
void foo(T&& t){
T::A; // intended error to inspect type
}
int main(){
std::vector<int> a;
std::vector<int> && b = std::move(a);
foo(b); ... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32935343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293195/"
] | There is a special type deduction rule when && is used with templates.
```
template <class T>
void func(T&& t) {
}
```
>
> "When && appears in a type-deducing context, T&& acquires a special
> meaning. When func is instantiated, T depends on whether the argument
> passed to func is an lvalue or an rvalue. If it's... | If you think about the signature of your function, the type of the parameter is `T&&`. In your second example, `T` is deduced to `vector<int>`, that means that the type of the parameter to your function is `vector<int>&&`. So you are still passing by (rvalue) reference.
In the other case, you deduce `T` to `vector<int... |
32,935,343 | I got confused by the following perfect forwarding function, where the template parameter `T` can match rvalue or lvalue references:
```
template<typename T>
void foo(T&& t){
T::A; // intended error to inspect type
}
int main(){
std::vector<int> a;
std::vector<int> && b = std::move(a);
foo(b); ... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32935343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293195/"
] | There is a special type deduction rule when && is used with templates.
```
template <class T>
void func(T&& t) {
}
```
>
> "When && appears in a type-deducing context, T&& acquires a special
> meaning. When func is instantiated, T depends on whether the argument
> passed to func is an lvalue or an rvalue. If it's... | >
> Is that right that, `b` s type is a rvalue reference to `std::vector<int>`, but as far as my understanding goes, it has a name and is thus considered an lvalue in function main?
>
>
>
Yes, that's exactly it. It makes more sense if you think about rvalue reference function parameters: the caller is specifying t... |
32,935,343 | I got confused by the following perfect forwarding function, where the template parameter `T` can match rvalue or lvalue references:
```
template<typename T>
void foo(T&& t){
T::A; // intended error to inspect type
}
int main(){
std::vector<int> a;
std::vector<int> && b = std::move(a);
foo(b); ... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32935343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293195/"
] | There is a special type deduction rule when && is used with templates.
```
template <class T>
void func(T&& t) {
}
```
>
> "When && appears in a type-deducing context, T&& acquires a special
> meaning. When func is instantiated, T depends on whether the argument
> passed to func is an lvalue or an rvalue. If it's... | The *expressions* `a` and `b` are both lvalues, and the expression `std::move(a)` is an rvalue.
The deduction for the parameter `T` makes use of special reference collapsing rules so that the type of `t` is either an lvalue or an rvalue reference as needed to bind to the function call argument. |
32,935,343 | I got confused by the following perfect forwarding function, where the template parameter `T` can match rvalue or lvalue references:
```
template<typename T>
void foo(T&& t){
T::A; // intended error to inspect type
}
int main(){
std::vector<int> a;
std::vector<int> && b = std::move(a);
foo(b); ... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32935343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293195/"
] | If you think about the signature of your function, the type of the parameter is `T&&`. In your second example, `T` is deduced to `vector<int>`, that means that the type of the parameter to your function is `vector<int>&&`. So you are still passing by (rvalue) reference.
In the other case, you deduce `T` to `vector<int... | The *expressions* `a` and `b` are both lvalues, and the expression `std::move(a)` is an rvalue.
The deduction for the parameter `T` makes use of special reference collapsing rules so that the type of `t` is either an lvalue or an rvalue reference as needed to bind to the function call argument. |
32,935,343 | I got confused by the following perfect forwarding function, where the template parameter `T` can match rvalue or lvalue references:
```
template<typename T>
void foo(T&& t){
T::A; // intended error to inspect type
}
int main(){
std::vector<int> a;
std::vector<int> && b = std::move(a);
foo(b); ... | 2015/10/04 | [
"https://Stackoverflow.com/questions/32935343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293195/"
] | >
> Is that right that, `b` s type is a rvalue reference to `std::vector<int>`, but as far as my understanding goes, it has a name and is thus considered an lvalue in function main?
>
>
>
Yes, that's exactly it. It makes more sense if you think about rvalue reference function parameters: the caller is specifying t... | The *expressions* `a` and `b` are both lvalues, and the expression `std::move(a)` is an rvalue.
The deduction for the parameter `T` makes use of special reference collapsing rules so that the type of `t` is either an lvalue or an rvalue reference as needed to bind to the function call argument. |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | Add a conditional:
```
if (!isset($_SESSION["var"]) {
$_SESSION["var"] = 0;
}
```
This will only initialize the session only if it hasn't been initialized before. | Here you go: If your variable is empty, it will initialize it with zero, else it will remain the same ;-)
```
<?php
if(!$_SESSION['var'])
$_SESSION['var'] = 0;
?>
``` |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | Add a conditional:
```
if (!isset($_SESSION["var"]) {
$_SESSION["var"] = 0;
}
```
This will only initialize the session only if it hasn't been initialized before. | You can use this check,
```
if(session_id()=="")
{
session_start();
$_SESSION['var']=0;
}
```
this will only execute if session is not found. |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | Add a conditional:
```
if (!isset($_SESSION["var"]) {
$_SESSION["var"] = 0;
}
```
This will only initialize the session only if it hasn't been initialized before. | In PHP versions 5.4\* and later, this is the most efficient way to see if session is already started or not.
```
if(session_status() !== PHP_SESSION_ACTIVE)
{
// session is not started yet
session_start();
}
``` |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | Add a conditional:
```
if (!isset($_SESSION["var"]) {
$_SESSION["var"] = 0;
}
```
This will only initialize the session only if it hasn't been initialized before. | if you want to develop this further, you could use the serialize functions to convert it into something you can store, in a cookie perhaps, or a file, or a database..
the serialize function converts the array into a string that can be stored. Sort of looks like json.
If you got any more questions, is there a way to n... |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | is weloome the correct name? is that a typo? | Here you go: If your variable is empty, it will initialize it with zero, else it will remain the same ;-)
```
<?php
if(!$_SESSION['var'])
$_SESSION['var'] = 0;
?>
``` |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | is weloome the correct name? is that a typo? | You can use this check,
```
if(session_id()=="")
{
session_start();
$_SESSION['var']=0;
}
```
this will only execute if session is not found. |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | is weloome the correct name? is that a typo? | In PHP versions 5.4\* and later, this is the most efficient way to see if session is already started or not.
```
if(session_status() !== PHP_SESSION_ACTIVE)
{
// session is not started yet
session_start();
}
``` |
29,823,873 | There are about 1700 articles listed on my website created using ASP.NET 4.0 Web Forms. These articles have a url format as:
```
http://www.mymymyarticles.com/Article.aspx?ID=400
```
I have explored ASP.NET Friendly URLs as well IIS URL Rewrite. These extensions are great but once a rule is created, they treat all ... | 2015/04/23 | [
"https://Stackoverflow.com/questions/29823873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/102041/"
] | is weloome the correct name? is that a typo? | if you want to develop this further, you could use the serialize functions to convert it into something you can store, in a cookie perhaps, or a file, or a database..
the serialize function converts the array into a string that can be stored. Sort of looks like json.
If you got any more questions, is there a way to n... |
4,431 | Way back when, I used to work in finance, and I remember helping a coworker use some kind of block bootstrap. (I believe the application was: we had weekly data on some financial indicator X, along with weekly data on some stock, and we wanted to measure how well X could be used to predict the stock's movements. And I ... | 2010/11/11 | [
"https://stats.stackexchange.com/questions/4431",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1106/"
] | Try the [Handbook of Computational Statistics, Part III, section 2.4](http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/csa/node132.html). | The textbook by [Shumway and Stoffer](http://rads.stackoverflow.com/amzn/click/0387293175) has a short section on bootstrapping time series (state-space) models. Also you may look to:
Pfeffermann, D. and Tiller, R. (2005) Bootstrap approximation to prediction MSE for State-Space models with estimated parameters, *Jour... |
4,431 | Way back when, I used to work in finance, and I remember helping a coworker use some kind of block bootstrap. (I believe the application was: we had weekly data on some financial indicator X, along with weekly data on some stock, and we wanted to measure how well X could be used to predict the stock's movements. And I ... | 2010/11/11 | [
"https://stats.stackexchange.com/questions/4431",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1106/"
] | I have relied on [Resampling Methods for Dependent Data](http://books.google.com/books?id=e4f8sqm439UC&printsec=frontcover&dq=resampling+methods+for+dependent+data&source=bl&ots=hwangs1qCA&sig=WzmEiF0W2sRXlSm5MTvK6ESkt7k&hl=en&ei=_pPdTJnWIcGYnwfaqpCzDw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&... | Try the [Handbook of Computational Statistics, Part III, section 2.4](http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/csa/node132.html). |
4,431 | Way back when, I used to work in finance, and I remember helping a coworker use some kind of block bootstrap. (I believe the application was: we had weekly data on some financial indicator X, along with weekly data on some stock, and we wanted to measure how well X could be used to predict the stock's movements. And I ... | 2010/11/11 | [
"https://stats.stackexchange.com/questions/4431",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1106/"
] | Try the [Handbook of Computational Statistics, Part III, section 2.4](http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/csa/node132.html). | For an evaluation of its effectiveness and a comparison to alternative methods, see:
Bertrand, Marianne, Esther Duflo and Sendhil Mullainathan. 2004. "How Much Should we Trust Difference-in-Difference Estimates?" *Quarterly Journal of Economics*. 119 (1): 249-275. [[pre-publication version](http://economics.mit.edu/f... |
4,431 | Way back when, I used to work in finance, and I remember helping a coworker use some kind of block bootstrap. (I believe the application was: we had weekly data on some financial indicator X, along with weekly data on some stock, and we wanted to measure how well X could be used to predict the stock's movements. And I ... | 2010/11/11 | [
"https://stats.stackexchange.com/questions/4431",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1106/"
] | I have relied on [Resampling Methods for Dependent Data](http://books.google.com/books?id=e4f8sqm439UC&printsec=frontcover&dq=resampling+methods+for+dependent+data&source=bl&ots=hwangs1qCA&sig=WzmEiF0W2sRXlSm5MTvK6ESkt7k&hl=en&ei=_pPdTJnWIcGYnwfaqpCzDw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&... | The textbook by [Shumway and Stoffer](http://rads.stackoverflow.com/amzn/click/0387293175) has a short section on bootstrapping time series (state-space) models. Also you may look to:
Pfeffermann, D. and Tiller, R. (2005) Bootstrap approximation to prediction MSE for State-Space models with estimated parameters, *Jour... |
4,431 | Way back when, I used to work in finance, and I remember helping a coworker use some kind of block bootstrap. (I believe the application was: we had weekly data on some financial indicator X, along with weekly data on some stock, and we wanted to measure how well X could be used to predict the stock's movements. And I ... | 2010/11/11 | [
"https://stats.stackexchange.com/questions/4431",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/1106/"
] | I have relied on [Resampling Methods for Dependent Data](http://books.google.com/books?id=e4f8sqm439UC&printsec=frontcover&dq=resampling+methods+for+dependent+data&source=bl&ots=hwangs1qCA&sig=WzmEiF0W2sRXlSm5MTvK6ESkt7k&hl=en&ei=_pPdTJnWIcGYnwfaqpCzDw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&... | For an evaluation of its effectiveness and a comparison to alternative methods, see:
Bertrand, Marianne, Esther Duflo and Sendhil Mullainathan. 2004. "How Much Should we Trust Difference-in-Difference Estimates?" *Quarterly Journal of Economics*. 119 (1): 249-275. [[pre-publication version](http://economics.mit.edu/f... |
16,265,356 | I'm using Magento (1.7) and I've just extended my old store (store1) with store2 by multi-store. I've a lot of products (about 1500) and they all are visible in Store1 but not in the new store (store2). Is there a easy way to enable all products for alle stores? | 2013/04/28 | [
"https://Stackoverflow.com/questions/16265356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2127368/"
] | In the products grid in the admin, select all products with the 'select all' button. From the 'actions' dropdown menu; select 'Update Attributes'. In the 'Websites' tab; select the desired websites and click 'save'.
Next, reindex all data:
Go to: System > Index Management.
Select all items and start reindexing by s... | There are a couple of ways to do this. First, and easiest, is to use the mass edit feature in the admin. Go to your manage products page, click select all, change the action dropdown to say "Change Attributes" and click submit. Then, on the websites tab, make sure your new site is checked in the "Add Product to Website... |
626,877 | I have a 433.92 MHz gate opener remote that I would like to be able to control from my phone. In order to do this I have soldered a relay to one of its buttons, which I already have means to trigger through Home Assistant.
Sadly, the range isn't good enough to reliably reach the receiver. I have thought about somehow ... | 2022/07/10 | [
"https://electronics.stackexchange.com/questions/626877",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/206656/"
] | No.
You can build a *better antenna*, which would mostly mean that in exchance for needing to point more exactly, you can get a bit more gain in one direction.
But making a better antenna is harder than just adding some copper, which will destroy the matching / tuning of the antenna and almost certainly make it worse... | Form a quad antenna by adding passive reflector and/or director elements on the outside of the case. The physical dimensions of the case/PCB would need to be capable of providing appropriate separation between passive and driven elements. |
49,326,800 | I am using an SQLite db to populate a RecyclerView. I want to make the RecyclerView update real-time. But I am failing. I have tried using "notifyDataSetChanged()" but it doesn't work.
Can you please also tell me how can I refresh the RecyclerView by making a "new adapter".
Which one is better "notifyDataSetChanged(... | 2018/03/16 | [
"https://Stackoverflow.com/questions/49326800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9504498/"
] | This is one way. Output is a `numpy` array.
```
import pandas as pd
from io import StringIO
mystr = """5.98735973963 4.3453 1.09877345
6.21376876 5.78789 2.11255
1.232422567 0.009044 9.886778893
0.1213445 0.938763 8.9978444"""
# Replace below with pd.read_table('my_file.txt', header=N... | This is a way in pure python
```
file_path = "numbers.txt"
number = 1.232422567
number_str = str(number)
with open(file_path) as f:
for i, line in enumerate(f):
numbers = line.split()
if number_str in numbers:
print("{} is in line {}: {}".format(number_str, i, line))
break
... |
49,326,800 | I am using an SQLite db to populate a RecyclerView. I want to make the RecyclerView update real-time. But I am failing. I have tried using "notifyDataSetChanged()" but it doesn't work.
Can you please also tell me how can I refresh the RecyclerView by making a "new adapter".
Which one is better "notifyDataSetChanged(... | 2018/03/16 | [
"https://Stackoverflow.com/questions/49326800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9504498/"
] | This is one way. Output is a `numpy` array.
```
import pandas as pd
from io import StringIO
mystr = """5.98735973963 4.3453 1.09877345
6.21376876 5.78789 2.11255
1.232422567 0.009044 9.886778893
0.1213445 0.938763 8.9978444"""
# Replace below with pd.read_table('my_file.txt', header=N... | This you can achieve through `pandas` library in python. Here is the sample code for you.
```
import pandas as pd
data = pd.read_csv('filenane.txt', sep=" ", header=None)
data.columns = ["a", "b", "c"]
foundColmn = data[data['a']==1.232422567][['b','c']]
print(foundColmn)
``` |
49,326,800 | I am using an SQLite db to populate a RecyclerView. I want to make the RecyclerView update real-time. But I am failing. I have tried using "notifyDataSetChanged()" but it doesn't work.
Can you please also tell me how can I refresh the RecyclerView by making a "new adapter".
Which one is better "notifyDataSetChanged(... | 2018/03/16 | [
"https://Stackoverflow.com/questions/49326800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9504498/"
] | This is one way. Output is a `numpy` array.
```
import pandas as pd
from io import StringIO
mystr = """5.98735973963 4.3453 1.09877345
6.21376876 5.78789 2.11255
1.232422567 0.009044 9.886778893
0.1213445 0.938763 8.9978444"""
# Replace below with pd.read_table('my_file.txt', header=N... | I see you are talking about `any function` instead of summation. You should call the components of the output array.
```
a=res[1] #the first row is 0
b=res[2]
```
Now you can use them in any function
`h= a+b`
***This solution is based on the chosen answer of this question.*** |
26,432,585 | I have a class which extends `View`, and inside that class, at a specific point, I want to display text with a small icon beside it.
To achieve this, I created an XML layout as shown below, and inside the class that extends `View` I define the layout so its contents appear on the screen, but the App crashes with a Nul... | 2014/10/17 | [
"https://Stackoverflow.com/questions/26432585",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1652954/"
] | Sounds like your view isn't inflating this layout. `this.findViewById` essentially searches through the layout that was inflated for `this` view.
You may need to add a line like the following to your constructor for the view (note: [inflate](http://developer.android.com/reference/android/view/View.html#inflate(android... | From where are you calling `showConfirmation()`? It's possible that you're calling it before the layout has been inflated.
When you initialize your view, inflate it from your XML and return a reference to the view:
>
> View view = inflate(getContext(), R.layout.layout\_id, null);
>
>
>
Then get a reference to yo... |
38,423,791 | I have QListWidget and there are strings there, when I select a string, I wanted to display the index number and text of that. But the problem is, if I select more than 1 items, it doesn't display all of the indexes. It displays only one.
```
from PyQt5.QtWidgets import *
import sys
class Pencere(QWidget):
def __... | 2016/07/17 | [
"https://Stackoverflow.com/questions/38423791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4302226/"
] | I solved it with this
```
def but(self):
x = self.listwidget.selectedItems()
for y in x:
print (y.text())
``` | You need to use QListWidget's `selectedItems()` function, which returns a list. `currentRow()` only returns a single integer, and is intended to be used only in single-selection instances.
Once you've got the list of QListWidgetItems, you can use the `text()` function on each item to retreive the text.
Getting the in... |
68,304 | I want to test a web application for [Directory Traversal](https://www.owasp.org/index.php/Path_Traversal) (DT) vulnerability.
I have gone through a lot of google pages but can't find a clear description. I've tried using `../.././../../etc/passwd` along with the URLS however not sure where I'm heading.
Please help... | 2014/09/26 | [
"https://security.stackexchange.com/questions/68304",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/55731/"
] | 1. Directory Traversal is an HTTP exploit which allows attackers to access restricted directories and execute commands outside of the web server's root directory.
I'll help you with an example on this.
2. In web applications with dynamic pages, input is usually received from browsers through GET or POST request metho... | A directory traversal vulnerability is a vulnerability easy found through automation, so it's better to just run whichever tool you want to find if a site is vulnerable.
However, if still you want to manual check whether or not a site is vulnerable, you need to identify a point where a file is loaded, i.e. `test.php?f... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | If you're considering C and even assembler, take a look at LLVM first: <http://llvm.org> | I would stick to that language that you use for generating that language. You can generate and compile Java code in Java, Python code in Python, C# in C#, and even Lisp in Lisp, etc.
But it is not clear whether such languages are sufficiently fast for you. For top speed I would choose to generate C++ and use GCC for c... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | It sounds like you're looking for LLVM. | I would stick to that language that you use for generating that language. You can generate and compile Java code in Java, Python code in Python, C# in C#, and even Lisp in Lisp, etc.
But it is not clear whether such languages are sufficiently fast for you. For top speed I would choose to generate C++ and use GCC for c... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | It sounds like you're looking for LLVM. | Why not use something like SpiderMonkey or Rhino (JavaScript support in Java or C++). You can export your objects to JavaScript namespaces, and your users don't have to compile anything. |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | >
> I've considered possibly generating assembly language, in an effort to get off the compiler-version-treadmill, but assembly languages are all machine-specific.
>
>
>
That would be called a compiler :)
Why don't you stick to `C90`?
I haven't heard much of severe violations of standards from `gcc`'s side, if y... | I would stick to that language that you use for generating that language. You can generate and compile Java code in Java, Python code in Python, C# in C#, and even Lisp in Lisp, etc.
But it is not clear whether such languages are sufficiently fast for you. For top speed I would choose to generate C++ and use GCC for c... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | Start here: The [Code Generation conference](http://codegeneration.net/cg2014/) | In the spirit of "might not be to late to add my 2 cents" as in @Alvin's answer's case, here is something I'd think about: if your application is meant to last for some years, *it is going to face several changes in how applications and systems work*.
For instance, let's say you were thinking about this 10 years ago. ... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | It sounds like you're looking for LLVM. | Embed an interpreter for a language like [Lua](http://en.wikipedia.org/wiki/Lua_%28programming_language%29)/[Scheme](http://en.wikipedia.org/wiki/Scheme_%28programming_language%29) into your program, and generate code in that language. |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | Start here: The [Code Generation conference](http://codegeneration.net/cg2014/) | Embed an interpreter for a language like [Lua](http://en.wikipedia.org/wiki/Lua_%28programming_language%29)/[Scheme](http://en.wikipedia.org/wiki/Scheme_%28programming_language%29) into your program, and generate code in that language. |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | >
> I've considered possibly generating assembly language, in an effort to get off the compiler-version-treadmill, but assembly languages are all machine-specific.
>
>
>
That would be called a compiler :)
Why don't you stick to `C90`?
I haven't heard much of severe violations of standards from `gcc`'s side, if y... | Why not use something like SpiderMonkey or Rhino (JavaScript support in Java or C++). You can export your objects to JavaScript namespaces, and your users don't have to compile anything. |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | One option would be to use a language/environment that provides access to the compiler in code; For example, [here is a C# example](http://support.microsoft.com/kb/304655). | I would stick to that language that you use for generating that language. You can generate and compile Java code in Java, Python code in Python, C# in C#, and even Lisp in Lisp, etc.
But it is not clear whether such languages are sufficiently fast for you. For top speed I would choose to generate C++ and use GCC for c... |
587,059 | I've worked on a number of products that make use of code generation. It seems to be the only way to achieve both a high degree of user-customizability and high execution speed.
The downside is that we are requiring users to install a compiler (primarily on MS Windows).
This has been an on-going headache, because ve... | 2009/02/25 | [
"https://Stackoverflow.com/questions/587059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23771/"
] | Why not ship a GNU C compiler with your code generator? That way you have no version issues, and the client can constantly generate code that is usable. | I would stick to that language that you use for generating that language. You can generate and compile Java code in Java, Python code in Python, C# in C#, and even Lisp in Lisp, etc.
But it is not clear whether such languages are sufficiently fast for you. For top speed I would choose to generate C++ and use GCC for c... |
33,062,243 | I have some price codes, for example `BBAXV` and `GGZTR`, to convert to numbers, respectively `22300` and `44000`, according to these rules:
```
F > 1
B > 2
A > 3
G > 4
O > 5
J > 6
L > 7
C > 8
E > 9
Else > 0
```
I'm currently using VBA:
```vb
Function SubstituteMultiple(text As String, old_text A... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33062243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5432679/"
] | Any length (within reason)
```
=SUM(10^(LEN(A1)-ROW(INDIRECT("$1:$" & LEN(A1)))) *
IFERROR(SEARCH(MID(A1,ROW(INDIRECT("$1:$" & LEN(A1))),1),"FBAGOJLCE"),0))
```
Ctrl+Shift+Enter since it's an array formula. | If the price code is in cell A2, enter this formula in cell B2:
```
=SUMPRODUCT(IFERROR(SEARCH(MID(A2,{1,2,3,4,5},1),"fbagojlce"),0)*{10000,1000,100,10,1})
``` |
33,062,243 | I have some price codes, for example `BBAXV` and `GGZTR`, to convert to numbers, respectively `22300` and `44000`, according to these rules:
```
F > 1
B > 2
A > 3
G > 4
O > 5
J > 6
L > 7
C > 8
E > 9
Else > 0
```
I'm currently using VBA:
```vb
Function SubstituteMultiple(text As String, old_text A... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33062243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5432679/"
] | If the price code is in cell A2, enter this formula in cell B2:
```
=SUMPRODUCT(IFERROR(SEARCH(MID(A2,{1,2,3,4,5},1),"fbagojlce"),0)*{10000,1000,100,10,1})
``` | I guess not simpler, but at least an alternative. Text to Columns Fixed width to separate each character (ColumnsA:E). A formula for the transliteration:
```
=IF(A1="","",IFERROR(VLOOKUP(A1,Table,2,0),"0"))
```
in H1, copied across to L1 and down to suit, a table (named `Table`) for the conversion rules (P1:Q8) a... |
33,062,243 | I have some price codes, for example `BBAXV` and `GGZTR`, to convert to numbers, respectively `22300` and `44000`, according to these rules:
```
F > 1
B > 2
A > 3
G > 4
O > 5
J > 6
L > 7
C > 8
E > 9
Else > 0
```
I'm currently using VBA:
```vb
Function SubstituteMultiple(text As String, old_text A... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33062243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5432679/"
] | If the price code is in cell A2, enter this formula in cell B2:
```
=SUMPRODUCT(IFERROR(SEARCH(MID(A2,{1,2,3,4,5},1),"fbagojlce"),0)*{10000,1000,100,10,1})
``` | These two User Defined Function (aka UDF) roughly reverse the function provided by the answer in [this](https://stackoverflow.com/questions/32667180/convert-numeric-characters-to-alphabetic-characters/32667494#32667494).
```
Function alpha_to_num(str As String)
Dim c As Long, tmp As String, vRPL As Variant
vR... |
33,062,243 | I have some price codes, for example `BBAXV` and `GGZTR`, to convert to numbers, respectively `22300` and `44000`, according to these rules:
```
F > 1
B > 2
A > 3
G > 4
O > 5
J > 6
L > 7
C > 8
E > 9
Else > 0
```
I'm currently using VBA:
```vb
Function SubstituteMultiple(text As String, old_text A... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33062243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5432679/"
] | Any length (within reason)
```
=SUM(10^(LEN(A1)-ROW(INDIRECT("$1:$" & LEN(A1)))) *
IFERROR(SEARCH(MID(A1,ROW(INDIRECT("$1:$" & LEN(A1))),1),"FBAGOJLCE"),0))
```
Ctrl+Shift+Enter since it's an array formula. | I guess not simpler, but at least an alternative. Text to Columns Fixed width to separate each character (ColumnsA:E). A formula for the transliteration:
```
=IF(A1="","",IFERROR(VLOOKUP(A1,Table,2,0),"0"))
```
in H1, copied across to L1 and down to suit, a table (named `Table`) for the conversion rules (P1:Q8) a... |
33,062,243 | I have some price codes, for example `BBAXV` and `GGZTR`, to convert to numbers, respectively `22300` and `44000`, according to these rules:
```
F > 1
B > 2
A > 3
G > 4
O > 5
J > 6
L > 7
C > 8
E > 9
Else > 0
```
I'm currently using VBA:
```vb
Function SubstituteMultiple(text As String, old_text A... | 2015/10/11 | [
"https://Stackoverflow.com/questions/33062243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5432679/"
] | Any length (within reason)
```
=SUM(10^(LEN(A1)-ROW(INDIRECT("$1:$" & LEN(A1)))) *
IFERROR(SEARCH(MID(A1,ROW(INDIRECT("$1:$" & LEN(A1))),1),"FBAGOJLCE"),0))
```
Ctrl+Shift+Enter since it's an array formula. | These two User Defined Function (aka UDF) roughly reverse the function provided by the answer in [this](https://stackoverflow.com/questions/32667180/convert-numeric-characters-to-alphabetic-characters/32667494#32667494).
```
Function alpha_to_num(str As String)
Dim c As Long, tmp As String, vRPL As Variant
vR... |
17,639,469 | If I use the Empty template in Xcode, which just gives an app delegate and window, and I want to have a UITableView with navigation bar for drilling up and down, am I correct in assuming I should just do as below, create a UITableView subclass, instantiate it, then instantiate a navController, set the TableView as the ... | 2013/07/14 | [
"https://Stackoverflow.com/questions/17639469",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1784011/"
] | Add the styles to your myMapOptions
```
var myMapOptions = {
zoom: 16,
center: secheltLoc,
styles : styles,
disableDefaultUI: true,
scrollwheel: false
}
``` | The page that applies the style contains these lines that aren't present on the page that doesn't:
```
//Associate the styled map with the MapTypeId and set it to display.
theMap.mapTypes.set('map_style', styledMap);
theMap.setMapTypeId('map_style');
```
[working example](http://www.geocodezip.com/v3_SO_st... |
52,082,501 | I have a `data.frame` with two variables: `ID` and `Text`
I am using the following text analysis command that gives a `data.frame` output of 48 columns.
```
analysis <- textstat_readability(mydata$text, measure = c("all"), remove_hyphens = TRUE)
```
How can I add those 48 columns of results as separate columns in `... | 2018/08/29 | [
"https://Stackoverflow.com/questions/52082501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9802032/"
] | If you're wanting to pass the same data to multiple views within your application you could use [View Composers](https://laravel.com/docs/5.2/views#view-composers)
E.g. in the `boot()` method of your AppServiceProvider you would have something like:
```
public function boot()
{
view()->composer(['home', 'profile'... | Create a `BaseController`, and share data from there like so:
```
<?php
namespace App\Http\Controllers;
use View;
//You can create a BaseController:
class BaseController extends Controller {
public $dataVariable = "some data";
public function __construct() {
$anotherVariable = "more data";
... |
68,726,488 | I am new in Laravel. I include Header using @include('header'). but I want to hide profile menu when user is not register. How can I do ?
I use this to get data from table directly in blade.php
```
$array = App\Table::Select(users)->get();
``` | 2021/08/10 | [
"https://Stackoverflow.com/questions/68726488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16220656/"
] | You can use the [`Auth` facade](https://laravel.com/docs/8.x/authentication#determining-if-the-current-user-is-authenticated) to determine if the current user is logged in:
header.blade.php
```
@if(Illuminate\Support\Facades\Auth::check())
<!-- profile menu -->
@endif
```
##### Edit: You can use blade directive... | Simple use this
```
if(Auth::user())
include('header')
endif
``` |
68,726,488 | I am new in Laravel. I include Header using @include('header'). but I want to hide profile menu when user is not register. How can I do ?
I use this to get data from table directly in blade.php
```
$array = App\Table::Select(users)->get();
``` | 2021/08/10 | [
"https://Stackoverflow.com/questions/68726488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16220656/"
] | You can use `auth` facade for this.
`@auth // The user is authenticated... @endauth`
`@guest // The user is not authenticated... @endguest` | Simple use this
```
if(Auth::user())
include('header')
endif
``` |
52,980,779 | My question is if the check box is checked the value inserted inside the text box gives a square. If it is 3 inside the text box, after clicking on checkbox the result have to be 9 in text box.
**Kindly resolve it using JavaScript and HTML only.**
```js
function myfun() {
var a = document.getElementById("checke... | 2018/10/25 | [
"https://Stackoverflow.com/questions/52980779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10555320/"
] | You can use a unique constraint to prevent 2 columns being active at the same time but you will have to use True and None as the possible values rather than True and False. This is because the unique constraint will only allow a single True in the column but would also only allow a single False as well. None (or SQL NU... | So if i'm reading correctly you have two model classes `User` and `Credential` which is a one-to-many relationship:
```
class User(db.Model):
...
credentials = db.relationship('Credential')
class Credential(db.Model):
...
user_id = db.Column(db.Integer, db.ForeignKey('user.id', nullable=False)
```
I... |
14,412,354 | I'm having a select box which contains 17 values/options.
```
<select id="_class" name="_class">
<option value="0"></option>
<option value="1">PREKG</option>
<option value="2">LKG</option>
<option value="3">UKG</option>
<option value="4">I</option>
<option value="5">II</option>
<option val... | 2013/01/19 | [
"https://Stackoverflow.com/questions/14412354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972501/"
] | By iterating through the options incrementally, the indices of the options after an option that is removed will be reduced by one as soon as the option is removed (ie: removing the option at index 5 causes options 6 and above to now be indexed as options 5 and above).
To cater for this, reverse the order of the loop t... | Maybe a bit late, but I had the same issue. Here's my solution.
And thanks @steveukx, your explanation helped me out!
```
function remove(el) {
for(var i=el.length-1;i>=0;i--) {
if(el[i].selected)
el.remove(i);
}
};
``` |
14,412,354 | I'm having a select box which contains 17 values/options.
```
<select id="_class" name="_class">
<option value="0"></option>
<option value="1">PREKG</option>
<option value="2">LKG</option>
<option value="3">UKG</option>
<option value="4">I</option>
<option value="5">II</option>
<option val... | 2013/01/19 | [
"https://Stackoverflow.com/questions/14412354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972501/"
] | By iterating through the options incrementally, the indices of the options after an option that is removed will be reduced by one as soon as the option is removed (ie: removing the option at index 5 causes options 6 and above to now be indexed as options 5 and above).
To cater for this, reverse the order of the loop t... | Hi I faced the same problem. i am pasting my solution.
in fubbe answer these is some problem if user is trying to send higher index first and lower index subsequently ..thereby i am aorting the arguments passed to ensure that indexes (received through parameters) are sorted in ascending order first then our loop will b... |
14,412,354 | I'm having a select box which contains 17 values/options.
```
<select id="_class" name="_class">
<option value="0"></option>
<option value="1">PREKG</option>
<option value="2">LKG</option>
<option value="3">UKG</option>
<option value="4">I</option>
<option value="5">II</option>
<option val... | 2013/01/19 | [
"https://Stackoverflow.com/questions/14412354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972501/"
] | A simpler example: remove number 2 to 4 of a list of 6:
In this list, the digit represents the INDEX in the array:
* 1) one
* 2) two
* 3) three
* 4) four
* 5) five
* 6) six
now if I remove number 2, the rest of the items get a new index:
* 1) one
* 2) three
* 3) four
* 4) five
* 5) six
if I remove number 3 next, I ... | Maybe a bit late, but I had the same issue. Here's my solution.
And thanks @steveukx, your explanation helped me out!
```
function remove(el) {
for(var i=el.length-1;i>=0;i--) {
if(el[i].selected)
el.remove(i);
}
};
``` |
14,412,354 | I'm having a select box which contains 17 values/options.
```
<select id="_class" name="_class">
<option value="0"></option>
<option value="1">PREKG</option>
<option value="2">LKG</option>
<option value="3">UKG</option>
<option value="4">I</option>
<option value="5">II</option>
<option val... | 2013/01/19 | [
"https://Stackoverflow.com/questions/14412354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/972501/"
] | A simpler example: remove number 2 to 4 of a list of 6:
In this list, the digit represents the INDEX in the array:
* 1) one
* 2) two
* 3) three
* 4) four
* 5) five
* 6) six
now if I remove number 2, the rest of the items get a new index:
* 1) one
* 2) three
* 3) four
* 4) five
* 5) six
if I remove number 3 next, I ... | Hi I faced the same problem. i am pasting my solution.
in fubbe answer these is some problem if user is trying to send higher index first and lower index subsequently ..thereby i am aorting the arguments passed to ensure that indexes (received through parameters) are sorted in ascending order first then our loop will b... |
1,364,728 | I'm processing an XML document (an InstallAnywhere .iap\_xml installer) before handing it off to another tool (InstallAnywhere itself) to update some values. However, it appears that the XSLT transform I am using is stripping CDATA sections (which appear to be significant to InstallAnywhere) from the document.
I'm usi... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1364728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61716/"
] | To do this, you'll need to add a special case for empty `string` elements and use `disable-output-escaping`. I don't have a copy of Ant to test with, but the following template worked for me with `libxml`'s `xsltproc`, which exhibits the same behavior you describe:
```
<?xml version="1.0" encoding="UTF-8"?>
<xsl:style... | Once the XML parser has finished with the XML, there is absolutely no difference between `<![CDATA[abc]]>` and `abc`. And the same is true for an empty string - `<![CDATA[]]>` resolves to nothing at all, and is silently ignored. It has no representation in the XML model. In fact, there is no way to tell the difference ... |
1,364,728 | I'm processing an XML document (an InstallAnywhere .iap\_xml installer) before handing it off to another tool (InstallAnywhere itself) to update some values. However, it appears that the XSLT transform I am using is stripping CDATA sections (which appear to be significant to InstallAnywhere) from the document.
I'm usi... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1364728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61716/"
] | Found a solution:
```
<xsl:template match="string">
<xsl:element name="string">
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text><xsl:value-of select="text()" disable-output-escaping="yes" /><xsl:text disable-output-escaping="yes">]]></xsl:text>
</xsl:element>
</xsl:template>
```
I a... | Once the XML parser has finished with the XML, there is absolutely no difference between `<![CDATA[abc]]>` and `abc`. And the same is true for an empty string - `<![CDATA[]]>` resolves to nothing at all, and is silently ignored. It has no representation in the XML model. In fact, there is no way to tell the difference ... |
63,695,853 | Im using displayLog function in my vue methods to render logs (in foreach loop) I got from axios.
And i need to bind some handler to my dynamic content, for example changeThisNote.
How can i bind it to my dynamic inserted content?
If I code '@click="changeThisNote' Vue doesn't render it as I need.
Thanks.
```js
method... | 2020/09/01 | [
"https://Stackoverflow.com/questions/63695853",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693492/"
] | You shouldn't be building strings of HTML and inserting them into the DOM. That's missing out on some of the best features of Vue.
What you should do instead is use data to drive your template.
For example, store an array of *log* data in your component and render that in your template. When your Axios request comple... | the simplest way would be to create the html element like this:
```js
// ...
methods: {
displayLog (log) {
const div = document.createElement('div')
div.classList.add('note')
div.addEventListener('click', this.changeThisNote(log.id))
div.innerHTML = '<div class="note__date">' + date + space + name + '</... |
55,808,576 | I am creating an API's endpoint that creates a post:
```
POST > /posts
```
Each post can have up to one Category and multiple Tags.
When creating a post I need to reference its Category and Tags if any:
1. To reference the Category usually I send the CategoryId;
2. To reference the Tags usually I send Tags names b... | 2019/04/23 | [
"https://Stackoverflow.com/questions/55808576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577805/"
] | Let me try this [oulipo](https://en.wikipedia.org/wiki/Oulipo) challenge.
>
> Write an OPL models that works and that contains what you wrote.
>
>
>
Could this help?
```
float k=1.2;
dvar boolean y[1..1];
int parameter1=1;
int parameter2=2;
dvar boolean x;
dexpr float method[i in 1..10,j in 1..10]=x*(i+j);
subj... | If you are using a script in a `.mod` file, then you can define a function whithin an `execute` block [1]. These blocks define pre-processing or post-processing instructions written in ILOG Script [2]. Here's a trivial example from the documentation at <https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odm... |
38,866 | I am planning to buy a netvertible (tablet netbook hybrid) and install Ubuntu 11.04 on it, probably as a dual boot with the shipped OS.
The Asus transformer which was just released looks really nice. Is it possible to install Ubuntu on it? If so, what works (out of the box or through work-arounds), what doesn't? | 2011/05/01 | [
"https://askubuntu.com/questions/38866",
"https://askubuntu.com",
"https://askubuntu.com/users/2919/"
] | **Native Ubuntu:**
If native ubuntu works on your Asus Transformer depends on your model, as the transformer needs to be rootable with the nflash method. To find out check your serial number (next to the cable port)
* If your serial number B4O-B6O, it will work
* If your serial number is B70 it might work
* If your s... | personally, i havent tried it yet, but people at modaco ( android based forum ) discuss about it, you can check it
<http://android.modaco.com/content/asus-eee-pad-transformer-transformer-modaco-com/337267/some-kind-of-linux-ubuntu-on-the-transformer/#entry1670772>
and
<http://forum.xda-developers.com/showthread.php... |
38,866 | I am planning to buy a netvertible (tablet netbook hybrid) and install Ubuntu 11.04 on it, probably as a dual boot with the shipped OS.
The Asus transformer which was just released looks really nice. Is it possible to install Ubuntu on it? If so, what works (out of the box or through work-arounds), what doesn't? | 2011/05/01 | [
"https://askubuntu.com/questions/38866",
"https://askubuntu.com",
"https://askubuntu.com/users/2919/"
] | personally, i havent tried it yet, but people at modaco ( android based forum ) discuss about it, you can check it
<http://android.modaco.com/content/asus-eee-pad-transformer-transformer-modaco-com/337267/some-kind-of-linux-ubuntu-on-the-transformer/#entry1670772>
and
<http://forum.xda-developers.com/showthread.php... | **Ubuntu on Transformer is here.**
As reported by @Uli, thanks to **XDA dev** now is possible to running Ubuntu native on Asus eee pad transformer.
[Follow this step by step guide to install Ubuntu](http://forum.xda-developers.com/showthread.php?t=1163082) on micro sd card of your Transformer and boot it.
The guide ... |
38,866 | I am planning to buy a netvertible (tablet netbook hybrid) and install Ubuntu 11.04 on it, probably as a dual boot with the shipped OS.
The Asus transformer which was just released looks really nice. Is it possible to install Ubuntu on it? If so, what works (out of the box or through work-arounds), what doesn't? | 2011/05/01 | [
"https://askubuntu.com/questions/38866",
"https://askubuntu.com",
"https://askubuntu.com/users/2919/"
] | personally, i havent tried it yet, but people at modaco ( android based forum ) discuss about it, you can check it
<http://android.modaco.com/content/asus-eee-pad-transformer-transformer-modaco-com/337267/some-kind-of-linux-ubuntu-on-the-transformer/#entry1670772>
and
<http://forum.xda-developers.com/showthread.php... | Download the Ubuntu as mentioned above.
1) Flash.sh
```
# ./flash.sh
Nvflash started
rcm version 0X20001
System Information:
chip name: t20
chip id: 0x20 major: 1 minor: 3
chip sku: 0x8
chip uid: 0x033c20c143608197
macrovision: disabled
hdcp: enabled
sbk burned: true
dk burned: true
boot de... |
38,866 | I am planning to buy a netvertible (tablet netbook hybrid) and install Ubuntu 11.04 on it, probably as a dual boot with the shipped OS.
The Asus transformer which was just released looks really nice. Is it possible to install Ubuntu on it? If so, what works (out of the box or through work-arounds), what doesn't? | 2011/05/01 | [
"https://askubuntu.com/questions/38866",
"https://askubuntu.com",
"https://askubuntu.com/users/2919/"
] | **Native Ubuntu:**
If native ubuntu works on your Asus Transformer depends on your model, as the transformer needs to be rootable with the nflash method. To find out check your serial number (next to the cable port)
* If your serial number B4O-B6O, it will work
* If your serial number is B70 it might work
* If your s... | **Ubuntu on Transformer is here.**
As reported by @Uli, thanks to **XDA dev** now is possible to running Ubuntu native on Asus eee pad transformer.
[Follow this step by step guide to install Ubuntu](http://forum.xda-developers.com/showthread.php?t=1163082) on micro sd card of your Transformer and boot it.
The guide ... |
38,866 | I am planning to buy a netvertible (tablet netbook hybrid) and install Ubuntu 11.04 on it, probably as a dual boot with the shipped OS.
The Asus transformer which was just released looks really nice. Is it possible to install Ubuntu on it? If so, what works (out of the box or through work-arounds), what doesn't? | 2011/05/01 | [
"https://askubuntu.com/questions/38866",
"https://askubuntu.com",
"https://askubuntu.com/users/2919/"
] | **Native Ubuntu:**
If native ubuntu works on your Asus Transformer depends on your model, as the transformer needs to be rootable with the nflash method. To find out check your serial number (next to the cable port)
* If your serial number B4O-B6O, it will work
* If your serial number is B70 it might work
* If your s... | Download the Ubuntu as mentioned above.
1) Flash.sh
```
# ./flash.sh
Nvflash started
rcm version 0X20001
System Information:
chip name: t20
chip id: 0x20 major: 1 minor: 3
chip sku: 0x8
chip uid: 0x033c20c143608197
macrovision: disabled
hdcp: enabled
sbk burned: true
dk burned: true
boot de... |
59,032,833 | I am new to Javascript, and have been struggling to find a proper way to do what I'm looking for.
I have a heading "Page: Lastname Firstname"
What I want to do, is grab the last name ~only~
The last name will vary by length, and the page name will change as well but the format will always stay the same. | 2019/11/25 | [
"https://Stackoverflow.com/questions/59032833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6420144/"
] | ```
const pageTitle = 'Page: Lastname Firstname'
const lastName = pageTitle.split(' ')[1]
```
Basically we are splitting `pageTitle` string into Array, using as separator. And then we are accessing second `[1]` element of given Array. | Considering the format will remain like `Name: fname lname`. There is no middle name of something else. You can use `split()` by `' '` and get second element.
```js
let str = "Page: Lastname Firstname"
console.log(str.split(' ')[1])
``` |
32,617,952 | I am using `ctypes` to interface with a DLL written in C and I created an array with this:
```
foo = (c_double * 1000)()
bar = (c_double * 1000)()
```
I can get all the values with `foo[:]` and the type is:
```
type(foo)
c_double_array_1000
```
However I cannot subtract foo with bar:
```
unsupported operand ty... | 2015/09/16 | [
"https://Stackoverflow.com/questions/32617952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2612235/"
] | Here's a working example using JQuery **[contain](https://api.jquery.com/contains-selector/)** selector like following :
```js
$(function(){
var select_element = $('#guestdetails_country-menu');
select_element.find("li a:contains('Albania')").parent().insertBefore(select_element.find('li:eq(1)'));
});
```
```h... | Presuming you don't actually want that empty `LI` at the top, I would remove that, and just run:
```
var $select = $("#guestdetails_country-menu");
$select.prepend($select.find("li:has(a:contains('Albania'))"))
```
(prepend will work the same as insertBefore(el0), just a bit more concise) |
41,341,490 | Is it possible to use flexbox for this kind of patterns(see image attached) like
```
Box 1 height == (height of box 2 + height of box 3)
```
It is more like foundation equalizer, where change in height variation in either of the three boxes will adjust the boxes height and always look like the image[![enter image d... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41341490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1550778/"
] | You can divide this layout in 2 columns and in second columns you can have 2 rows or more if needed.
Following `HTML` structure for this kind of layout:
**HTML:**
```
<div class="row">
<div class="col box">
Column one content goes here...
</div>
<div class="col right-col">
<div class="box">
Box... | Yes, you can do it with Flex. Just place a outer **"DIV"** and provide it property
**HTML:**
```
<div class="row">
<div class="box-1">
1
</div>
<div class="box-2">
<div class="box-3">
2
</div>
<div class="box-4">
3
</div>
</div>
</div>
```
**CSS:**
```
.row{
disp... |
41,341,490 | Is it possible to use flexbox for this kind of patterns(see image attached) like
```
Box 1 height == (height of box 2 + height of box 3)
```
It is more like foundation equalizer, where change in height variation in either of the three boxes will adjust the boxes height and always look like the image[![enter image d... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41341490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1550778/"
] | You can basically create a *nested flexbox* - the `box 1` and the `box 2 & 3 wrapper` in a *row* flexbox and `box 2 & 3` in a *column* flexbox.
Note the usage of `flex: 1` specifically - this allows equal heights as you desire.
See demo below:
```css
.wrapper {
display: flex;
justify-content: space-between;
... | Yes, you can do it with Flex. Just place a outer **"DIV"** and provide it property
**HTML:**
```
<div class="row">
<div class="box-1">
1
</div>
<div class="box-2">
<div class="box-3">
2
</div>
<div class="box-4">
3
</div>
</div>
</div>
```
**CSS:**
```
.row{
disp... |
41,341,490 | Is it possible to use flexbox for this kind of patterns(see image attached) like
```
Box 1 height == (height of box 2 + height of box 3)
```
It is more like foundation equalizer, where change in height variation in either of the three boxes will adjust the boxes height and always look like the image[![enter image d... | 2016/12/27 | [
"https://Stackoverflow.com/questions/41341490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1550778/"
] | You can basically create a *nested flexbox* - the `box 1` and the `box 2 & 3 wrapper` in a *row* flexbox and `box 2 & 3` in a *column* flexbox.
Note the usage of `flex: 1` specifically - this allows equal heights as you desire.
See demo below:
```css
.wrapper {
display: flex;
justify-content: space-between;
... | You can divide this layout in 2 columns and in second columns you can have 2 rows or more if needed.
Following `HTML` structure for this kind of layout:
**HTML:**
```
<div class="row">
<div class="col box">
Column one content goes here...
</div>
<div class="col right-col">
<div class="box">
Box... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.