qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
6,473,628 | I currently have one .local address (Bonjour) pointing to my mac in my intranet, mbp.local, configured in system preferences with the computer name. I use this to send my boss links to demos on my local server (he sits in a chair behind me : >).
I'd like to be able to create new .local addresses to send different demo... | 2011/06/24 | [
"https://Stackoverflow.com/questions/6473628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/738861/"
] | You can’t change the response header from client code, it comes from the **server**.
(You can of course change your request headers (see the jQuery docs for `ajax`), but that's not going to help here).
If you also have control over what your server sends, then by all means update your post accordingly (i.e. give deta... | "Server response header" states for Server response header, not Client request header so YOU CAN'T CHANGE RESPONSE HEADER. You have to put it at the top of file you're retreiving from.
```
<?php
header("Access-Control-Allow-Origin: *");
``` |
6,473,628 | I currently have one .local address (Bonjour) pointing to my mac in my intranet, mbp.local, configured in system preferences with the computer name. I use this to send my boss links to demos on my local server (he sits in a chair behind me : >).
I'd like to be able to create new .local addresses to send different demo... | 2011/06/24 | [
"https://Stackoverflow.com/questions/6473628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/738861/"
] | "Server response header" states for Server response header, not Client request header so YOU CAN'T CHANGE RESPONSE HEADER. You have to put it at the top of file you're retreiving from.
```
<?php
header("Access-Control-Allow-Origin: *");
``` | Those headers are for organization websites to communicate with each other. In other words, you have to control all the servers involved. Providing those headers simply relaxes the same-domain restriction for sites with different domain names all owned by the same individual or organization. It does *not* provide a mec... |
6,473,628 | I currently have one .local address (Bonjour) pointing to my mac in my intranet, mbp.local, configured in system preferences with the computer name. I use this to send my boss links to demos on my local server (he sits in a chair behind me : >).
I'd like to be able to create new .local addresses to send different demo... | 2011/06/24 | [
"https://Stackoverflow.com/questions/6473628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/738861/"
] | You can’t change the response header from client code, it comes from the **server**.
(You can of course change your request headers (see the jQuery docs for `ajax`), but that's not going to help here).
If you also have control over what your server sends, then by all means update your post accordingly (i.e. give deta... | Those headers are for organization websites to communicate with each other. In other words, you have to control all the servers involved. Providing those headers simply relaxes the same-domain restriction for sites with different domain names all owned by the same individual or organization. It does *not* provide a mec... |
54,967,720 | What should be the correct *PySpark* Schema for the following list of tuples? I want to apply the schema on the following data:
```
[('a', 0.0), ('b', 6), ('c', 44), ('d', 107), ('e', 0), ('f', 3), ('g', 4), ('h', 0.025599999353289604), ('i', 0.03239999711513519), ('j', -0.03205680847167969), ('k', 0.10429033637046814... | 2019/03/03 | [
"https://Stackoverflow.com/questions/54967720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6301582/"
] | You could use an [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors#Syntax) `^=` to check if the href starts with `somelink.com`. Then you could replace the url :
```js
document.querySelectorAll('a[href^="somelink.com"]').forEach(
x => x.href = x.href.replace("somelink.com", "... | ```
Try adding class to the links and then use get element by class and replace the link
<a href="www.google.com" class="abc">my url</a>
var i=document.getElementByClass("abc");
for(let j=0;j<i.length;j++){
i[j].href='newUrl';
}
``` |
54,967,720 | What should be the correct *PySpark* Schema for the following list of tuples? I want to apply the schema on the following data:
```
[('a', 0.0), ('b', 6), ('c', 44), ('d', 107), ('e', 0), ('f', 3), ('g', 4), ('h', 0.025599999353289604), ('i', 0.03239999711513519), ('j', -0.03205680847167969), ('k', 0.10429033637046814... | 2019/03/03 | [
"https://Stackoverflow.com/questions/54967720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6301582/"
] | You could use an [attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors#Syntax) `^=` to check if the href starts with `somelink.com`. Then you could replace the url :
```js
document.querySelectorAll('a[href^="somelink.com"]').forEach(
x => x.href = x.href.replace("somelink.com", "... | For multiple items we can replace this way:
```
var a = document.querySelectorAll('.your_attr_class').forEach( (item)=>{
if(item.href.startsWith('http://somelink.com')){
item.href.replace('http://somelink.com','http://replacewith.com');
}
});
``` |
4,267,787 | This code (source: <http://www.doctrine-project.org/documentation/manual/1_0/hu/component-overview:connection:flushing-the-connection>)
```
$conn = Doctrine_Manager::connection();
$user1 = new User();
$user1->username = 'Jack';
$user2 = new User();
$user2->username = 'jwage';
$conn->flush();
```
is resulting 2 in... | 2010/11/24 | [
"https://Stackoverflow.com/questions/4267787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/177056/"
] | This post explains how to do it with Collections, as suggested by Michelangelo: [Doctrine - insert multiple rows with just one save()](https://stackoverflow.com/questions/5415725/doctrine-insert-multiple-rows-with-just-one-save) | Definatelly no this feature in v1, only v2. |
8,429,006 | I created a main window where the user will click if he's a system admin, an employee or a member a finance, one of my problem is that they are not centered in the screen, how would I do that? Second, I want it to work like, when I click the Finance Button, the Mainwindow Will close and it will bring me to my log in sc... | 2011/12/08 | [
"https://Stackoverflow.com/questions/8429006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/962206/"
] | I would recommend building your mobile application separately from your Cake app. Like you mentioned, I would go with building a RESTful web service to provide your data. I would recommend using JSON, but that's your decision.
Cake provides built in support for building RESTful web services, but you probably knew this... | There is also a framework which does a lot of work for you, it's specifically to integrate CakePHP with Sencha Touch <http://banchaproject.org> |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | I had the same problem and it was because the webpack version was not stable
I used the lower version and the problem was solved
>
> npm install webpack@4.32.2 --save-dev
>
>
>
>
> npm install webpack-cli@3.3.2 --save-dev
>
>
>
>
> npm install webpack-dev-server@3.5.1 --save-dev
>
>
> | Try the following. Its worked for me
"scripts": {
"lint": "eslint ./",
"build": "webpack",
"dev": "webpack serve"
}, |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | Try the following. Its worked for me
"scripts": {
"lint": "eslint ./",
"build": "webpack",
"dev": "webpack serve"
}, | in package.json
use "dev":"webpack serve" instead of "webpack-dev-server" |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | I had the same problem and it was because the webpack version was not stable
I used the lower version and the problem was solved
>
> npm install webpack@4.32.2 --save-dev
>
>
>
>
> npm install webpack-cli@3.3.2 --save-dev
>
>
>
>
> npm install webpack-dev-server@3.5.1 --save-dev
>
>
> | in package.json
use "dev":"webpack serve" instead of "webpack-dev-server" |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | If you have the error for the issues described here: <https://github.com/webpack/webpack-dev-server/issues/2029>
I wrote a python script to fix the problem until it's patched.
You can just add the command to your package.json script after adding the file to your project (assuming you have python installed).
<https:/... | in package.json
use "dev":"webpack serve" instead of "webpack-dev-server" |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | I had the same problem and it was because the webpack version was not stable
I used the lower version and the problem was solved
>
> npm install webpack@4.32.2 --save-dev
>
>
>
>
> npm install webpack-cli@3.3.2 --save-dev
>
>
>
>
> npm install webpack-dev-server@3.5.1 --save-dev
>
>
> | I think it's related to webpack version only. Can you please update the `webpack`, `webpack-cli` and `webpack-dev-server` with latest version and check it.
Hope this will work for you! |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | Try the following. Its worked for me
"scripts": {
"lint": "eslint ./",
"build": "webpack",
"dev": "webpack serve"
}, | Don't play with the webpack module for a while you are learning because it is tricky to do this stuff.
>
> I have the same problem that you listed before
>
>
>
```json
// change your mode to development in package.json
// make everything in devDependencies
{
"name": "timer",
"version": "1.0.0",
"description... |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | Try the following. Its worked for me
"scripts": {
"lint": "eslint ./",
"build": "webpack",
"dev": "webpack serve"
}, | I think it's related to webpack version only. Can you please update the `webpack`, `webpack-cli` and `webpack-dev-server` with latest version and check it.
Hope this will work for you! |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | I had the same problem, try `npm install --save-dev webpack webpack-cli webpack-dev-server webpack-merge` | Don't play with the webpack module for a while you are learning because it is tricky to do this stuff.
>
> I have the same problem that you listed before
>
>
>
```json
// change your mode to development in package.json
// make everything in devDependencies
{
"name": "timer",
"version": "1.0.0",
"description... |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | I had the same problem, try `npm install --save-dev webpack webpack-cli webpack-dev-server webpack-merge` | I think it's related to webpack version only. Can you please update the `webpack`, `webpack-cli` and `webpack-dev-server` with latest version and check it.
Hope this will work for you! |
57,724,011 | I've running `npm run dev` command to run my react app. BUT then it pops up this `Error: Cannot find module 'webpack/bin/config-yargs'`. I've googled this error. Many people who solve this error tell me to install webpack and webpack-cli. Therefore, I went to install webpack and webpack-cli. However, the error still po... | 2019/08/30 | [
"https://Stackoverflow.com/questions/57724011",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10449682/"
] | In your package.json file just change "dev": "webpack-dev-server" to "dev": "webpack serve" | If you have the error for the issues described here: <https://github.com/webpack/webpack-dev-server/issues/2029>
I wrote a python script to fix the problem until it's patched.
You can just add the command to your package.json script after adding the file to your project (assuming you have python installed).
<https:/... |
448,486 | >
> А художники Возрождения, как никакие другие художники, напитанные
> поисками духовного идеала, сумели каждый по-своему воспеть славу
> Господу, запечатлеть любовь и красоту этого мира.
>
>
>
ПыСы. Это наш общий приз, и Инга так считает.
>
> На церемонии награждения Премии «Бродский на Искье – Путешественни... | 2019/02/15 | [
"https://rus.stackexchange.com/questions/448486",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | *А художники Возрождения, как никакие другие художники, напитанные поисками духовного идеала, сумели каждый по-своему воспеть славу Господу, запечатлеть любовь и красоту этого мира*.
"Напитанные поисками" мне не нравится. Нужно бы поправить: томимые жаждой духовного идеала,
погружённые в поиски духовного идеала, захва... | А художники Возрождения, **как никто из художников, поглощенных поисками духовного идеала,** сумели каждый по-своему воспеть славу Господу, запечатлеть любовь и красоту этого мира.
В предложенном тесте не просматривается тесная связь выделенного фрагмента. |
448,486 | >
> А художники Возрождения, как никакие другие художники, напитанные
> поисками духовного идеала, сумели каждый по-своему воспеть славу
> Господу, запечатлеть любовь и красоту этого мира.
>
>
>
ПыСы. Это наш общий приз, и Инга так считает.
>
> На церемонии награждения Премии «Бродский на Искье – Путешественни... | 2019/02/15 | [
"https://rus.stackexchange.com/questions/448486",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | Мне нравится ответ Людмилы, но хочется добавить, что фраза "напитанные поисками духовного идеала" относится то ли к "художникам Возрождения", то ли "к другим художникам".
Поэтому во избежание недопонимания предложение, может быть, придётся перестроить.
*А [вдохновлённые?] поисками духовного идеала художники Возрожден... | А художники Возрождения, **как никто из художников, поглощенных поисками духовного идеала,** сумели каждый по-своему воспеть славу Господу, запечатлеть любовь и красоту этого мира.
В предложенном тесте не просматривается тесная связь выделенного фрагмента. |
448,486 | >
> А художники Возрождения, как никакие другие художники, напитанные
> поисками духовного идеала, сумели каждый по-своему воспеть славу
> Господу, запечатлеть любовь и красоту этого мира.
>
>
>
ПыСы. Это наш общий приз, и Инга так считает.
>
> На церемонии награждения Премии «Бродский на Искье – Путешественни... | 2019/02/15 | [
"https://rus.stackexchange.com/questions/448486",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | Я бы рекомендовал заменить "напитанные" на "влекомые".
Можно даже "одержимые".
И тогда, как мне кажется, предложение заиграет. | А художники Возрождения, **как никто из художников, поглощенных поисками духовного идеала,** сумели каждый по-своему воспеть славу Господу, запечатлеть любовь и красоту этого мира.
В предложенном тесте не просматривается тесная связь выделенного фрагмента. |
13,784,587 | I have a class `Test`:
```
class Test
attr_accessor :data
def initialize
@data = [0, 1, 2, 3]
end
def map
@data.map!{|i| i = yield i }
end
end
```
and I attempt to use it like:
```
a = Test.new
a.map{|i|
if(i==2)
i+=1
break i #<--- -This line is the focus
else
1
end
}
puts a.... | 2012/12/09 | [
"https://Stackoverflow.com/questions/13784587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636641/"
] | I'm assuming you're asking how to leave a block and make use of the last value that was calculated rather than how to calculate a specific set of numbers; for the latter, there is probably a clever one-liner.
How about something like this:
```
class Test
attr_accessor :data
def initialize
@data = [0, 1, 2, 3... | You have to do this:
```
a.map{ |i| (i % 2 == 0) ? i + 1 : i }
```
When you use map function you don't change 'a' variable, if you want change 'a' variable do this:
```
a.map!{ |i| (i % 2 == 0) ? i + 1 : i }
```
The new value of 'i' is the value return by the block, so don't do something like:
```
a.map{|i| i = ... |
13,784,587 | I have a class `Test`:
```
class Test
attr_accessor :data
def initialize
@data = [0, 1, 2, 3]
end
def map
@data.map!{|i| i = yield i }
end
end
```
and I attempt to use it like:
```
a = Test.new
a.map{|i|
if(i==2)
i+=1
break i #<--- -This line is the focus
else
1
end
}
puts a.... | 2012/12/09 | [
"https://Stackoverflow.com/questions/13784587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636641/"
] | In general, you could get away with this by modifying the yielded values in place. For example, if your array consisted of Strings instead of Fixnums:
```
class Test
attr_accessor :data
def initialize
@data = %w{a b c d}
end
def map
@data.map! { |i| yield i }
end
end
a = Test.new
a.map do |i|
if... | You have to do this:
```
a.map{ |i| (i % 2 == 0) ? i + 1 : i }
```
When you use map function you don't change 'a' variable, if you want change 'a' variable do this:
```
a.map!{ |i| (i % 2 == 0) ? i + 1 : i }
```
The new value of 'i' is the value return by the block, so don't do something like:
```
a.map{|i| i = ... |
13,784,587 | I have a class `Test`:
```
class Test
attr_accessor :data
def initialize
@data = [0, 1, 2, 3]
end
def map
@data.map!{|i| i = yield i }
end
end
```
and I attempt to use it like:
```
a = Test.new
a.map{|i|
if(i==2)
i+=1
break i #<--- -This line is the focus
else
1
end
}
puts a.... | 2012/12/09 | [
"https://Stackoverflow.com/questions/13784587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636641/"
] | I'm assuming you're asking how to leave a block and make use of the last value that was calculated rather than how to calculate a specific set of numbers; for the latter, there is probably a clever one-liner.
How about something like this:
```
class Test
attr_accessor :data
def initialize
@data = [0, 1, 2, 3... | In general, you could get away with this by modifying the yielded values in place. For example, if your array consisted of Strings instead of Fixnums:
```
class Test
attr_accessor :data
def initialize
@data = %w{a b c d}
end
def map
@data.map! { |i| yield i }
end
end
a = Test.new
a.map do |i|
if... |
72,936,279 | While using Eloquent: Relationships, I get this error: Undefined variable: country\_id.
```
<div>
<label for="country_id" class="form-label">country:</label>
@foreach ( $countries as $country )
<label for="country_id" class="form-label">
{{ $profiles->$country_id->$country->... | 2022/07/11 | [
"https://Stackoverflow.com/questions/72936279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19449655/"
] | You are reading the country completely wrong:
There is a foreach where you loop the countries. so `$country` holds the country model. simply output like this :
```
<div>
<label for="country_id" class="form-label">country:</label>
@foreach ( $countries as $country )
<label for="country_id" ... | I believe there an error with the dollar sign in the chained properties. Just remove the extra dollar signs.
This is the snippet with the wrong code fixed:
```
<div>
<label for="country_id" class="form-label">country:</label>
@foreach ( $countries as $country )
<label for="country_id" clas... |
63,912,553 | I am studying for a very basic / beginners Java exam, and when reviewing some example code, I noticed a couple that did not include the method: public static void main(String[] args)
How is this possible? Is there something I am missing?
Example of example code my professor uploaded without the method:
```
public cl... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63912553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14284892/"
] | The *public static void main(String[] args)* method is the entry point for a standard Java application. You need at least one class with this method if you want to run it from the command line. There are some special cases where you can build a JAR without such entrypoint if that JAR is a library or a package that will... | There always has to be a `main()` method somewhere. It isn't always in your own code. If you're using a Java framework, the `main()` might be in the framework code rather than your own code. You can also have multiple `main()` methods in your code, but only one will ever be used as the entrypoint to your program for a ... |
63,912,553 | I am studying for a very basic / beginners Java exam, and when reviewing some example code, I noticed a couple that did not include the method: public static void main(String[] args)
How is this possible? Is there something I am missing?
Example of example code my professor uploaded without the method:
```
public cl... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63912553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14284892/"
] | The *public static void main(String[] args)* method is the entry point for a standard Java application. You need at least one class with this method if you want to run it from the command line. There are some special cases where you can build a JAR without such entrypoint if that JAR is a library or a package that will... | If your're using Java 9+, you have an alternative from the main method which is JShell.
This an interactive tool which allows you to evaluate code in place using your terminal/cmd.
Also known as Read-Evaluate-Print Loop (REPL), evaluates declarations, statements, and expressions as they are entered and immediately sho... |
63,912,553 | I am studying for a very basic / beginners Java exam, and when reviewing some example code, I noticed a couple that did not include the method: public static void main(String[] args)
How is this possible? Is there something I am missing?
Example of example code my professor uploaded without the method:
```
public cl... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63912553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14284892/"
] | The *public static void main(String[] args)* method is the entry point for a standard Java application. You need at least one class with this method if you want to run it from the command line. There are some special cases where you can build a JAR without such entrypoint if that JAR is a library or a package that will... | **Trying to Cover Basic Concept :**
*1) A JAVA program contain any number of classes, but at most one class can be declared as public.*
*2) If there is public class, then the name of program and the name of the public class must be matched other-wise we get compile time error.*
*3) There is no relation of Main() met... |
20,824,604 | <http://jsfiddle.net/q98G6/>
**HTML**
```
<p>[QUESTION]</p>
<div class="answer-notdone">
<p>[CONTENT_1]</p>
</div
<div class="answer-notdone">
<p>[CONTENT_2]</p>
</div
<div class="answer-notdone">
<p>[CONTENT_3]</p>
</div
```
**JavaScript**
```
$(".answer-notdone").click(function(){
markQuestion(... | 2013/12/29 | [
"https://Stackoverflow.com/questions/20824604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979052/"
] | The selector is only used to find the elements, once the element is found and the event handler is attached to it, the selector does not have any relevance because the handlers are attached to the element not to the selector.
One way to solve the problem is to make use [event delegation](http://learn.jquery.com/events... | The selector returns all the elements that match it at the time you bind the handler, and then it attaches the handler to all those elements. Changing an element's class later does not remove the event handlers that were already bound.
If you want your handler to be bound to dynamically changing elements, you should u... |
20,824,604 | <http://jsfiddle.net/q98G6/>
**HTML**
```
<p>[QUESTION]</p>
<div class="answer-notdone">
<p>[CONTENT_1]</p>
</div
<div class="answer-notdone">
<p>[CONTENT_2]</p>
</div
<div class="answer-notdone">
<p>[CONTENT_3]</p>
</div
```
**JavaScript**
```
$(".answer-notdone").click(function(){
markQuestion(... | 2013/12/29 | [
"https://Stackoverflow.com/questions/20824604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/979052/"
] | The selector is only used to find the elements, once the element is found and the event handler is attached to it, the selector does not have any relevance because the handlers are attached to the element not to the selector.
One way to solve the problem is to make use [event delegation](http://learn.jquery.com/events... | Try this
```
$(document).on('click',".answer-notdone",function () {
//markQuestion(this);
$(".answer-notdone").addClass('answer-complete').removeClass('answer-notdone');
});
```
[**FIDDLE DEMO**](http://jsfiddle.net/q98G6/4/) |
14,132,068 | Suppose i want to have a composite key as street, city for purchase order entity.
Below is how i identify doing it,
```
@Embeddable
public class BillingAddress implements Serializable {
private String street;
private String city;
public BillingAddress(){
}
public Bi... | 2013/01/03 | [
"https://Stackoverflow.com/questions/14132068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1608306/"
] | There's are few question you asked, I tried to go through all of them and answer each one:
**What does @AnnotationOverride do?**
answer here: [What does @AttributeOverride mean?](https://stackoverflow.com/questions/4432748/what-does-attributeoverride-mean)
**The second question is a bit unclear to me but I presume y... | Well, your `PurchaseOrder` class does not extend from a mapped entity of any kind, and neither do the properties that you are (currently) applying the `@AttributeOverride`s to. So, there is nothing to actually override and your JPA provider is simply ignoring the annotations. What I think you are trying to do is define... |
28,682 | I want to download a slow-motion video playlist (with the frame rate of the videos being either 480 fps or 1000 fps.) and be able to speed up the videos at least 16x without losing the frame rate or sample rate. So, if anyone could help me with this I would really appreciate it!
Thanks! | 2019/10/15 | [
"https://avp.stackexchange.com/questions/28682",
"https://avp.stackexchange.com",
"https://avp.stackexchange.com/users/26531/"
] | This is sadly not possible.
You could theoretically have a video with effectivly 500 FPS, but that won't play on any device.
That's why cameras generally record to a project frame rate (Normaly 24, 25 or 30 FPS) and just stretch out the video. | This is a contradiction.
If you want to change the frame rate speeding up you have to change the frame rate.
You could try to playback a video at 16,000 fps... Why would you need to playback a video to 16,000 fps if no human or living being could notice the difference to let's say 120 fps?
You also need a monster of... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | Well, the exact magnitude of the economic impact would depend on the scale on which these portals would be built, and who would have access to them. The implications of these things are incredibly complex.
Parallel worlds are mostly very *similar* to ours. That means that the military could potentially test out politi... | What I found interesting about this question is that the number of connected worlds grows exponentially. The first world A, comes A **=** A when the first portal is created, and after they diverged AB **=** AC with the identical time lines A and divergent time lines B and C. With second gate AB=AC becomes AC=AB **=** A... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | **This is less useful than you think.**
You're describing parallelization of tasks to make everyone more efficient. However, most normal tasks (especially mental ones) are not that easily parallelized. If you were familiar with Gantt charts you'd know why this entire exercise will be fruitless.
For the case of your e... | Cold War dynamics and heavy regulation of incoming portals
==========================================================
I will focus on effects on governments because I think it is the most important question by far. In my view, a **zero-sum-game dynamics** would quickly unravel **unless you have a cheap way to block in... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | Who are you ... but actually
Do you and you twins from different worlds trust each other or commit massive identify theft? Then ask the question again for companies and countries.
We could see large scale power blocks as people ally with their twins to do great or terrible things. Who would you trust more than your e... | **Looking into the logic of the question as asked, and looking at the salient comments to it - I see only one outcome.**
The first time that one opens a portal to another parallel world - according to the rule that until a portal is opened, there is no divergence, thus, when a portal is opened to a world, the equivale... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | I think that your statement
>
> Given most of the worlds are so similar and the fact portals open to
> the same position in both worlds, it is obvious that most economic
> trade is pointless, because the worlds aren't sufficiently different.
>
>
>
is incorrect.
Consider two countries, on earth, with almost i... | Well, the exact magnitude of the economic impact would depend on the scale on which these portals would be built, and who would have access to them. The implications of these things are incredibly complex.
Parallel worlds are mostly very *similar* to ours. That means that the military could potentially test out politi... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | The types of uses of this technology fall into 3 classes:
1) Parallelization of Tasks
---------------------------
As people have pointed out earlier, while you can't do everything in parallel, there are a lot of cases where doubling your workers and resources more than doubles your production, thereby allowing you an... | Well, the exact magnitude of the economic impact would depend on the scale on which these portals would be built, and who would have access to them. The implications of these things are incredibly complex.
Parallel worlds are mostly very *similar* to ours. That means that the military could potentially test out politi... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | I think that your statement
>
> Given most of the worlds are so similar and the fact portals open to
> the same position in both worlds, it is obvious that most economic
> trade is pointless, because the worlds aren't sufficiently different.
>
>
>
is incorrect.
Consider two countries, on earth, with almost i... | Who are you ... but actually
Do you and you twins from different worlds trust each other or commit massive identify theft? Then ask the question again for companies and countries.
We could see large scale power blocks as people ally with their twins to do great or terrible things. Who would you trust more than your e... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | The types of uses of this technology fall into 3 classes:
1) Parallelization of Tasks
---------------------------
As people have pointed out earlier, while you can't do everything in parallel, there are a lot of cases where doubling your workers and resources more than doubles your production, thereby allowing you an... | Who are you ... but actually
Do you and you twins from different worlds trust each other or commit massive identify theft? Then ask the question again for companies and countries.
We could see large scale power blocks as people ally with their twins to do great or terrible things. Who would you trust more than your e... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | The types of uses of this technology fall into 3 classes:
1) Parallelization of Tasks
---------------------------
As people have pointed out earlier, while you can't do everything in parallel, there are a lot of cases where doubling your workers and resources more than doubles your production, thereby allowing you an... | **Looking into the logic of the question as asked, and looking at the salient comments to it - I see only one outcome.**
The first time that one opens a portal to another parallel world - according to the rule that until a portal is opened, there is no divergence, thus, when a portal is opened to a world, the equivale... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | **This is less useful than you think.**
You're describing parallelization of tasks to make everyone more efficient. However, most normal tasks (especially mental ones) are not that easily parallelized. If you were familiar with Gantt charts you'd know why this entire exercise will be fruitless.
For the case of your e... | Who are you ... but actually
Do you and you twins from different worlds trust each other or commit massive identify theft? Then ask the question again for companies and countries.
We could see large scale power blocks as people ally with their twins to do great or terrible things. Who would you trust more than your e... |
31,046 | **Portals to Parallel Earths**
------------------------------
**In this setting** events diverge when massive breakthroughs in physics are made. The breakthroughs effectively prove the many worlds interpretation, but more drastically they allow portals to be opened to parallel universes. Other advances are made becaus... | 2015/12/08 | [
"https://worldbuilding.stackexchange.com/questions/31046",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10139/"
] | I think that your statement
>
> Given most of the worlds are so similar and the fact portals open to
> the same position in both worlds, it is obvious that most economic
> trade is pointless, because the worlds aren't sufficiently different.
>
>
>
is incorrect.
Consider two countries, on earth, with almost i... | **Economics of scale, but not only for intangible goods**
* new interdimensional gate 130k dollar
* new microchip factory - ~2 bln dollar
* new Boeign 737 - quote price ~100 mln dollar (presumably a bit cheaper after discounts)
* high speed railway ~$25–39 million per km
**In price ranges involved those gates are dir... |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | I think the 1921 book *Primitive Groups: Part I* by William Manning is an interesting case. It has a heavy focus on permutation groups. In fact, all the usual definitions like subgroup, isomorphism, cyclic, order, Abelian, etc. are introduced in the context of permutation groups. Then it goes on to introduce groups of ... | While not (?) really a book, the reader [Group theory for Maths, Physics and Chemistry students](http://www.win.tue.nl/~amc/ow/gpth/reader.pdf) by A. Cohen, R. Ushirobira and J. Draisma might offer some helpful ideas. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | I suggest to take a look at the first chapter of the book "Algebra. A graduate course" by M.I. Isaacs. | While not (?) really a book, the reader [Group theory for Maths, Physics and Chemistry students](http://www.win.tue.nl/~amc/ow/gpth/reader.pdf) by A. Cohen, R. Ushirobira and J. Draisma might offer some helpful ideas. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | Here is a very good free textbook: Group Theory, JS Milne: <http://www.flooved.com/reader/3425>
and from a physicist's point of view by Kundu, Calcutta: <http://www.flooved.com/reader/3357#1> | While not (?) really a book, the reader [Group theory for Maths, Physics and Chemistry students](http://www.win.tue.nl/~amc/ow/gpth/reader.pdf) by A. Cohen, R. Ushirobira and J. Draisma might offer some helpful ideas. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | An excellent book for the beginners is
[MR0917939](http://www.ams.org/mathscinet-getitem?mr=0917939) Nikulin, V. V.; Shafarevich, I. R. Geometries and groups. Translated from the Russian by M. Reid. Universitext. Springer-Verlag, Berlin, 1987.
EDIT: And there is a book based on Arnold's own lectures:
[MR2110624](htt... | This may not be exactly what you wanted, since it assumes a little prior background in group theory, but *Permutation Groups* by Dixon and Mortimer certainly focuses on the perspective of permutation groups :). |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | This may not be exactly what you wanted, since it assumes a little prior background in group theory, but *Permutation Groups* by Dixon and Mortimer certainly focuses on the perspective of permutation groups :). | I think the 1921 book *Primitive Groups: Part I* by William Manning is an interesting case. It has a heavy focus on permutation groups. In fact, all the usual definitions like subgroup, isomorphism, cyclic, order, Abelian, etc. are introduced in the context of permutation groups. Then it goes on to introduce groups of ... |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | It is worth to read the first book on Group Theory -- W. Burnside, Theory of Groups of Finite Order -- to understand that abstract theory is usefull. By the way, sometime in the 19th century infinite groups were also considered as useless.
When I give lectures on the theory of groups for students, I end with Polya the... | This may not be exactly what you wanted, since it assumes a little prior background in group theory, but *Permutation Groups* by Dixon and Mortimer certainly focuses on the perspective of permutation groups :). |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | An excellent book for the beginners is
[MR0917939](http://www.ams.org/mathscinet-getitem?mr=0917939) Nikulin, V. V.; Shafarevich, I. R. Geometries and groups. Translated from the Russian by M. Reid. Universitext. Springer-Verlag, Berlin, 1987.
EDIT: And there is a book based on Arnold's own lectures:
[MR2110624](htt... | I suggest to take a look at the first chapter of the book "Algebra. A graduate course" by M.I. Isaacs. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | An excellent book for the beginners is
[MR0917939](http://www.ams.org/mathscinet-getitem?mr=0917939) Nikulin, V. V.; Shafarevich, I. R. Geometries and groups. Translated from the Russian by M. Reid. Universitext. Springer-Verlag, Berlin, 1987.
EDIT: And there is a book based on Arnold's own lectures:
[MR2110624](htt... | While not (?) really a book, the reader [Group theory for Maths, Physics and Chemistry students](http://www.win.tue.nl/~amc/ow/gpth/reader.pdf) by A. Cohen, R. Ushirobira and J. Draisma might offer some helpful ideas. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | It is worth to read the first book on Group Theory -- W. Burnside, Theory of Groups of Finite Order -- to understand that abstract theory is usefull. By the way, sometime in the 19th century infinite groups were also considered as useless.
When I give lectures on the theory of groups for students, I end with Polya the... | While not (?) really a book, the reader [Group theory for Maths, Physics and Chemistry students](http://www.win.tue.nl/~amc/ow/gpth/reader.pdf) by A. Cohen, R. Ushirobira and J. Draisma might offer some helpful ideas. |
141,488 | What are some books that discuss transformation groups (or permutation groups) before abstract groups?
---
Some quotes to motivate the question:
from V. I. Arnold, '[On Teaching Mathematics](http://pauli.uni-muenster.de/%7Emunsteg/arnold.html)':
>
> What is a group? Algebraists teach that this is supposedly a set ... | 2013/09/07 | [
"https://mathoverflow.net/questions/141488",
"https://mathoverflow.net",
"https://mathoverflow.net/users/23572/"
] | I suggest to take a look at the first chapter of the book "Algebra. A graduate course" by M.I. Isaacs. | Here is a very good free textbook: Group Theory, JS Milne: <http://www.flooved.com/reader/3425>
and from a physicist's point of view by Kundu, Calcutta: <http://www.flooved.com/reader/3357#1> |
57,576,731 | i'm currently using MongoDB with nodejs, so i'm struggling to use save method, it returns promise pending if there's anyone who can help me to fix I will be thankful.
this my code :
>
> booking.js:
>
>
>
```
var express = require("express");
const Booking = require("../model/booking");
var router = express.Router... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57576731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11247530/"
] | You need to set the seed inside your processes:
```
import random
from multiprocessing import Process, Manager
def f2(i):
random.seed(2019+i)
print('from f2:')
v = random.randint(0, 10)
a = random.randint(0, 10)
print('v:', v, 'a:', a)
return v, a
def python_process_test():
n_workers = 2
... | A simple fix, so no worries:
**If you want to generate the same number every time you need to pass the same seed value every time. [1](https://pynative.com/python-random-seed/)**
So all you need to do is call `random.seed(2019)` before every `randint()`.
Essentially, every time you use the random module to obtain a ... |
57,576,731 | i'm currently using MongoDB with nodejs, so i'm struggling to use save method, it returns promise pending if there's anyone who can help me to fix I will be thankful.
this my code :
>
> booking.js:
>
>
>
```
var express = require("express");
const Booking = require("../model/booking");
var router = express.Router... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57576731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11247530/"
] | You need to set the seed inside your processes:
```
import random
from multiprocessing import Process, Manager
def f2(i):
random.seed(2019+i)
print('from f2:')
v = random.randint(0, 10)
a = random.randint(0, 10)
print('v:', v, 'a:', a)
return v, a
def python_process_test():
n_workers = 2
... | ```
import time
import random
from multiprocessing import Process
from datetime import datetime
random.seed(2222)
def get_random_sleep_time():
random.seed(datetime.now().microsecond)
return random.randint(0,3)
def f2(rnd_seed, process_id):
# To randomize order in which process will print
sleep_time =... |
57,576,731 | i'm currently using MongoDB with nodejs, so i'm struggling to use save method, it returns promise pending if there's anyone who can help me to fix I will be thankful.
this my code :
>
> booking.js:
>
>
>
```
var express = require("express");
const Booking = require("../model/booking");
var router = express.Router... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57576731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11247530/"
] | ```
import time
import random
from multiprocessing import Process
from datetime import datetime
random.seed(2222)
def get_random_sleep_time():
random.seed(datetime.now().microsecond)
return random.randint(0,3)
def f2(rnd_seed, process_id):
# To randomize order in which process will print
sleep_time =... | A simple fix, so no worries:
**If you want to generate the same number every time you need to pass the same seed value every time. [1](https://pynative.com/python-random-seed/)**
So all you need to do is call `random.seed(2019)` before every `randint()`.
Essentially, every time you use the random module to obtain a ... |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | You can use `String.Split` here with respect to two strings (`A0` and `B0`), which will be the clearest solution I believe:
```
Dim value as String = "+1.0 A0 -256 B0 -2823"
Dim values = value.Split({ " A0 ", " B0 " }, StringSplitOptions.None)
``` | Per my comment, using replace and split
```
String s = "+1.0 A0 -256 B0 -2823";
s = s.Replace("A0", "").Replace("B0", "");
String[] allNumbers = s.Split(' ');
``` |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | NET contains a powerful String Split method. The source is delimited by spaces, so split on that and grab elements 0, 2 and 4 from the result:
If/when the lines read have a single space between the items as described in one part:
```
Dim value As String = "+1.0 A0 -256 B0 -2823"
Dim split = value.Split(" "c)
Dim val... | Per my comment, using replace and split
```
String s = "+1.0 A0 -256 B0 -2823";
s = s.Replace("A0", "").Replace("B0", "");
String[] allNumbers = s.Split(' ');
``` |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | You were on the right lines with the first attempt. You just need to use the actual string with the value in to find the location of the items. As you have un potentially unknown number of spaces, you need to useTrim to remove the spaces afterwards:
```
Dim value As String = "+1.0 A0 -256 B0 -2823" 'this i... | Per my comment, using replace and split
```
String s = "+1.0 A0 -256 B0 -2823";
s = s.Replace("A0", "").Replace("B0", "");
String[] allNumbers = s.Split(' ');
``` |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | If you want to split, try Split function ;)
Split(expression as string, delimiter as string) as string()
You want to split your expression by " " and take 1st, 3rd and 5th element from result array (2nd is "A0" and 4th is "B0")
So your code should look like :
```
Option base 0
' so we start counting at 0
Dim re... | Per my comment, using replace and split
```
String s = "+1.0 A0 -256 B0 -2823";
s = s.Replace("A0", "").Replace("B0", "");
String[] allNumbers = s.Split(' ');
``` |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | You can use `String.Split` here with respect to two strings (`A0` and `B0`), which will be the clearest solution I believe:
```
Dim value as String = "+1.0 A0 -256 B0 -2823"
Dim values = value.Split({ " A0 ", " B0 " }, StringSplitOptions.None)
``` | You were on the right lines with the first attempt. You just need to use the actual string with the value in to find the location of the items. As you have un potentially unknown number of spaces, you need to useTrim to remove the spaces afterwards:
```
Dim value As String = "+1.0 A0 -256 B0 -2823" 'this i... |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | You can use `String.Split` here with respect to two strings (`A0` and `B0`), which will be the clearest solution I believe:
```
Dim value as String = "+1.0 A0 -256 B0 -2823"
Dim values = value.Split({ " A0 ", " B0 " }, StringSplitOptions.None)
``` | If you want to split, try Split function ;)
Split(expression as string, delimiter as string) as string()
You want to split your expression by " " and take 1st, 3rd and 5th element from result array (2nd is "A0" and 4th is "B0")
So your code should look like :
```
Option base 0
' so we start counting at 0
Dim re... |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | NET contains a powerful String Split method. The source is delimited by spaces, so split on that and grab elements 0, 2 and 4 from the result:
If/when the lines read have a single space between the items as described in one part:
```
Dim value As String = "+1.0 A0 -256 B0 -2823"
Dim split = value.Split(" "c)
Dim val... | You were on the right lines with the first attempt. You just need to use the actual string with the value in to find the location of the items. As you have un potentially unknown number of spaces, you need to useTrim to remove the spaces afterwards:
```
Dim value As String = "+1.0 A0 -256 B0 -2823" 'this i... |
26,716,631 | I'm trying to split up the following string into substrings
```
Dim value as String = "+1.0 A0 -256 B0 -2823" 'this is a line from a txtfile
```
I want to split the string in the following 3 substrings.
```
Dim value1 as String= "+1.0"
Dim A0 as String = "-256"
Dim B0 as String = "-2823"
```
the String ... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26716631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459111/"
] | NET contains a powerful String Split method. The source is delimited by spaces, so split on that and grab elements 0, 2 and 4 from the result:
If/when the lines read have a single space between the items as described in one part:
```
Dim value As String = "+1.0 A0 -256 B0 -2823"
Dim split = value.Split(" "c)
Dim val... | If you want to split, try Split function ;)
Split(expression as string, delimiter as string) as string()
You want to split your expression by " " and take 1st, 3rd and 5th element from result array (2nd is "A0" and 4th is "B0")
So your code should look like :
```
Option base 0
' so we start counting at 0
Dim re... |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | It is going to be similar to putting a NULL character in a C string. Although your print output does not show the `b` character, other Lua functions should work with the full length of the string (unlike C string handling functions that work with NULL terminated strings).
One use of this would be to use one string for... | >
> The null character is often represented as the escape sequence \0 in
> source code string literals or character constants.
>
>
>
[Wikipedia Null Character](http://en.wikipedia.org/wiki/Null_character) |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | `\0` is just a byte with the value zero, it doesn't need any fancy name. Lua strings are just byte strings that keep track of their length, so they may contain any byte values, zero included. Some functions treat these byte strings as if they were C strings that terminate with `\0`, apparently `print` does this.
This ... | >
> The null character is often represented as the escape sequence \0 in
> source code string literals or character constants.
>
>
>
[Wikipedia Null Character](http://en.wikipedia.org/wiki/Null_character) |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | Every character has an internal numeric representation, such as \97 for 'a'. A character with code \0 does not represent any visible character but is used as a terminator in C and other programming languages.
The manual wants to make it clear that a '\0' is **not** a terminator in Lua. It also means that you can load ... | >
> The null character is often represented as the escape sequence \0 in
> source code string literals or character constants.
>
>
>
[Wikipedia Null Character](http://en.wikipedia.org/wiki/Null_character) |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | Lua 5.2 works well when Lua 5.1 has several problems with nul bytes in the string.
I've found that the function print dischards all characters after the nul byte.
Also the function string.format returns string up to the first nul character. | >
> The null character is often represented as the escape sequence \0 in
> source code string literals or character constants.
>
>
>
[Wikipedia Null Character](http://en.wikipedia.org/wiki/Null_character) |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | `\0` is just a byte with the value zero, it doesn't need any fancy name. Lua strings are just byte strings that keep track of their length, so they may contain any byte values, zero included. Some functions treat these byte strings as if they were C strings that terminate with `\0`, apparently `print` does this.
This ... | It is going to be similar to putting a NULL character in a C string. Although your print output does not show the `b` character, other Lua functions should work with the full length of the string (unlike C string handling functions that work with NULL terminated strings).
One use of this would be to use one string for... |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | Every character has an internal numeric representation, such as \97 for 'a'. A character with code \0 does not represent any visible character but is used as a terminator in C and other programming languages.
The manual wants to make it clear that a '\0' is **not** a terminator in Lua. It also means that you can load ... | It is going to be similar to putting a NULL character in a C string. Although your print output does not show the `b` character, other Lua functions should work with the full length of the string (unlike C string handling functions that work with NULL terminated strings).
One use of this would be to use one string for... |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | Every character has an internal numeric representation, such as \97 for 'a'. A character with code \0 does not represent any visible character but is used as a terminator in C and other programming languages.
The manual wants to make it clear that a '\0' is **not** a terminator in Lua. It also means that you can load ... | `\0` is just a byte with the value zero, it doesn't need any fancy name. Lua strings are just byte strings that keep track of their length, so they may contain any byte values, zero included. Some functions treat these byte strings as if they were C strings that terminate with `\0`, apparently `print` does this.
This ... |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | `\0` is just a byte with the value zero, it doesn't need any fancy name. Lua strings are just byte strings that keep track of their length, so they may contain any byte values, zero included. Some functions treat these byte strings as if they were C strings that terminate with `\0`, apparently `print` does this.
This ... | Lua 5.2 works well when Lua 5.1 has several problems with nul bytes in the string.
I've found that the function print dischards all characters after the nul byte.
Also the function string.format returns string up to the first nul character. |
8,475,670 | I make a css3 animation with key frames. But i have a problem. This is my code:
```
a[title*="in je favorieten"]:hover {
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
-moz-animation-iteration-count: 3;
-webkit-animati... | 2011/12/12 | [
"https://Stackoverflow.com/questions/8475670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1001076/"
] | Every character has an internal numeric representation, such as \97 for 'a'. A character with code \0 does not represent any visible character but is used as a terminator in C and other programming languages.
The manual wants to make it clear that a '\0' is **not** a terminator in Lua. It also means that you can load ... | Lua 5.2 works well when Lua 5.1 has several problems with nul bytes in the string.
I've found that the function print dischards all characters after the nul byte.
Also the function string.format returns string up to the first nul character. |
7,827,030 | I have an events feed from facebook that outputs data in XML format. The dates/ times are in epoch (unix) format, I think. Like so:
```
<start_time>1319506200</start_time><end_time>1319511600</end_time>
```
This is dynamic information (events created by a facebook page).
I am using php file\_get\_contents to plac... | 2011/10/19 | [
"https://Stackoverflow.com/questions/7827030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003901/"
] | You should be using the timer API provided by the OS instead on relying on the scheduler. Here's an introduction to the [timer API for Linux drivers](http://www.ibm.com/developerworks/linux/library/l-timers-list/?ca=drs-). | If you need hardcore timing, the OS scheduler is not likely to be good enough (as you've found).
If you can, use a separate timer peripheral, and use it's ISR to do as little as you can get away with (timestamping some critical data, set some flags for example) and *then* let your higher-jitter routine make use of tha... |
7,827,030 | I have an events feed from facebook that outputs data in XML format. The dates/ times are in epoch (unix) format, I think. Like so:
```
<start_time>1319506200</start_time><end_time>1319511600</end_time>
```
This is dynamic information (events created by a facebook page).
I am using php file\_get\_contents to plac... | 2011/10/19 | [
"https://Stackoverflow.com/questions/7827030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003901/"
] | You should be using the timer API provided by the OS instead on relying on the scheduler. Here's an introduction to the [timer API for Linux drivers](http://www.ibm.com/developerworks/linux/library/l-timers-list/?ca=drs-). | Linux is not an RTOS, and that is probably the root of your problem.
You can render Linux more suited to real-time use in various ways and to various extent. See [A comparison of real-time Linux approaches](http://archive.linuxgizmos.com/a-comparison-of-real-time-linux-approaches/) for some methods and an assessment ... |
7,827,030 | I have an events feed from facebook that outputs data in XML format. The dates/ times are in epoch (unix) format, I think. Like so:
```
<start_time>1319506200</start_time><end_time>1319511600</end_time>
```
This is dynamic information (events created by a facebook page).
I am using php file\_get\_contents to plac... | 2011/10/19 | [
"https://Stackoverflow.com/questions/7827030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003901/"
] | If you need hardcore timing, the OS scheduler is not likely to be good enough (as you've found).
If you can, use a separate timer peripheral, and use it's ISR to do as little as you can get away with (timestamping some critical data, set some flags for example) and *then* let your higher-jitter routine make use of tha... | Linux is not an RTOS, and that is probably the root of your problem.
You can render Linux more suited to real-time use in various ways and to various extent. See [A comparison of real-time Linux approaches](http://archive.linuxgizmos.com/a-comparison-of-real-time-linux-approaches/) for some methods and an assessment ... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1
To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8 | So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.
>
> I went to icon tray --> Right click on docker to windows --> Go to
> settings --> set the proxy as ip:port
>
>
>
Please refer screenshot as below
[](h... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1
To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8 | Generally the problem of connection timeout, I know why the internet output was restricted to download docker images from external repositories,
1. To check this you can try to download the image from another server or another machine with a different internet channel.
2. If you can send the image from scp use the com... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | If you are running behind proxy then,
1. add following command or line in `/etc/default/docker` file,
`export http_proxy=<YOUR_PROXY>`
2. Restart docker service and check,
`# service docker restart` | Generally the problem of connection timeout, I know why the internet output was restricted to download docker images from external repositories,
1. To check this you can try to download the image from another server or another machine with a different internet channel.
2. If you can send the image from scp use the com... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | If you are running behind proxy then,
1. add following command or line in `/etc/default/docker` file,
`export http_proxy=<YOUR_PROXY>`
2. Restart docker service and check,
`# service docker restart` | So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.
>
> I went to icon tray --> Right click on docker to windows --> Go to
> settings --> set the proxy as ip:port
>
>
>
Please refer screenshot as below
[](h... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | If you are running behind proxy then,
1. add following command or line in `/etc/default/docker` file,
`export http_proxy=<YOUR_PROXY>`
2. Restart docker service and check,
`# service docker restart` | 1. service docker stop
2. HTTP\_PROXY=<http://proxy_ip:port/> docker -d &
This should work.
On Ubuntu, you can add HTTP\_PROXY and HTTPS\_PROXY to /etc/default/docker |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.
>
> I went to icon tray --> Right click on docker to windows --> Go to
> settings --> set the proxy as ip:port
>
>
>
Please refer screenshot as below
[](h... | To change for a fast, open and non-intrusive DNS on CentOS 7:
```
sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
```
add the line:
```
PEERDNS=no
```
and
```
sudo vi /etc/resolv.conf
```
keep only the line:
```
nameserver 9.9.9.9
``` |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1
To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8 | If you run into these `docker pull` timeout issues on Docker Toolbox running on Windows 10 Home and piggybacking off an existing Virtualbox installation, check to see if Virtualbox is separately open and if so, shut down running machines and close Virtualbox (one or more of those running machines within Virtualbox were... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | So yes, what worked for me at the end is setting the proxy, as mentioned by other answers.
>
> I went to icon tray --> Right click on docker to windows --> Go to
> settings --> set the proxy as ip:port
>
>
>
Please refer screenshot as below
[](h... | If you run into these `docker pull` timeout issues on Docker Toolbox running on Windows 10 Home and piggybacking off an existing Virtualbox installation, check to see if Virtualbox is separately open and if so, shut down running machines and close Virtualbox (one or more of those running machines within Virtualbox were... |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | I was getting timeouts on Windows 10 Docker 17.03.0-ce-rc1
To fix it I opened Settings / Network and then set the DNS server to 8.8.8.8 | To change for a fast, open and non-intrusive DNS on CentOS 7:
```
sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
```
add the line:
```
PEERDNS=no
```
and
```
sudo vi /etc/resolv.conf
```
keep only the line:
```
nameserver 9.9.9.9
``` |
26,861,390 | While running
>
> sudo docker pull centos
>
>
>
it gives connection time out, While it is running behind proxy where the proxy has been set http\_proxy & https\_proxy. What is the reason apart from proxy,though it seems proxy issue.I checked [LINK](https://stackoverflow.com/questions/23111631/cannot-download-doc... | 2014/11/11 | [
"https://Stackoverflow.com/questions/26861390",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/930663/"
] | If you are running behind proxy then,
1. add following command or line in `/etc/default/docker` file,
`export http_proxy=<YOUR_PROXY>`
2. Restart docker service and check,
`# service docker restart` | If you run into these `docker pull` timeout issues on Docker Toolbox running on Windows 10 Home and piggybacking off an existing Virtualbox installation, check to see if Virtualbox is separately open and if so, shut down running machines and close Virtualbox (one or more of those running machines within Virtualbox were... |
22,639,672 | I am trying to implement a [file upload using angular js](https://github.com/danialfarid/angular-file-upload) and grails. I am able to call the grails controller method but not able to get the file from angular js using request.getFile() method. Here is my html code,
```
<script src="angular-file-upload-shim.min.js"><... | 2014/03/25 | [
"https://Stackoverflow.com/questions/22639672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2790522/"
] | As far as I know, Get-Mailbox won't do that, unfortunately. It'll get you information about the mailbox, but not it's contents. If you want to work w/ the contents of a mailbox, and you can't use Outlook, your best bet is probably the Exchange Web Service (EWS). | There is a way to do this but it really depends on how much you are willing to work to make it possible.
The best way that I could think of is using the EWS API. It's messy and it takes a while to learn so you will probably need to put some time and effort into making the script (unless you can find someone else who h... |
35,556,752 | I've been trying to work with Ionic push notifications and everything went well untill I had to store the Device token which I recieved. I've been following every step the tutorial gave me so I don't see any wrong code in my project.
This is my register code:
```
// kick off the platform web client
Ionic.io(... | 2016/02/22 | [
"https://Stackoverflow.com/questions/35556752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5027729/"
] | I had this problem until I discovered that I was using an old version of cordova (v.4). Anything below v. 5 does not work properly with Ionic (current Cordova version as of writing is 6.0.0).
`npm update -g cordova`
Everything worked as documented after that. | Put Ionic in production mode, so it use the certificate you uploaded. (But still in dev mode for devices)
$ ionic push --production-mode=n |
3,076,365 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor **not** delete the messages onc... | 2010/06/19 | [
"https://Stackoverflow.com/questions/3076365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362498/"
] | Since 1.2, Django has a new messages framework--[`django.contrib.messages`](http://docs.djangoproject.com/en/dev/ref/contrib/messages/#ref-contrib-messages)--that is now completely detached from the `auth` module and offers much more functionality. For instance, it provides a basic way of handling the [expiration of me... | Django messages might seem like a good starting point, but require contortions to get to where you want to go, and I wouldn't trust that future release of Django wouldn't break your hacks.
Implementing your own UserMessage model will probably serve you better in the long run. That gives you complete, unambiguous contr... |
3,076,365 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor **not** delete the messages onc... | 2010/06/19 | [
"https://Stackoverflow.com/questions/3076365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362498/"
] | In your case `django.contrib.messages` won't bring you anywhere good. It's a message system inspired by RoR flash system, where messages aren't supposed to stay around
You should create your own messaging system (django-persistent-messages maybe?) that would save messages for registered users in database.
* It's a fa... | Django messages might seem like a good starting point, but require contortions to get to where you want to go, and I wouldn't trust that future release of Django wouldn't break your hacks.
Implementing your own UserMessage model will probably serve you better in the long run. That gives you complete, unambiguous contr... |
3,076,365 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor **not** delete the messages onc... | 2010/06/19 | [
"https://Stackoverflow.com/questions/3076365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362498/"
] | In your case `django.contrib.messages` won't bring you anywhere good. It's a message system inspired by RoR flash system, where messages aren't supposed to stay around
You should create your own messaging system (django-persistent-messages maybe?) that would save messages for registered users in database.
* It's a fa... | Since 1.2, Django has a new messages framework--[`django.contrib.messages`](http://docs.djangoproject.com/en/dev/ref/contrib/messages/#ref-contrib-messages)--that is now completely detached from the `auth` module and offers much more functionality. For instance, it provides a basic way of handling the [expiration of me... |
3,076,365 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor **not** delete the messages onc... | 2010/06/19 | [
"https://Stackoverflow.com/questions/3076365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362498/"
] | Since 1.2, Django has a new messages framework--[`django.contrib.messages`](http://docs.djangoproject.com/en/dev/ref/contrib/messages/#ref-contrib-messages)--that is now completely detached from the `auth` module and offers much more functionality. For instance, it provides a basic way of handling the [expiration of me... | Since late 2010, there is the library, [django-persistent-messages](https://github.com/philomat/django-persistent-messages), for exactly this goal. It's reasonably well documented and works well to create a Stack Overflow-style messaging system.
It also integrates with the built-in Django messaging system, so the code... |
3,076,365 | I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor **not** delete the messages onc... | 2010/06/19 | [
"https://Stackoverflow.com/questions/3076365",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/362498/"
] | In your case `django.contrib.messages` won't bring you anywhere good. It's a message system inspired by RoR flash system, where messages aren't supposed to stay around
You should create your own messaging system (django-persistent-messages maybe?) that would save messages for registered users in database.
* It's a fa... | Since late 2010, there is the library, [django-persistent-messages](https://github.com/philomat/django-persistent-messages), for exactly this goal. It's reasonably well documented and works well to create a Stack Overflow-style messaging system.
It also integrates with the built-in Django messaging system, so the code... |
38,473,831 | i have this simple append and then remove i can remove it all but the problem is how can i disable remove if their is only one remaining input text?
my **remove jQuery Script**
```
jQuery(document).on("click",".remove",function(){
var doc = jQuery(this);
var remove = doc.closest(".list");
var del = jQuery(".rem... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38473831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6582290/"
] | Just change the less than to greater than in your remove handler.
```
jQuery(document).on("click",".remove",function(){
var doc = jQuery(this);
var remove = doc.closest(".list");
var del = jQuery(".remove").length;
if(del > 1){
remove.remove();
}
});
``` | Try this:
```
var count = 1;
$(document).on('click', '.add', function(){
call your add function
count++;
});
$(document).on('click', '.delete', function(){
if(count > 1)
{
call your delete function
count --;
}
});
``` |
13,567,208 | **Synopsis:** I need to display a table like the one below:

**Necessities:**
* Semantic HTML coding
* No scripting
**HTML:**
```
<table>
<thead>
<tr>
<th colspan=2>
One
</th>
<th colsp... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13567208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333941/"
] | Depending on your compatibility requirements, you have the option of using CSS generated-content:
```
th {
/* other CSS */
position: relative;
}
thead th::before,
thead th::after {
content: '';
position: absolute;
bottom: -1px;
width: 0.5em;
border-bottom: 1px solid #fff;
}
thead th::befo... | You can do this by adding white borders. You then need to turn them off from the first and last cells.
```
table thead tr th{
border-left: solid 10px white;
border-right: solid 10px white;
border-bottom: 1px solid black;
padding: 10px;
text-align: center;
}
table thead tr th:first-child {
borde... |
13,567,208 | **Synopsis:** I need to display a table like the one below:

**Necessities:**
* Semantic HTML coding
* No scripting
**HTML:**
```
<table>
<thead>
<tr>
<th colspan=2>
One
</th>
<th colsp... | 2012/11/26 | [
"https://Stackoverflow.com/questions/13567208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333941/"
] | [Here's my try](http://jsfiddle.net/6YSTH/).
Basically I just did:
```
table thead tr th[colspan="2"]:first-child {
border-right: 20px solid white;
}
table thead tr th[colspan="2"]:nth-child(2) {
border-left: 20px solid white;
}
```
**Note:** I personally wouldn't use such complex selectors, but this should... | You can do this by adding white borders. You then need to turn them off from the first and last cells.
```
table thead tr th{
border-left: solid 10px white;
border-right: solid 10px white;
border-bottom: 1px solid black;
padding: 10px;
text-align: center;
}
table thead tr th:first-child {
borde... |
49,294,284 | I have CSV files get updated every day and we process the files and delete the files older than 30 days based on the date in the filename.
Example filenames :
`XXXXXXXXXXX_xx00xx_**20171001**.000000_0.csv`
I would like to schedule the job in crontab to delete 30 days older files daily.
Path could be `/mount/store/
... | 2018/03/15 | [
"https://Stackoverflow.com/questions/49294284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | This is not a loop, it is a conditional statement and even if it would be a loop it woudln't change a thing.
This is an unreachable statement because return is the place where you get out of the method and return a value of an expression that is next to the `return` key word. | Put your System.out.println() before the return statement.
The return statement take the compiler out of the function and the println() statement won't be executed at all. |
46,702 | Suppose, we've built some package from sources (`configure make install`).
May we remove sources directory after successful building? Or it depends? On what, then? | 2011/06/03 | [
"https://askubuntu.com/questions/46702",
"https://askubuntu.com",
"https://askubuntu.com/users/15455/"
] | You don't need anything except the binaries. Those should already be copied to another location by make install. The rest can be removed. If you're unsure make a backup before removal. Remove, test if still working, if still working remove the backup.
*Note:*
As [ændrük](https://askubuntu.com/users/1859/ndruk) pointe... | If you installed files using `make install`, the only way to know where they went later on if you want to uninstall them is to inspect the source files. You may want to archive a copy of the source for this purpose.
A better alternative is to use [`checkinstall`](https://help.ubuntu.com/community/CheckInstall) instead... |
46,702 | Suppose, we've built some package from sources (`configure make install`).
May we remove sources directory after successful building? Or it depends? On what, then? | 2011/06/03 | [
"https://askubuntu.com/questions/46702",
"https://askubuntu.com",
"https://askubuntu.com/users/15455/"
] | You don't need anything except the binaries. Those should already be copied to another location by make install. The rest can be removed. If you're unsure make a backup before removal. Remove, test if still working, if still working remove the backup.
*Note:*
As [ændrük](https://askubuntu.com/users/1859/ndruk) pointe... | Generally once you got your binaries installed you can remove the directory containing source code, unless you want to compile them again, possibly with other compilation options.
Sometimes you could find particularly useful to keep the source directory, for example when [upgrading Apache](http://httpd.apache.org/docs... |
46,702 | Suppose, we've built some package from sources (`configure make install`).
May we remove sources directory after successful building? Or it depends? On what, then? | 2011/06/03 | [
"https://askubuntu.com/questions/46702",
"https://askubuntu.com",
"https://askubuntu.com/users/15455/"
] | If you installed files using `make install`, the only way to know where they went later on if you want to uninstall them is to inspect the source files. You may want to archive a copy of the source for this purpose.
A better alternative is to use [`checkinstall`](https://help.ubuntu.com/community/CheckInstall) instead... | Generally once you got your binaries installed you can remove the directory containing source code, unless you want to compile them again, possibly with other compilation options.
Sometimes you could find particularly useful to keep the source directory, for example when [upgrading Apache](http://httpd.apache.org/docs... |
237,146 | I'm trying to create custom products with Commerce 2. More specifically I'm trying to have custom ui for customers to build their purchasable products.
I thought that I would be able to create single Product and it's variation and then make some adjustments for price and some other fields. It seems that I'm able to pr... | 2017/05/26 | [
"https://drupal.stackexchange.com/questions/237146",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/72120/"
] | When setting the unit price, you must set the override parameter to true as so:
```
$unit_price = new \Drupal\commerce_price\Price('9.99', 'USD');
$order_item->setUnitPrice($unit_price, TRUE);
$order_item->save();
``` | I'm just starting to look into this myself. Ideally, I'd like to be able to let admin users directly edit the unit price field as well as the total price field for any order item. (Sometimes for bulk orders, there's no way to set the price properly by multiplying the unit price if we want to avoid weird total prices li... |
3,240,775 | I manage a small team of developers who up till recently have all been working on independent projects.
We have now all come together to work on one holistic project and its really tough. People are changing things, without consulting other programmers and its very difficult to manage.
We are also working in a pure p... | 2010/07/13 | [
"https://Stackoverflow.com/questions/3240775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104460/"
] | From the same page:
* `<img>` tags are not guaranteed to be done loading when `onModuleLoad()` is called.
* `<script>` tags **are** guaranteed to be done loading when `onModuleLoad()` is called.
So when `onModuleLoad()` is executed the externalScriptOne.js is loaded, it doesn't start before all script tags are loaded... | either nocache.js or cache.js could add an extra `<script>` tag immediately after the last `<script>` tag. this extra `<script>` tag would not be fetched until all previous `<script>` tags are fetched, parsed, and evaluated. then this `<script>` tag would be fetched, executed, and evaluated without waiting for any imag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.