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 |
|---|---|---|---|---|---|
73,220 | Planet Swamp. As the name suggest, it is a planet fully covered with swamps.
A new kind of carnivorous plant has been discovered on this planet: when its leaves are touched by an animal or moved by the wind they emit a sweet scent, something like vanilla and sugar. This sweet scent attract unaware animals close to the... | 2017/03/07 | [
"https://worldbuilding.stackexchange.com/questions/73220",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/30492/"
] | I like a fungus for the approach you describe.
1: Fungi are mostly underground in mycelial webs. I think I read that the largest organism on earth is a colossal underground mycelium extending for many acres. The above ground pieces are dispensible appendages (like mushrooms). It is no big deal to the fungus if a mushr... | You plant doesn't want to catch large animals, because a rotting corpse (or slurry) kills the soil macro and micro-fauna which are keeping the plant alive. Decaying corpses turn the soil anaerobic (oxygen-less) as the gloop uses up all the free oxygen. So useful burrowing creatures like worms will flee or die of suffoc... |
73,220 | Planet Swamp. As the name suggest, it is a planet fully covered with swamps.
A new kind of carnivorous plant has been discovered on this planet: when its leaves are touched by an animal or moved by the wind they emit a sweet scent, something like vanilla and sugar. This sweet scent attract unaware animals close to the... | 2017/03/07 | [
"https://worldbuilding.stackexchange.com/questions/73220",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/30492/"
] | I like a fungus for the approach you describe.
1: Fungi are mostly underground in mycelial webs. I think I read that the largest organism on earth is a colossal underground mycelium extending for many acres. The above ground pieces are dispensible appendages (like mushrooms). It is no big deal to the fungus if a mushr... | Small animals are best for all the reasons above and the fact that the drug needs to affect the animal before it leaves the area. Taking an elephant as an example, the skin is so thick that the toxin may not reach past the layer of dead cells. If it does affect a large animal, it may take too long. It does the plant no... |
73,220 | Planet Swamp. As the name suggest, it is a planet fully covered with swamps.
A new kind of carnivorous plant has been discovered on this planet: when its leaves are touched by an animal or moved by the wind they emit a sweet scent, something like vanilla and sugar. This sweet scent attract unaware animals close to the... | 2017/03/07 | [
"https://worldbuilding.stackexchange.com/questions/73220",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/30492/"
] | You plant doesn't want to catch large animals, because a rotting corpse (or slurry) kills the soil macro and micro-fauna which are keeping the plant alive. Decaying corpses turn the soil anaerobic (oxygen-less) as the gloop uses up all the free oxygen. So useful burrowing creatures like worms will flee or die of suffoc... | Small animals are best for all the reasons above and the fact that the drug needs to affect the animal before it leaves the area. Taking an elephant as an example, the skin is so thick that the toxin may not reach past the layer of dead cells. If it does affect a large animal, it may take too long. It does the plant no... |
99,334 | I need a package for missing data imputation in R. But since I am dealing with big data, the number of missing data entries can also be high. The packages which impute using mean or median are of course working fast, but more complicated packages which impute using regression or PCA take too long for a high number of m... | 2014/05/20 | [
"https://stats.stackexchange.com/questions/99334",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/36564/"
] | I used [mice](http://cran.r-project.org/web/packages/mice/mice.pdf) (multiple imputation by chained equation). It's fairly fast, and quite simple. I used it on 3000 obs. for c.a. 10 variables. Done in 10min on an old computer. Further, I believe it is one of the best multiple-imputation packages out there.
It can use r... | The Hmisc package can probably do this with the imputation function (aregImpute). Agree that columns are plenty, but rows are few. Should probably be handled by Hisc... |
58,506,615 | I upgraded existing web forms app (c#) from Visual Studio 2017 Enterprise to 2019. While code is working fine, when I open default.aspx page - I get 123 errors (while code compiles fine). If I open it back in 2017 version - no errors
I had addressed couple of the errors but not sure what to do with the rest. Especiall... | 2019/10/22 | [
"https://Stackoverflow.com/questions/58506615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4603130/"
] | Found a solution:
This is happening to projects that are using v1.0.0 of Microsoft.Net.Compilers. To work around this problem you need to update to the latest stable version which is 3.0.0.
All errors disappeared. | Looks like something broken with `VS Intellisense` since the compile and build sueeccded.
1.Before you open the web form project in VS2019, navigate to its Solution Directory and delete the hidden `.vs` folder there, after that open the project in VS2019 to check if it helps.
2.If the issue persists, try cleaning th... |
54,595 | 宿題をやりさえすればいい
宿題をやってさえいたらいい
What is the difference/nuance between these two ways to use さえ with verbs? | 2017/11/18 | [
"https://japanese.stackexchange.com/questions/54595",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/26532/"
] | >
> * 宿題をやりさえすれば
> * 宿題をやってさえいたら
>
>
>
These are both complicated with さえ (="only"), [whose grammar rule may be difficult](http://maggiesensei.com/2015/03/28/how-to-use-%E3%81%95%E3%81%88sae/), but after removing さえ, these sentences are:
>
> * 宿題をやれば = If you (will) do your homework ...
> * 宿題をやっていたら = If you ha... | I think it is almost interchangeable though, if there was the difference in some cases, it similar to the difference between deductive reasoning and inductive reasoning.
>
> 宿題をやりさえすればいい
>
>
>
宿題をやりさえすればいい may imply that you only have to do homework in order to achieve something. If you have done homework, you ca... |
71,517,216 | I am following this code from a youtube video it uses iex cloud API. I have followed the video till now but I am stuck at this point
```
enter code here
# Function sourced from
# https://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-
chunks
def chunks(lst, n):
"""Yield successive... | 2022/03/17 | [
"https://Stackoverflow.com/questions/71517216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12182169/"
] | ```
for symbol in symbol_string.split(","):
if symbol == 'HFC' or symbol == 'VIAC' or symbol == 'WLTW' or symbol == 'DISCA':
continue
else:
final_dataframe=final_dataframe.append(
pd.Series([
symbol,
data[symbol]["quote"]["latestPrice"],
... | I don't know the exact reason but, skip these three stocks by doing...
```
for symbol in symbol_string.split(','):
if symbol == 'HFC' or symbol == 'VIAC' or symbol == 'WLTW':
continue
final_dataframe = final_dataframe.append( .....
``` |
71,517,216 | I am following this code from a youtube video it uses iex cloud API. I have followed the video till now but I am stuck at this point
```
enter code here
# Function sourced from
# https://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-
chunks
def chunks(lst, n):
"""Yield successive... | 2022/03/17 | [
"https://Stackoverflow.com/questions/71517216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12182169/"
] | ```
for symbol in symbol_string.split(","):
if symbol == 'HFC' or symbol == 'VIAC' or symbol == 'WLTW' or symbol == 'DISCA':
continue
else:
final_dataframe=final_dataframe.append(
pd.Series([
symbol,
data[symbol]["quote"]["latestPrice"],
... | HFC is a ticker symbol, so I'm going to assume that the IEX api doesn't have relevant info on HFC, just remove it from 'stocks['ticker']' or follow the advice above to skip it. |
6,142,098 | Two files. Each runs new window and works by itself. I need to run them both.
When I run `first.pyw`, only one (second) window is shown.
Is it possible two run them both?
first.pyw:
```
import sys
from PyQt4.QtGui import *
import second
class first(QWidget):
def __init__(self, parent=None):
QWidget... | 2011/05/26 | [
"https://Stackoverflow.com/questions/6142098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/159982/"
] | You can only run a single application at a time, although your application can have multiple top-level windows. The [QCoreApplication docs](http://doc.trolltech.com/4.7/qcoreapplication.html#details) say that:
>
> ...there should be exactly one QCoreApplication object.
>
>
>
This also holds true for QApplication ... | You import second. Hence it is interpreted before you even reach the definition of class first. As the last line of second.pyw is sys.exit, nothing behind it can be executed. |
6,142,098 | Two files. Each runs new window and works by itself. I need to run them both.
When I run `first.pyw`, only one (second) window is shown.
Is it possible two run them both?
first.pyw:
```
import sys
from PyQt4.QtGui import *
import second
class first(QWidget):
def __init__(self, parent=None):
QWidget... | 2011/05/26 | [
"https://Stackoverflow.com/questions/6142098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/159982/"
] | The accepted answer is essentially right, but there are cases where you want to run multiple QApplications one after the other, e.g. :
* Unit tests
* A command-line tool that shouldn't require a running X server (hence no QApplication on startup), but can optionally show a window if the user's system supports it
I en... | You import second. Hence it is interpreted before you even reach the definition of class first. As the last line of second.pyw is sys.exit, nothing behind it can be executed. |
6,142,098 | Two files. Each runs new window and works by itself. I need to run them both.
When I run `first.pyw`, only one (second) window is shown.
Is it possible two run them both?
first.pyw:
```
import sys
from PyQt4.QtGui import *
import second
class first(QWidget):
def __init__(self, parent=None):
QWidget... | 2011/05/26 | [
"https://Stackoverflow.com/questions/6142098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/159982/"
] | You can only run a single application at a time, although your application can have multiple top-level windows. The [QCoreApplication docs](http://doc.trolltech.com/4.7/qcoreapplication.html#details) say that:
>
> ...there should be exactly one QCoreApplication object.
>
>
>
This also holds true for QApplication ... | The accepted answer is essentially right, but there are cases where you want to run multiple QApplications one after the other, e.g. :
* Unit tests
* A command-line tool that shouldn't require a running X server (hence no QApplication on startup), but can optionally show a window if the user's system supports it
I en... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | You can create a `KeyProcessor` interface and implementation for every key (move the body of the current `Processor.processStuffAboutKeyX()` methods to these classes):
```
public interface KeyProcessor {
void processStuff(String data);
}
```
Then fill a map with the available implementations:
```
Map<Key, KeyPr... | An addition to the strategy and code of @palacsint is to use `Reflection` to automatically bind the classes that implement `KeyProcessor` to the dictionary. This way, you don't have to add each `KeyProcessor` manually and you don't have to remember it.
Make sure that you only 'reflect' once because it is relatively sl... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | You can replace each case in the switch statement with a virtual function call, as shown in palacsint's answer.
IMO palacsint's answer is little better (and arguably worse: more lines of code) than the original code. For example when you need to add support for a new key value, in your code you need to add a new case ... | In line with @M. Mimpen's answer, get all methods of `Processor` object and store them in `Map<MyKeyEnum, Method>`, where the key refers to the key from your parameter `map`.
An alternative to this, is putting an entry to Map every time an entry is added to your `map` (the one you pass to the method).
```
//assume t... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | How about adding the functionality of the process methods to the enum itself? This way the enum itself knows how to process, and if you add a value to the enum you don't have to search for all switch statements in your code base to update these.
You can read more about this approach in Effective Java, by Joshua Bloch.... | Your enum should actually be a base class with the virtual method `processStuff(string)`.
Each key should be it's own class and should implement the virtual method.
This approach is similar to answer by [Paul S](https://codereview.stackexchange.com/a/42153/30851) but is more true to OO style.
Applying the strategy pa... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | Your enum should actually be a base class with the virtual method `processStuff(string)`.
Each key should be it's own class and should implement the virtual method.
This approach is similar to answer by [Paul S](https://codereview.stackexchange.com/a/42153/30851) but is more true to OO style.
Applying the strategy pa... | In line with @M. Mimpen's answer, get all methods of `Processor` object and store them in `Map<MyKeyEnum, Method>`, where the key refers to the key from your parameter `map`.
An alternative to this, is putting an entry to Map every time an entry is added to your `map` (the one you pass to the method).
```
//assume t... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | How about adding the functionality of the process methods to the enum itself? This way the enum itself knows how to process, and if you add a value to the enum you don't have to search for all switch statements in your code base to update these.
You can read more about this approach in Effective Java, by Joshua Bloch.... | In line with @M. Mimpen's answer, get all methods of `Processor` object and store them in `Map<MyKeyEnum, Method>`, where the key refers to the key from your parameter `map`.
An alternative to this, is putting an entry to Map every time an entry is added to your `map` (the one you pass to the method).
```
//assume t... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | An addition to the strategy and code of @palacsint is to use `Reflection` to automatically bind the classes that implement `KeyProcessor` to the dictionary. This way, you don't have to add each `KeyProcessor` manually and you don't have to remember it.
Make sure that you only 'reflect' once because it is relatively sl... | In line with @M. Mimpen's answer, get all methods of `Processor` object and store them in `Map<MyKeyEnum, Method>`, where the key refers to the key from your parameter `map`.
An alternative to this, is putting an entry to Map every time an entry is added to your `map` (the one you pass to the method).
```
//assume t... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | You can create a `KeyProcessor` interface and implementation for every key (move the body of the current `Processor.processStuffAboutKeyX()` methods to these classes):
```
public interface KeyProcessor {
void processStuff(String data);
}
```
Then fill a map with the available implementations:
```
Map<Key, KeyPr... | In line with @M. Mimpen's answer, get all methods of `Processor` object and store them in `Map<MyKeyEnum, Method>`, where the key refers to the key from your parameter `map`.
An alternative to this, is putting an entry to Map every time an entry is added to your `map` (the one you pass to the method).
```
//assume t... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | How about adding the functionality of the process methods to the enum itself? This way the enum itself knows how to process, and if you add a value to the enum you don't have to search for all switch statements in your code base to update these.
You can read more about this approach in Effective Java, by Joshua Bloch.... | An addition to the strategy and code of @palacsint is to use `Reflection` to automatically bind the classes that implement `KeyProcessor` to the dictionary. This way, you don't have to add each `KeyProcessor` manually and you don't have to remember it.
Make sure that you only 'reflect' once because it is relatively sl... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | You can create a `KeyProcessor` interface and implementation for every key (move the body of the current `Processor.processStuffAboutKeyX()` methods to these classes):
```
public interface KeyProcessor {
void processStuff(String data);
}
```
Then fill a map with the available implementations:
```
Map<Key, KeyPr... | You can replace each case in the switch statement with a virtual function call, as shown in palacsint's answer.
IMO palacsint's answer is little better (and arguably worse: more lines of code) than the original code. For example when you need to add support for a new key value, in your code you need to add a new case ... |
42,125 | Lately I have been trying to [extract till I drop](https://sites.google.com/site/unclebobconsultingllc/one-thing-extract-till-you-drop). Well not necessarily till I drop, but I've been trying to be more strict and look at some metrics of my code.
I have now come along an old class of mine which has a rather large swit... | 2014/02/19 | [
"https://codereview.stackexchange.com/questions/42125",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/30562/"
] | You can create a `KeyProcessor` interface and implementation for every key (move the body of the current `Processor.processStuffAboutKeyX()` methods to these classes):
```
public interface KeyProcessor {
void processStuff(String data);
}
```
Then fill a map with the available implementations:
```
Map<Key, KeyPr... | Your enum should actually be a base class with the virtual method `processStuff(string)`.
Each key should be it's own class and should implement the virtual method.
This approach is similar to answer by [Paul S](https://codereview.stackexchange.com/a/42153/30851) but is more true to OO style.
Applying the strategy pa... |
68,200,049 | I am trying to create .exe program for my python program with python styp.py build , however the terminal shows an error `raise ConfigError( cx_Freeze.exception.ConfigError: No file named C:\Users\ksabitova\Anaconda3\lib\site-packages\locket-0.2.1-py3.8.egg\locket\__init__.py (for module locket)`
It worked before on p... | 2021/06/30 | [
"https://Stackoverflow.com/questions/68200049",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16300747/"
] | You can set up the YAML pipeline like as below:
1. If you want to copy the build artifact files to the VM, reference below sample.
* In the **`Build`** stage set up the jobs to build the source code, and publish the artifact files for use.
* In the **`Deploy`** stage, when setting the **`deployment`** job with an **... | I have been struggling for a while with setting up an **Azure Pipeline** to deploy **.Net Core service** to **VM**. I had the following requirements:
1. to use YAML files instead of classic UI
2. to deploy as a windows service not to IIS
3. to use stages in pipeline
4. I was using monorepo with the service residing in... |
15,228,950 | I understand Moonlight is no longer supported by Xamarin, but I have a WPF application written on Windows that I would like to port to Linux. I want to avoid rewriting the UI code. I came across a Xamarin project called MoonlightDesktop (<http://www.mono-project.com/MoonlightDesktop>) looks like what I need, but there'... | 2013/03/05 | [
"https://Stackoverflow.com/questions/15228950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/148298/"
] | Moonlight is [dead](http://www.infoq.com/news/2012/05/Miguel-Moonlight). So unfortunately this doesn't sound like a direction to take.
I don't know of any other cross-platform WPF-compatible toolkits either. | It appears that it can be done as described in this post:
<http://walking-in-moonlight.blogspot.com/2011/05/run-wpf-applications-on-linux.html> |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | There are sometimes css or html attributes that are marked 'invalid' by some validators, but you shouldn't worry about this. Using box-shadows and rounded corners is no problem at all. Browsers that do not recognize them will simply ignore them, so no trouble there. I'd even encourage you to use those - if too many peo... | Here is another point... If you're writing a SharePoint web part, you can just about the worst possible, messy, cruffy and dodgy HTML you could possibly imagine, and your web part would feel right at home in SharePoint.
It actually amuses me seeing purists try code valid HTML strict for a MOSS plugin when the entire ... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | Invalid css/html may become horrible to maintain. Changes may have unwanted effects, which are hard to fix. | There are sometimes css or html attributes that are marked 'invalid' by some validators, but you shouldn't worry about this. Using box-shadows and rounded corners is no problem at all. Browsers that do not recognize them will simply ignore them, so no trouble there. I'd even encourage you to use those - if too many peo... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | This is no different than asking if there are advantages to writing syntactically valid C code: Such a program need not do *the right thing™* but doing the right thing without valid code will be harder.
Related discussion on SO: [Do you validate your websites?](https://stackoverflow.com/questions/170827/do-you-validat... | I'd say valid (X)HTML is a must, since this defines how your content can be accessed. Badly formed HTML can stop your content from being "read" by not only humans but also machines (think search-engines, spiders etc). Imagine if a bank held your account details in a badly formed XML file and then sent that XML to anoth... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | Because, only by knowing the rule, will you know when to break it.
Using browser-specific extensions isn't bad, but it is something you want to do *on purpose*, not blindly.
Validation points out the places where you deviate from the standard. Maybe you needed to, maybe you didn't, that decision is yours. | As long as it works in the browsers you care about then it doesn't matter. In theory your maintenance costs *might* be lower with validated code.
You have to determine what the success criteria for your project is. If your program does what your client needs then just because you code is "valid" doesn't make it more m... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | I'd say valid (X)HTML is a must, since this defines how your content can be accessed. Badly formed HTML can stop your content from being "read" by not only humans but also machines (think search-engines, spiders etc). Imagine if a bank held your account details in a badly formed XML file and then sent that XML to anoth... | Here is another point... If you're writing a SharePoint web part, you can just about the worst possible, messy, cruffy and dodgy HTML you could possibly imagine, and your web part would feel right at home in SharePoint.
It actually amuses me seeing purists try code valid HTML strict for a MOSS plugin when the entire ... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | Because, only by knowing the rule, will you know when to break it.
Using browser-specific extensions isn't bad, but it is something you want to do *on purpose*, not blindly.
Validation points out the places where you deviate from the standard. Maybe you needed to, maybe you didn't, that decision is yours. | I'll answer by an analogy. What you are saying is like saying I like building my cars with square tires, it might not be valid everywhere, but it works for me.
If you do not make a product that can be available by a maximum of people, how do you expect your product to be known and used by a maximum of people. By ignor... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | You can't test in browsers that haven't been released yet!
Browsers tend to become more standards compliant over time. If you write standards-compliant webpages, they're more likely to still work in the next version of all existing browsers. | "Valid" code isn't so much important as "semantic" code. If there are font tags all over the place and list tags that don't close, it'll be both difficult to maintain and hard to parse with strict and proper xml parsing engines. |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | I'd say valid (X)HTML is a must, since this defines how your content can be accessed. Badly formed HTML can stop your content from being "read" by not only humans but also machines (think search-engines, spiders etc). Imagine if a bank held your account details in a badly formed XML file and then sent that XML to anoth... | I'll answer by an analogy. What you are saying is like saying I like building my cars with square tires, it might not be valid everywhere, but it works for me.
If you do not make a product that can be available by a maximum of people, how do you expect your product to be known and used by a maximum of people. By ignor... |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | Validating code is one can prevent many find and hopefully fix many problems in your html/css that could cause undesired results. IMHO its more of a "common things that could be wrong" fix than a replacement for testing. If you like the look you're getting in the browsers you want, I wouldn't worry too much about the v... | "Valid" code isn't so much important as "semantic" code. If there are font tags all over the place and list tags that don't close, it'll be both difficult to maintain and hard to parse with strict and proper xml parsing engines. |
1,337,928 | If I've tested my pages in most major browsers, why would I need to maintain a validated code? I want to use box-shadows and corner radius if they're supported in WebKit browsers and Firefox. I don't care if they don't show up on Internet Explorer. But I keep my HTTP requests down by not including images instead.
Are ... | 2009/08/26 | [
"https://Stackoverflow.com/questions/1337928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/157837/"
] | Validating code is one can prevent many find and hopefully fix many problems in your html/css that could cause undesired results. IMHO its more of a "common things that could be wrong" fix than a replacement for testing. If you like the look you're getting in the browsers you want, I wouldn't worry too much about the v... | As long as it works in the browsers you care about then it doesn't matter. In theory your maintenance costs *might* be lower with validated code.
You have to determine what the success criteria for your project is. If your program does what your client needs then just because you code is "valid" doesn't make it more m... |
25,201,814 | I am trying to create a new object in my Parse.com database through Parse's REST API, using an HttpsUrlConnection. Their REST API only accepts JSON. I have gotten everything to work, where the database would accept the new object entry - except for when I attempt to include a Date field. When I do pass in a Date, the s... | 2014/08/08 | [
"https://Stackoverflow.com/questions/25201814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539344/"
] | Your format doesn't match the one they've required. For example:
```
Theirs: 2011-08-21T18:02:52.249Z
Yours: 2011-08-21 18:02:52.249
```
You're missing the `T` and the `Z`.
So try changing your format to:
```
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
```
To be honest, I'd be... | Standard Date Object is not stored in Parse. You have to set it as a JSON Object with `"__type": "Date"` and `"iso": Date_String_you_want_to_set`.
with the date string formatted as below:
```
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
``` |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [R](https://www.r-project.org/), ~~50~~ 32 bytes
================================================
```r
function(M)prod(M/2+.5)*691250/9
```
[Try it online!](https://tio.run/##bUxBCoAgELz3io5uWa1LiUFf6BWF0MUi6v2moGESwzKzs7NzWl1OjdW3Wa5tN2yG49xXNndUtwNUchQ0YDdazRZGAIXnPrAMrAILjCIm6XUwKuIOsSjRkjukmfyW3AVy5db@Dbh6Tvj5CZ... | JavaScript, 35 bytes
====================
Port of Giuseppe's R solution.
```
a=>a.map(n=>x*=++n/2,x=74429.01)&&x
```
[Try It Online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i5RLzexQCPP1q5Cy1ZbO0/fSKfC1tzExMhSz8BQU02t4n9yfl5xfk6qXk5@ukaaRrShgYEOGo7V1PwPAA) |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [R](https://www.r-project.org/), ~~50~~ 32 bytes
================================================
```r
function(M)prod(M/2+.5)*691250/9
```
[Try it online!](https://tio.run/##bUxBCoAgELz3io5uWa1LiUFf6BWF0MUi6v2moGESwzKzs7NzWl1OjdW3Wa5tN2yG49xXNndUtwNUchQ0YDdazRZGAIXnPrAMrAILjCIm6XUwKuIOsSjRkjukmfyW3AVy5db@Dbh6Tvj5CZ... | [Japt](https://github.com/ETHproductions/japt), ~~19~~ 18 bytes
===============================================================
```
rÈ*°Y/2}6028750/81
```
*-1 byte thanks to @Shaggy*
[Try it online!](https://tio.run/##y0osKPn/v@hwh9ahDZH6RrVmBkYW5qYG@haG//9HGxoY6KDhWAA "Japt – Try It Online")
With slightly less pr... |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [R](https://www.r-project.org/), ~~50~~ 32 bytes
================================================
```r
function(M)prod(M/2+.5)*691250/9
```
[Try it online!](https://tio.run/##bUxBCoAgELz3io5uWa1LiUFf6BWF0MUi6v2moGESwzKzs7NzWl1OjdW3Wa5tN2yG49xXNndUtwNUchQ0YDdazRZGAIXnPrAMrAILjCIm6XUwKuIOsSjRkjukmfyW3AVy5db@Dbh6Tvj5CZ... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 12 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
============================================================================================================================
```
>;P•₅·e•*81/
```
Port of [*@lirtosiast*'s Jelly answer](https:/... |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 16 bytes
==========================================================
```
‘HPד¡LT⁼þd+’÷Ø%
```
[Try it online!](https://tio.run/##y0rNyan8//9RwwyPgMPTHzXMObTQJ@RR457D@1K0HzXMPLz98AzV////RxsaGOig4VgA "Jelly – Try It Online")
```
‘ Add 1 to each input eleme... | JavaScript, 35 bytes
====================
Port of Giuseppe's R solution.
```
a=>a.map(n=>x*=++n/2,x=74429.01)&&x
```
[Try It Online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i5RLzexQCPP1q5Cy1ZbO0/fSKfC1tzExMhSz8BQU02t4n9yfl5xfk6qXk5@ukaaRrShgYEOGo7V1PwPAA) |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 16 bytes
==========================================================
```
‘HPד¡LT⁼þd+’÷Ø%
```
[Try it online!](https://tio.run/##y0rNyan8//9RwwyPgMPTHzXMObTQJ@RR457D@1K0HzXMPLz98AzV////RxsaGOig4VgA "Jelly – Try It Online")
```
‘ Add 1 to each input eleme... | [Japt](https://github.com/ETHproductions/japt), ~~19~~ 18 bytes
===============================================================
```
rÈ*°Y/2}6028750/81
```
*-1 byte thanks to @Shaggy*
[Try it online!](https://tio.run/##y0osKPn/v@hwh9ahDZH6RrVmBkYW5qYG@haG//9HGxoY6KDhWAA "Japt – Try It Online")
With slightly less pr... |
180,722 | So I ran into this progressive/idle game cleverly called [Idle Dice](https://www.kongregate.com/games/Luts91/idle-dice). Has a variety of random effects applied to a pretty typical progression formula game. Warning, time sink! Play at your own risk.
However after you have 5 dice (summed the usual way) along with some ... | 2019/03/01 | [
"https://codegolf.stackexchange.com/questions/180722",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/47990/"
] | [Jelly](https://github.com/DennisMitchell/jelly), 16 bytes
==========================================================
```
‘HPד¡LT⁼þd+’÷Ø%
```
[Try it online!](https://tio.run/##y0rNyan8//9RwwyPgMPTHzXMObTQJ@RR457D@1K0HzXMPLz98AzV////RxsaGOig4VgA "Jelly – Try It Online")
```
‘ Add 1 to each input eleme... | [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 12 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
============================================================================================================================
```
>;P•₅·e•*81/
```
Port of [*@lirtosiast*'s Jelly answer](https:/... |
16,932,913 | markup :
```
<div>
<span class="left"></span>
<table></table>
<span class="right"></span>
</div>
```
Desired output :
```
|------------------------------------------------------------------------|
| | | |
|.left | ... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16932913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1412255/"
] | You can use `float`, also using `span` as a container is not a good idea. Instead use `div`. Also put your `table` inside a `div`:
```css
.container {
overflow: hidden;
}
.left {
float: left;
width: 100px;
background: yellow;
}
.right {
float: right;
width: 100px;
background: yellow;
}
.main... | If you want to preserve your markup you can use the `calc()` property.
You could float left your `<span>`and the table, and set the width of the table as this:
```
table {border-collapse:collapse; width:calc(100% - 2em); float:left;}
```
With this solution, the table is really 100% width, instead a background trick... |
16,932,913 | markup :
```
<div>
<span class="left"></span>
<table></table>
<span class="right"></span>
</div>
```
Desired output :
```
|------------------------------------------------------------------------|
| | | |
|.left | ... | 2013/06/05 | [
"https://Stackoverflow.com/questions/16932913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1412255/"
] | The solution is `display:block;` and `position`. Actually, you should use div in this case and we can omit `display:block` if you use div
```
.left{
position:absolute;
left:0;
top:0;
display:block;
width:20px;
border:1px solid black;
}
.right{
position:absolute;
right:0;
top:0;
... | If you want to preserve your markup you can use the `calc()` property.
You could float left your `<span>`and the table, and set the width of the table as this:
```
table {border-collapse:collapse; width:calc(100% - 2em); float:left;}
```
With this solution, the table is really 100% width, instead a background trick... |
57,568,280 | I have a dynamic buttons where it produced from my database
[](https://i.stack.imgur.com/9PE81.png)
My code for that in blade file
```
<div class="input-group col-sm-12">
<!--start of the form-->
<form class="form-horizontal" method="PO... | 2019/08/20 | [
"https://Stackoverflow.com/questions/57568280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9322968/"
] | When you click either button, they will submit their parent form. Because both are under the same form, the data from the first button will be submitted. You will have to make a separate form for each button in order to have them submit their own data.
```
<div class="input-group col-sm-12">
@foreach($departments ... | You're creating multiple submit buttons in the same form.
Add the tag inside the loop so you have a unique form per case.
When there's multiple submit buttons inside the same form, the loop will finish and only the last results will be mapped to the buttons, thus is will submit the last information in your loop.
```p... |
41,412,472 | 
How to change the background-color
as you can see in above image? I want to change color after last `li` and in `ul`. I do not want to add a new `li`, just set the overall background-color for `ul`, and change the background color as mentioned in the im... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5134618/"
] | Instead of a for loop you could also use the `Foreach-Object` cmdlet (if you prefer using the pipeline):
```
$str = "apple","lemon","toast"
$str = $str | ForEach-Object {"Week$_"}
```
**Output:**
```
Weekapple
Weeklemon
Weektoast
``` | Something like this will work for prepending/appending text to each line in an array.
Set array $str:
```
$str = "apple","lemon","toast"
$str
apple
lemon
toast
```
Prepend text now:
```
for ($i=0; $i -lt $Str.Count; $i++) {
$str[$i] = "yogurt" + $str[$i]
}
$str
yogurtapple
yogurtlemon
yogurttoast
```
This ... |
41,412,472 | 
How to change the background-color
as you can see in above image? I want to change color after last `li` and in `ul`. I do not want to add a new `li`, just set the overall background-color for `ul`, and change the background color as mentioned in the im... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5134618/"
] | Something like this will work for prepending/appending text to each line in an array.
Set array $str:
```
$str = "apple","lemon","toast"
$str
apple
lemon
toast
```
Prepend text now:
```
for ($i=0; $i -lt $Str.Count; $i++) {
$str[$i] = "yogurt" + $str[$i]
}
$str
yogurtapple
yogurtlemon
yogurttoast
```
This ... | Another solution, which is fast and concise, albeit a bit obscure.
It uses the [regex](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Regular_Expressions)-based **[`-replace` operator](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_C... |
41,412,472 | 
How to change the background-color
as you can see in above image? I want to change color after last `li` and in `ul`. I do not want to add a new `li`, just set the overall background-color for `ul`, and change the background color as mentioned in the im... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5134618/"
] | Instead of a for loop you could also use the `Foreach-Object` cmdlet (if you prefer using the pipeline):
```
$str = "apple","lemon","toast"
$str = $str | ForEach-Object {"Week$_"}
```
**Output:**
```
Weekapple
Weeklemon
Weektoast
``` | Another option for PowerShell v4+
```
$str = $str.ForEach({ "Week" + $Week + $_ })
``` |
41,412,472 | 
How to change the background-color
as you can see in above image? I want to change color after last `li` and in `ul`. I do not want to add a new `li`, just set the overall background-color for `ul`, and change the background color as mentioned in the im... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5134618/"
] | Instead of a for loop you could also use the `Foreach-Object` cmdlet (if you prefer using the pipeline):
```
$str = "apple","lemon","toast"
$str = $str | ForEach-Object {"Week$_"}
```
**Output:**
```
Weekapple
Weeklemon
Weektoast
``` | Another solution, which is fast and concise, albeit a bit obscure.
It uses the [regex](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Regular_Expressions)-based **[`-replace` operator](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_C... |
41,412,472 | 
How to change the background-color
as you can see in above image? I want to change color after last `li` and in `ul`. I do not want to add a new `li`, just set the overall background-color for `ul`, and change the background color as mentioned in the im... | 2017/01/01 | [
"https://Stackoverflow.com/questions/41412472",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5134618/"
] | Another option for PowerShell v4+
```
$str = $str.ForEach({ "Week" + $Week + $_ })
``` | Another solution, which is fast and concise, albeit a bit obscure.
It uses the [regex](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_Regular_Expressions)-based **[`-replace` operator](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_C... |
46,725,820 | I'm working on a textbased adventure in the Console with items, shop and so on.
Now I wanna shorten down the code for buying swords by using classes. I put the swords definition in a seperate function and the code to randomize the swords you can buy in an other:
```
namespace Text_Adventure
{
class Game
{
/... | 2017/10/13 | [
"https://Stackoverflow.com/questions/46725820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8769966/"
] | The question is not clear but I assume you want to get the rows having the value of `Entrada` in April 2017, between `8:30` and `18:00`.
The query you posted should work fine but, because of the use of functions (`DATE(Entrada)`, `TIME(Entrada)`) it cannot use an index. It processes the entire table and it will run mo... | Try to use `EXTRACT()` function of MYSQL (see [here](https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions052.htm)) |
47,421,532 | I am trying to set up a redirect when a page loads if the user is or is not signed in.
My HTML file where I initialize gapi:
```
<script src="https://apis.google.com/js/client:platform.js?onload=start" async defer></script>
<script>
function start() {
console.log('script runni... | 2017/11/21 | [
"https://Stackoverflow.com/questions/47421532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/986012/"
] | You are adding a lot of JavaScript logic to your `index.html` file and it may be confusing you because well you are having to go back and forth between `index.html` and your `Options.js` and `Login.js`.
Consider the following, for your `index.html`, only put this in there:
`<script src="https://apis.google.com/js/api... | `getAuthInstance` requires `init` to be called before being used. My assumption is that the Google API is storing your auth session in Local Storage (you check this in the browser) which is why you're able to use your `checkUserData()` method. But on page refresh the init function isn't being called, thus the auth inst... |
47,421,532 | I am trying to set up a redirect when a page loads if the user is or is not signed in.
My HTML file where I initialize gapi:
```
<script src="https://apis.google.com/js/client:platform.js?onload=start" async defer></script>
<script>
function start() {
console.log('script runni... | 2017/11/21 | [
"https://Stackoverflow.com/questions/47421532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/986012/"
] | You can try to use my package: [gapi-script](https://github.com/partnerhero/gapi-script), this package provides the gapi function right way, so you don't have to wait the script load.
Also check out this example that does exactly what you're trying to do, [example that checks if user is logged in or not, with gapi-sc... | `getAuthInstance` requires `init` to be called before being used. My assumption is that the Google API is storing your auth session in Local Storage (you check this in the browser) which is why you're able to use your `checkUserData()` method. But on page refresh the init function isn't being called, thus the auth inst... |
47,421,532 | I am trying to set up a redirect when a page loads if the user is or is not signed in.
My HTML file where I initialize gapi:
```
<script src="https://apis.google.com/js/client:platform.js?onload=start" async defer></script>
<script>
function start() {
console.log('script runni... | 2017/11/21 | [
"https://Stackoverflow.com/questions/47421532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/986012/"
] | You are adding a lot of JavaScript logic to your `index.html` file and it may be confusing you because well you are having to go back and forth between `index.html` and your `Options.js` and `Login.js`.
Consider the following, for your `index.html`, only put this in there:
`<script src="https://apis.google.com/js/api... | You can try to use my package: [gapi-script](https://github.com/partnerhero/gapi-script), this package provides the gapi function right way, so you don't have to wait the script load.
Also check out this example that does exactly what you're trying to do, [example that checks if user is logged in or not, with gapi-sc... |
68,732,622 | I am trying to update a few values of a specific entry of an Elasticsearch Index. I can see the data in the terminal by
```sh
curl -X GET "localhost:9200/pelias/_doc/custompoi:restaurant:33316604?pretty"
```
which returning
```json
{
"_index" : "pelias",
"_type" : "_doc",
"_id" : "custompoi:restaurant:3331660... | 2021/08/10 | [
"https://Stackoverflow.com/questions/68732622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1357214/"
] | You cannot configure the `_id` field mapping, as mentioned in the [elasticsearch official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-id-field.html#mapping-id-field).
But there is one way, you can update your data based on the `_id` field.
Create a new index having a `id` fi... | Your best bet is to add that numeric value or entire string as another field ( not \_id field) in the document and use it for search. `_id` field is a bit [special](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/mapping-id-field.html#mapping-id-field); not all queries are supported there. |
65,158,074 | I want to implement a button. It is like this when it's not hovered:
[](https://i.stack.imgur.com/QBdOz.png)
the transparent rounded-bourder rectangle in the right is supposed to move left and cover the entire button in 1 second, when hovered. so, after hover, we'... | 2020/12/05 | [
"https://Stackoverflow.com/questions/65158074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12461032/"
] | You should consider making your entire class parametrized.
```
public class RequestManager<T extends Response> {
private Map<String, CompletableFuture<T>> requests = new ConcurrentHashMap<>();
public void callback(String reqId, T resp) {
this.requests.get(reqId).complete(resp);
}
}
```
In this c... | Consider two sibling subclasses of `Response`, for instance `ByteResponse` and `IntResponse`. With what you wrote, the following would compile:
```
CompletableFuture<ByteResponse> byteRequest = new CompletableFuture<>();
requests.put("id", byteRequest);
callback("id", new IntResponse());
```
`byteRequest` could be a... |
20,278 | I am concerned that that postal mail (and other deliveries not requiring a signature) may be at risk from theft or unauthorised access. My company is based in a multi-tenant office with an unattended reception and no CCTV. When the postman visits, he buzzes one of the offices on the intercom who let him into the recept... | 2012/09/17 | [
"https://security.stackexchange.com/questions/20278",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/13137/"
] | * Make sure the postman buzzes your offices, and have a procedure to immediately go collect your mail.
* Figure out when the postman delivers (it's probably about the same time every day) and schedule someone to go down at that time.
* Arrange for your mail to be held at the post office, not delivered, and send someone... | Set up a drop-box for the mailman, with a sign-out sheet for the keys to minimize the potential number of thieves and establish some pretense of logging. |
20,278 | I am concerned that that postal mail (and other deliveries not requiring a signature) may be at risk from theft or unauthorised access. My company is based in a multi-tenant office with an unattended reception and no CCTV. When the postman visits, he buzzes one of the offices on the intercom who let him into the recept... | 2012/09/17 | [
"https://security.stackexchange.com/questions/20278",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/13137/"
] | * Make sure the postman buzzes your offices, and have a procedure to immediately go collect your mail.
* Figure out when the postman delivers (it's probably about the same time every day) and schedule someone to go down at that time.
* Arrange for your mail to be held at the post office, not delivered, and send someone... | The solutions are quite obvious:
1. Purchase a secure PO Box offsite,
2. Ask your postman (post a sign) saying please buzz your office for all deliveries addressed to you and send down staff to receive packages,
3. Move to your own place,
4. Hire a receptionist for the front desk yourself,
5. Install a shared locked m... |
20,278 | I am concerned that that postal mail (and other deliveries not requiring a signature) may be at risk from theft or unauthorised access. My company is based in a multi-tenant office with an unattended reception and no CCTV. When the postman visits, he buzzes one of the offices on the intercom who let him into the recept... | 2012/09/17 | [
"https://security.stackexchange.com/questions/20278",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/13137/"
] | The solutions are quite obvious:
1. Purchase a secure PO Box offsite,
2. Ask your postman (post a sign) saying please buzz your office for all deliveries addressed to you and send down staff to receive packages,
3. Move to your own place,
4. Hire a receptionist for the front desk yourself,
5. Install a shared locked m... | Set up a drop-box for the mailman, with a sign-out sheet for the keys to minimize the potential number of thieves and establish some pretense of logging. |
24,263,521 | Assuming we had this class
```
final class Foo {
private final Set<String> bar = new HashSet<>();
public Foo() {
bar.add("one");
bar.add("two");
bar.add("three");
}
public boolean contains(final String s) {
return bar.contains(s);
}
}
```
Would it be threadsafe t... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/854600/"
] | Your `Foo` and `bar` are actually immutable. it is thread-safe. | As long as this is accessed in a read only manner I think you should be safe. Also , java offers immutable versions of it's base collections exposed through static methods on the Collections class , so I would look at `Collections.unmodifiableSet()` .
Also , while you add strings in your example, and strings themselv... |
24,263,521 | Assuming we had this class
```
final class Foo {
private final Set<String> bar = new HashSet<>();
public Foo() {
bar.add("one");
bar.add("two");
bar.add("three");
}
public boolean contains(final String s) {
return bar.contains(s);
}
}
```
Would it be threadsafe t... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/854600/"
] | Your `Foo` and `bar` are actually immutable. it is thread-safe. | It is thread safe provided that
1) The constructor does not leak a reference before its fully constructed.
2) No one has any way to access the collection.
3) No subclass can be created which can edit the collection.
As a general rule though, if you want to implement this use an immutable collection from guava, tha... |
24,263,521 | Assuming we had this class
```
final class Foo {
private final Set<String> bar = new HashSet<>();
public Foo() {
bar.add("one");
bar.add("two");
bar.add("three");
}
public boolean contains(final String s) {
return bar.contains(s);
}
}
```
Would it be threadsafe t... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/854600/"
] | Your `Foo` and `bar` are actually immutable. it is thread-safe. | It depends on how the access to this object is published. While the `bar` `Set` is final and thus guaranteed to visible to all threads, the population of the map is not guaranteed to happen before the conclusion of constructor.
This, however would be guaranteed to be thread safe regardless of how the object was create... |
24,263,521 | Assuming we had this class
```
final class Foo {
private final Set<String> bar = new HashSet<>();
public Foo() {
bar.add("one");
bar.add("two");
bar.add("three");
}
public boolean contains(final String s) {
return bar.contains(s);
}
}
```
Would it be threadsafe t... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/854600/"
] | It is thread safe provided that
1) The constructor does not leak a reference before its fully constructed.
2) No one has any way to access the collection.
3) No subclass can be created which can edit the collection.
As a general rule though, if you want to implement this use an immutable collection from guava, tha... | As long as this is accessed in a read only manner I think you should be safe. Also , java offers immutable versions of it's base collections exposed through static methods on the Collections class , so I would look at `Collections.unmodifiableSet()` .
Also , while you add strings in your example, and strings themselv... |
24,263,521 | Assuming we had this class
```
final class Foo {
private final Set<String> bar = new HashSet<>();
public Foo() {
bar.add("one");
bar.add("two");
bar.add("three");
}
public boolean contains(final String s) {
return bar.contains(s);
}
}
```
Would it be threadsafe t... | 2014/06/17 | [
"https://Stackoverflow.com/questions/24263521",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/854600/"
] | It depends on how the access to this object is published. While the `bar` `Set` is final and thus guaranteed to visible to all threads, the population of the map is not guaranteed to happen before the conclusion of constructor.
This, however would be guaranteed to be thread safe regardless of how the object was create... | As long as this is accessed in a read only manner I think you should be safe. Also , java offers immutable versions of it's base collections exposed through static methods on the Collections class , so I would look at `Collections.unmodifiableSet()` .
Also , while you add strings in your example, and strings themselv... |
1,365,022 | I have a function which returns a one-sided intersection of values between two input maps:
```
Map<Key, Value> mergeMaps(Map aKeys<CompositeKey, Key>,
Map <CompositeKey, Value> aValues) {
Map<Key, Value> myResult = Maps.newHashMap();
for (CompositeKey myKey : aKeys.keySet()) {
if (aValues.co... | 2009/09/01 | [
"https://Stackoverflow.com/questions/1365022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1266/"
] | I think this signature should do what you want:
```
<T, K, V> Map<K, V> mergeMaps(Map<T, K> aKeys, Map<T, V> aValues)
``` | For a completely generic form you can have
```
public <T, K, V> Map<K, V> mergeMaps(Map<T, K> aKeys, Map<T, V> aValues)
```
If K and V are set in the class you can take them out.
For a case where you want to specify a relation between T and K, V you might want something
like
```
public <K, V, T extends Composite... |
58,217,760 | Currently using AWS services to create a PCM audio file by using Polly and storing it, into S3 bucket. The application is doing all that using AWS lambda.
I am using, "StartSpeechSynthesisTaskRequest", which allows the user to, create a request to amazon Polly and have the file delivered straight into a designated S3 ... | 2019/10/03 | [
"https://Stackoverflow.com/questions/58217760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6817111/"
] | Use awk command instead
```
docker images | grep "none" | awk '{print $3}' | xargs docker rmi
``` | Based on dov answer this make more sense to me:
EDIT:
As Mark suggested this is shorter and cleaner.
```
docker rmi $(docker images | awk ' /none/ {print $3}')
``` |
23,021,129 | I have an array that is filled with dictionaries, one for each day. Inside each dictionary I have a list of exercises and inside each exercise is an array with two values. The program I am writing has a picker for several workout programs which is saved as an integer called programInt. I also have a method which conver... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23021129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3334789/"
] | Sometimes it's very useful to actually make use of named variables
```
// Create an array of programs
NSMutableArray* programArray = [NSMutableArray array];
self.liftData = programArray;
for (int programIndex = 0; programIndex < ....???...) {
// Add an array of days to the program
NSMutableArray* dayArray = ... | Can you just add one more NSMutableArray?
```
// create array
self.liftData = [NSMutableArray array];
NSMutableArray *programmArray = [NSMutableArray array];
[self.liftData addObject:programmArray];
// fill array with dictionaries, one for each day
for (int i = 0; i < 5; i++){
[programmArray setObject:[NSMutable... |
23,021,129 | I have an array that is filled with dictionaries, one for each day. Inside each dictionary I have a list of exercises and inside each exercise is an array with two values. The program I am writing has a picker for several workout programs which is saved as an integer called programInt. I also have a method which conver... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23021129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3334789/"
] | Sometimes it's very useful to actually make use of named variables
```
// Create an array of programs
NSMutableArray* programArray = [NSMutableArray array];
self.liftData = programArray;
for (int programIndex = 0; programIndex < ....???...) {
// Add an array of days to the program
NSMutableArray* dayArray = ... | I think Avt's answer missed one layer. Before an answer, let me say this: sometimes when your data representation gets complicated and deep enough, it makes sense to create some classes and abstract away the internal representation so you can use readable method names. For example, `[myProgram getExerciseArrayForDay:CO... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | This code returns a 2d array.
```
#include <cstdio>
// Returns a pointer to a newly created 2d array the array2D has size [height x width]
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
... | ```
#include <iostream>
using namespace std ;
typedef int (*Type)[3][3] ;
Type Demo_function( Type ); //prototype
int main (){
cout << "\t\t!!!!!Passing and returning 2D array from function!!!!!\n"
int array[3][3] ;
Type recieve , ptr = &array;
recieve = Demo_function( ptr ) ;
for ( int i = 0 ;... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | This code returns a 2d array.
```
#include <cstdio>
// Returns a pointer to a newly created 2d array the array2D has size [height x width]
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
... | Whatever changes you would make in function will persist.So there is no need to return anything.You can pass 2d array and change it whenever you will like.
```
void MakeGridOfCounts(int Grid[][6])
{
cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
}
```
or
```
void MakeGridOfCounts(int Gri... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | This code returns a 2d array.
```
#include <cstdio>
// Returns a pointer to a newly created 2d array the array2D has size [height x width]
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
... | ```
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
array2D[h] = new int[width];
for (int w = 0; w < width; w++)
{
// fill in some initial values
// ... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | This code returns a 2d array.
```
#include <cstdio>
// Returns a pointer to a newly created 2d array the array2D has size [height x width]
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
... | The function returns a static 2D array
```
const int N = 6;
int (*(MakeGridOfCounts)())[N] {
static int cGrid[N][N] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
int main() {
int (*arr)[N];
arr = MakeGridOfCounts();
}
```
You need to make the array static since it will be having a block scope, whe... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | I would suggest you [Matrix library](https://github.com/pwwiur/Matrix) as an open source tool for c++, its usage is like arrays in c++. Here you can see [documention](https://www.amirforsati.ir/doc/11).
```
Matrix funcionName(){
Matrix<int> arr(2, 2);
arr[0][0] = 5;
arr[0][1] = 10;
arr[1][0] = 0;
... | ```
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
array2D[h] = new int[width];
for (int w = 0; w < width; w++)
{
// fill in some initial values
// ... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | A better alternative to using pointers to pointers is to use `std::vector`. That takes care of the details of memory allocation and deallocation.
```
std::vector<std::vector<int>> create2DArray(unsigned height, unsigned width)
{
return std::vector<std::vector<int>>(height, std::vector<int>(width, 0));
}
``` | That code isn't going to work, and it's not going to help you learn proper C++ if we fix it. It's better if you do something different. Raw arrays (especially multi-dimensional arrays) are difficult to pass correctly to and from functions. I think you'll be much better off starting with an object that *represents an ar... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | A better alternative to using pointers to pointers is to use `std::vector`. That takes care of the details of memory allocation and deallocation.
```
std::vector<std::vector<int>> create2DArray(unsigned height, unsigned width)
{
return std::vector<std::vector<int>>(height, std::vector<int>(width, 0));
}
``` | ```
#include <iostream>
using namespace std ;
typedef int (*Type)[3][3] ;
Type Demo_function( Type ); //prototype
int main (){
cout << "\t\t!!!!!Passing and returning 2D array from function!!!!!\n"
int array[3][3] ;
Type recieve , ptr = &array;
recieve = Demo_function( ptr ) ;
for ( int i = 0 ;... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | What you are (trying to do)/doing in your snippet is to return a local variable from the function, which is not at all recommended - nor is it allowed according to the standard.
If you'd like to create a `int[6][6]` from your function you'll either have to allocate memory for it on the free-store (ie. using *new T/mal... | ```
#include <iostream>
using namespace std ;
typedef int (*Type)[3][3] ;
Type Demo_function( Type ); //prototype
int main (){
cout << "\t\t!!!!!Passing and returning 2D array from function!!!!!\n"
int array[3][3] ;
Type recieve , ptr = &array;
recieve = Demo_function( ptr ) ;
for ( int i = 0 ;... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | This code returns a 2d array.
```
#include <cstdio>
// Returns a pointer to a newly created 2d array the array2D has size [height x width]
int** create2DArray(unsigned height, unsigned width)
{
int** array2D = 0;
array2D = new int*[height];
for (int h = 0; h < height; h++)
{
... | What you are (trying to do)/doing in your snippet is to return a local variable from the function, which is not at all recommended - nor is it allowed according to the standard.
If you'd like to create a `int[6][6]` from your function you'll either have to allocate memory for it on the free-store (ie. using *new T/mal... |
8,617,683 | Hi I am a newbie to C++
I am trying to return a 2d array from a function.
It is something like this
```
int **MakeGridOfCounts(int Grid[][6])
{
int cGrid[6][6] = {{0, }, {0, }, {0, }, {0, }, {0, }, {0, }};
return cGrid;
}
``` | 2011/12/23 | [
"https://Stackoverflow.com/questions/8617683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047092/"
] | That code isn't going to work, and it's not going to help you learn proper C++ if we fix it. It's better if you do something different. Raw arrays (especially multi-dimensional arrays) are difficult to pass correctly to and from functions. I think you'll be much better off starting with an object that *represents an ar... | returning an array of pointers pointing to starting elements of all rows is the only decent way of returning 2d array. |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you are uploading your files through GIT from your local machine then you can use the same command you are using in your local machine while you are connected to your live server using BASH or something like.You can use this as like you use locally.
```
php artisan cache:clear
php artisan route:cache
```
It shou... | you can define a route in web.php
```
Route::get('/clear/route', 'ConfigController@clearRoute');
```
and make ConfigController.php like this
```
class ConfigController extends Controller
{
public function clearRoute()
{
\Artisan::call('route:clear');
}
}
```
and go to that route on server... |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you want to remove the routes cache on your server, remove this file:
`bootstrap/cache/routes.php`
And if you want to update it just run `php artisan route:cache` and upload the `bootstrap/cache/routes.php` to your server. | If you are uploading your files through GIT from your local machine then you can use the same command you are using in your local machine while you are connected to your live server using BASH or something like.You can use this as like you use locally.
```
php artisan cache:clear
php artisan route:cache
```
It shou... |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | For your case solution is :
```
php artisan cache:clear
php artisan route:cache
```
**Optimizing Route Loading is a must on production :**
If you are building a large application with many routes, you should make sure that you are running the route:cache Artisan command during your deployment process:
```
php arti... | you can define a route in web.php
```
Route::get('/clear/route', 'ConfigController@clearRoute');
```
and make ConfigController.php like this
```
class ConfigController extends Controller
{
public function clearRoute()
{
\Artisan::call('route:clear');
}
}
```
and go to that route on server... |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | For your case solution is :
```
php artisan cache:clear
php artisan route:cache
```
**Optimizing Route Loading is a must on production :**
If you are building a large application with many routes, you should make sure that you are running the route:cache Artisan command during your deployment process:
```
php arti... | I recommend you to use `php artisan optimize` instead.
`optimaze` performs the following tasks:
* Configuration cache successfully cleared.
* Configuration cache successfully cached.
* Routes cache successfully cleared.
* Routes successfully cached.
* Files successfully cached.
Also, you have it in one command. |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you are uploading your files through GIT from your local machine then you can use the same command you are using in your local machine while you are connected to your live server using BASH or something like.You can use this as like you use locally.
```
php artisan cache:clear
php artisan route:cache
```
It shou... | I recommend you to use `php artisan optimize` instead.
`optimaze` performs the following tasks:
* Configuration cache successfully cleared.
* Configuration cache successfully cached.
* Routes cache successfully cleared.
* Routes successfully cached.
* Files successfully cached.
Also, you have it in one command. |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you want to remove the routes cache on your server, remove this file:
`bootstrap/cache/routes.php`
And if you want to update it just run `php artisan route:cache` and upload the `bootstrap/cache/routes.php` to your server. | **Clear Cache On Shared Host Without Artisan Commands**
**How to Clear Route Cache from Browser**
```
Route::get('/route-cache', function() {
$exitCode = Artisan::call('route:cache');
return 'Routes cache cleared';
});
```
**How to Clear Config Cache from Browser**
```
Route::get('/config-cache', func... |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you want to remove the routes cache on your server, remove this file:
`bootstrap/cache/routes.php`
And if you want to update it just run `php artisan route:cache` and upload the `bootstrap/cache/routes.php` to your server. | I recommend you to use `php artisan optimize` instead.
`optimaze` performs the following tasks:
* Configuration cache successfully cleared.
* Configuration cache successfully cached.
* Routes cache successfully cleared.
* Routes successfully cached.
* Files successfully cached.
Also, you have it in one command. |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | you can define a route in web.php
```
Route::get('/clear/route', 'ConfigController@clearRoute');
```
and make ConfigController.php like this
```
class ConfigController extends Controller
{
public function clearRoute()
{
\Artisan::call('route:clear');
}
}
```
and go to that route on server... | I recommend you to use `php artisan optimize` instead.
`optimaze` performs the following tasks:
* Configuration cache successfully cleared.
* Configuration cache successfully cached.
* Routes cache successfully cleared.
* Routes successfully cached.
* Files successfully cached.
Also, you have it in one command. |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | For your case solution is :
```
php artisan cache:clear
php artisan route:cache
```
**Optimizing Route Loading is a must on production :**
If you are building a large application with many routes, you should make sure that you are running the route:cache Artisan command during your deployment process:
```
php arti... | **Clear Cache On Shared Host Without Artisan Commands**
**How to Clear Route Cache from Browser**
```
Route::get('/route-cache', function() {
$exitCode = Artisan::call('route:cache');
return 'Routes cache cleared';
});
```
**How to Clear Config Cache from Browser**
```
Route::get('/config-cache', func... |
37,878,951 | This is regarding route cache on localhost
About Localhost
===============
I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a small problem below.
if I comment any one route in my route.php file and then run below command
```
php a... | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726802/"
] | If you are uploading your files through GIT from your local machine then you can use the same command you are using in your local machine while you are connected to your live server using BASH or something like.You can use this as like you use locally.
```
php artisan cache:clear
php artisan route:cache
```
It shou... | **Clear Cache On Shared Host Without Artisan Commands**
**How to Clear Route Cache from Browser**
```
Route::get('/route-cache', function() {
$exitCode = Artisan::call('route:cache');
return 'Routes cache cleared';
});
```
**How to Clear Config Cache from Browser**
```
Route::get('/config-cache', func... |
55,944,622 | What's the best way to abstract and fix this code? I'm relatively new to coding and pygame, and need some help finishing this project. It's due tomorrow, and any help would be greatly appreciated.
My goal is to create a rocket game where my spaceship should dodge blocks and collect coins, and ultimately winning the g... | 2019/05/02 | [
"https://Stackoverflow.com/questions/55944622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11351836/"
] | I read your source code. **parseXML** function appends parsed data on every function call. You should initialize **html** variable inside **parseXML** function as below.
**script.js**
```
var xmlHTTPobject= new XMLHttpRequest();
var html=""; // <= The variable won't be cleared at every function call.
function parseXM... | Just manually empty the HTML content:
```js
function showBookTicketsScreen() {
$("#roomLayout").html("");
}
function more() {
$("#roomLayout").append("Text<br>");
}
```
```html
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<button onclick="showBookTicketsScreen()">Empty</button>
<button ... |
55,944,622 | What's the best way to abstract and fix this code? I'm relatively new to coding and pygame, and need some help finishing this project. It's due tomorrow, and any help would be greatly appreciated.
My goal is to create a rocket game where my spaceship should dodge blocks and collect coins, and ultimately winning the g... | 2019/05/02 | [
"https://Stackoverflow.com/questions/55944622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11351836/"
] | I read your source code. **parseXML** function appends parsed data on every function call. You should initialize **html** variable inside **parseXML** function as below.
**script.js**
```
var xmlHTTPobject= new XMLHttpRequest();
var html=""; // <= The variable won't be cleared at every function call.
function parseXM... | ```js
$('#append').click(function() {
$('#roomLayout').append('More stuff<br/>');
});
$('#clear').click(function() {
$('#roomLayout').html('');
});
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button id="append">Append</button>
<button id="clear">C... |
71,592,391 | there is a function that `Definition constant {X:Type} (c:X) := fun x y : X => y = c.`
prove that: `Theorem const_not_sur : forall c:nat, ~surjective (constant c).`
I did:
```
unfold not.
unfold surjective.
unfold constant.
intros.
destruct (H 1) as [x H1].
destruct x.
induction c.
symmetry in H1.
discriminate.
```
... | 2022/03/23 | [
"https://Stackoverflow.com/questions/71592391",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18477771/"
] | Only iphone detection is working but ipad detection not working. But in my case to change the background the setInterval function worked.
```js
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS && window.matchMedia("(max-width: 615px)").matches) {
console.log("This is an IOS dev... | Works for me. I’ve used `backgroundColor` to make it more specific
```
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
document.body.style.backgroundColor = "rgba(0,0,0,1)";
console.log('This is an iOS device');
} else {
console.log('This is Not an iOS device');
}
```
... |
22,218,121 | I have in grid in one column long text which should be truncated in grid (ends with ...) but should show whole in popover.
The popover is displaying correctly when there are spaces in my text. For text with no spaces popover is displaying incorrectly. See examples below
Incorrect popover:
 property to the `.popover` box by default (Which is `max-width: 276px;`).
There are two options:
**1)** Override the `max-width` by reseting that to `none` as:
```css
.popover {
max-width: none;
}... | Since 2012 another solution for word-wrap is:
`overflow-wrap:anywhere;`
More information: [Difference between overflow-wrap and word-break?](https://stackoverflow.com/questions/17259916/difference-between-overflow-wrap-and-word-break)
Examples of use: <https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap> ... |
4,283,220 | Dumb question, but somehow interesting. Is it just thr $\_GET-limit or do they have some other techniques ? | 2010/11/26 | [
"https://Stackoverflow.com/questions/4283220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496965/"
] | For the Google Search API:
`There is a limit of 320 characters returned for each meta tag when using getfields.`
**Usage**
```
GET /search?q=[search term]&output=xml&client=test&site=test&getfields=[meta tag name]
```
<http://code.google.com/apis/searchappliance/documentation/50/xml_reference.html> | LOL. check the HTML input maxlength on google homepage.
```
<input autocomplete="off" class="lst" type="text" name="q" maxlength="2048" value="" title="Search" spellcheck="false">
``` |
4,283,220 | Dumb question, but somehow interesting. Is it just thr $\_GET-limit or do they have some other techniques ? | 2010/11/26 | [
"https://Stackoverflow.com/questions/4283220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496965/"
] | 2048 is the right answer
```
<input autocomplete="off" class="lst" type="text" name="q" maxlength="2048" value="" title="Search" spellcheck="false">
```
hope so it will help you. | LOL. check the HTML input maxlength on google homepage.
```
<input autocomplete="off" class="lst" type="text" name="q" maxlength="2048" value="" title="Search" spellcheck="false">
``` |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Writing XML using JAXB (Java Architecture for XML Binding):
<http://www.mkyong.com/java/jaxb-hello-world-example/>
```
package com.mkyong.core;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Cu... | The answers only cover DOM / SAX and a copy paste implementation of a JAXB example.
However, one big area of when you are using XML is missing. In many projects / programs there is a need to store / retrieve some basic data structures. Your program has already a classes for your nice and shiny business objects / data ... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Here is a quick DOM example that shows how to read and write a simple xml file with its dtd:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE roles SYSTEM "roles.dtd">
<roles>
<role1>User</role1>
<role2>Author</role2>
<role3>Admin</role3>
<role4/>
</roles>
```
and the dtd:
```
<?... | Writing XML using JAXB (Java Architecture for XML Binding):
<http://www.mkyong.com/java/jaxb-hello-world-example/>
```
package com.mkyong.core;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Cu... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Here is a quick DOM example that shows how to read and write a simple xml file with its dtd:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE roles SYSTEM "roles.dtd">
<roles>
<role1>User</role1>
<role2>Author</role2>
<role3>Admin</role3>
<role4/>
</roles>
```
and the dtd:
```
<?... | The above answer only deal with DOM parser (that normally reads the entire file in memory and parse it, what for a big file is a problem), you could use a SAX parser that uses less memory and is faster (anyway that depends on your code).
SAX parser callback some functions when it find a start of element, end of elemen... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Writing XML using JAXB (Java Architecture for XML Binding):
<http://www.mkyong.com/java/jaxb-hello-world-example/>
```
package com.mkyong.core;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Cu... | `SAX` parser is working differently with a `DOM` parser, it neither load any `XML` document into memory nor create any object representation of the `XML` document. Instead, the `SAX` parser use callback function `org.xml.sax.helpers.DefaultHandler` to informs clients of the `XML` document structure.
`SAX` Parser is fa... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Here is a quick DOM example that shows how to read and write a simple xml file with its dtd:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE roles SYSTEM "roles.dtd">
<roles>
<role1>User</role1>
<role2>Author</role2>
<role3>Admin</role3>
<role4/>
</roles>
```
and the dtd:
```
<?... | `SAX` parser is working differently with a `DOM` parser, it neither load any `XML` document into memory nor create any object representation of the `XML` document. Instead, the `SAX` parser use callback function `org.xml.sax.helpers.DefaultHandler` to informs clients of the `XML` document structure.
`SAX` Parser is fa... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Here is a quick DOM example that shows how to read and write a simple xml file with its dtd:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE roles SYSTEM "roles.dtd">
<roles>
<role1>User</role1>
<role2>Author</role2>
<role3>Admin</role3>
<role4/>
</roles>
```
and the dtd:
```
<?... | Ok, already having DOM, JaxB and XStream in the list of answers, there is still a complete different way to read and write XML: [Data projection](http://xmlbeam.org) You can decouple the XML structure and the Java structure by using a library that provides read and writeable views to the XML Data as Java interfaces. Fr... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Here is a quick DOM example that shows how to read and write a simple xml file with its dtd:
```
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE roles SYSTEM "roles.dtd">
<roles>
<role1>User</role1>
<role2>Author</role2>
<role3>Admin</role3>
<role4/>
</roles>
```
and the dtd:
```
<?... | The answers only cover DOM / SAX and a copy paste implementation of a JAXB example.
However, one big area of when you are using XML is missing. In many projects / programs there is a need to store / retrieve some basic data structures. Your program has already a classes for your nice and shiny business objects / data ... |
7,373,572 | My site configures CherryPy by way of a configuration file. In the configuration file I am trying to setup basic authentication. I have specified the fully qualified path to a "checkpassword" function. But I'm getting an error about the tools.auth\_basic.checkpassword line.
[Most of the samples online](http://docs.ch... | 2011/09/10 | [
"https://Stackoverflow.com/questions/7373572",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/451007/"
] | Ok, already having DOM, JaxB and XStream in the list of answers, there is still a complete different way to read and write XML: [Data projection](http://xmlbeam.org) You can decouple the XML structure and the Java structure by using a library that provides read and writeable views to the XML Data as Java interfaces. Fr... | `SAX` parser is working differently with a `DOM` parser, it neither load any `XML` document into memory nor create any object representation of the `XML` document. Instead, the `SAX` parser use callback function `org.xml.sax.helpers.DefaultHandler` to informs clients of the `XML` document structure.
`SAX` Parser is fa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.