qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
12,176 | What are the best ways to translate `For all you know`?
For example:
>
> For all you know, she could be lying to you.
>
>
> In response to a friend getting upset that her friend isn't picking up her phone, I respond, "For all you know, something could have happened."
>
>
> A neighbor sends us some vegetables and... | 2015/01/22 | [
"https://chinese.stackexchange.com/questions/12176",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/3011/"
] | Agree with StumpyJoePete.
As we all know = Everybody knows.
For all you know = You don't really know for sure.
I think Damian Siniakowicz's suggestion will work.
We better wash the vegetables first, for all we know, they could be covered in pesticide
我们还是先把蔬菜洗一下,说不定有農藥呢。
A couple more suggestions:
我们还是先把蔬菜洗一下... | For all you know, she could be lying to you.
听你所见,她可有在骗你. |
12,176 | What are the best ways to translate `For all you know`?
For example:
>
> For all you know, she could be lying to you.
>
>
> In response to a friend getting upset that her friend isn't picking up her phone, I respond, "For all you know, something could have happened."
>
>
> A neighbor sends us some vegetables and... | 2015/01/22 | [
"https://chinese.stackexchange.com/questions/12176",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/3011/"
] | Agree with StumpyJoePete.
As we all know = Everybody knows.
For all you know = You don't really know for sure.
I think Damian Siniakowicz's suggestion will work.
We better wash the vegetables first, for all we know, they could be covered in pesticide
我们还是先把蔬菜洗一下,说不定有農藥呢。
A couple more suggestions:
我们还是先把蔬菜洗一下... | 天知道 is also ok
"For all you know, something could have happened."
說不定發生了一些事情
"We better wash them first, for all we know, they could be covered in pesticide"
還是先洗洗,天知道有沒有農藥 |
12,176 | What are the best ways to translate `For all you know`?
For example:
>
> For all you know, she could be lying to you.
>
>
> In response to a friend getting upset that her friend isn't picking up her phone, I respond, "For all you know, something could have happened."
>
>
> A neighbor sends us some vegetables and... | 2015/01/22 | [
"https://chinese.stackexchange.com/questions/12176",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/3011/"
] | Just found this interesting [discussion](http://forum.wordreference.com/showthread.php?t=477816). It offered a definition:
>
> This expression [for all you know] can be used in any context where the speaker wishes to convey that the listener is failing (deliberately or otherwise) to consider all the possibilities.
> ... | For all you know, she could be lying to you.
听你所见,她可有在骗你. |
12,176 | What are the best ways to translate `For all you know`?
For example:
>
> For all you know, she could be lying to you.
>
>
> In response to a friend getting upset that her friend isn't picking up her phone, I respond, "For all you know, something could have happened."
>
>
> A neighbor sends us some vegetables and... | 2015/01/22 | [
"https://chinese.stackexchange.com/questions/12176",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/3011/"
] | Just found this interesting [discussion](http://forum.wordreference.com/showthread.php?t=477816). It offered a definition:
>
> This expression [for all you know] can be used in any context where the speaker wishes to convey that the listener is failing (deliberately or otherwise) to consider all the possibilities.
> ... | 天知道 is also ok
"For all you know, something could have happened."
說不定發生了一些事情
"We better wash them first, for all we know, they could be covered in pesticide"
還是先洗洗,天知道有沒有農藥 |
12,176 | What are the best ways to translate `For all you know`?
For example:
>
> For all you know, she could be lying to you.
>
>
> In response to a friend getting upset that her friend isn't picking up her phone, I respond, "For all you know, something could have happened."
>
>
> A neighbor sends us some vegetables and... | 2015/01/22 | [
"https://chinese.stackexchange.com/questions/12176",
"https://chinese.stackexchange.com",
"https://chinese.stackexchange.com/users/3011/"
] | 天知道 is also ok
"For all you know, something could have happened."
說不定發生了一些事情
"We better wash them first, for all we know, they could be covered in pesticide"
還是先洗洗,天知道有沒有農藥 | For all you know, she could be lying to you.
听你所见,她可有在骗你. |
31,423 | I'm just starting to use CiviCRM. So I realize that this could be a very dumb question.
I'm trying to deduplicate contacts by name AND surname. When I create a new deduplicating rule using name and surname, it looks like it gets all the contacts with the same name OR surname.
For example, if I have
* Mario Rossi
* ... | 2019/07/19 | [
"https://civicrm.stackexchange.com/questions/31423",
"https://civicrm.stackexchange.com",
"https://civicrm.stackexchange.com/users/7271/"
] | Welcome to CiviCRM SE. Eileen's answer is definitely the right place to start, but you might want to look at a related question that I asked about the built-in (reserved) de-duplicate rules, as they aren't entirely clear from the documentation. It says "NAME" in the description, but actually uses the fields "First Name... | I think this blog does a reasonable job of describing it <https://civicrm.org/blog/spidersilk/understanding-civicrm-dedupe-rules>
Here are the official docs
<https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/>
* but we could do with pulling some in from the docs
Basically you need to che... |
95,071 | Does anyone know if the house number is included in Mapbox’ vector tiles, and if so how to access it for styling? | 2014/05/06 | [
"https://gis.stackexchange.com/questions/95071",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/27171/"
] | Version 5 of the Mapbox Streets vector tiles includes the house number in a new layer.
I used the following to add them to the starting style:
```
#housenum_label {
text-name: '[house_num]';
text-face-name: @sans;
text-fill: darken(#cde, 20%);
text-size: 9;
}
``` | As far as I know, house numbers are not currently included in MapBox's vector tiles.
If you need to render a small region, you can get them in GeoJSON with [Overpass Turbo](http://overpass-turbo.eu/s/3mZ) (press "Run", then "Export" and "geoJSON"), which you can use in TileMill as a layer. For bigger regions you might... |
12,252,363 | 1) Does LSP also apply to interfaces, meaning that we should be able to use a class implementing a specific interface and still get the expected behavior?
2) If that is indeed the case, then why is programming to an interface considered a good thing ( BTW- I know that programming to an interface increases loose coupl... | 2012/09/03 | [
"https://Stackoverflow.com/questions/12252363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1483278/"
] | >
> Does LSP also apply to interfaces, meaning that we should be able to use a class implementing a specific interface and still get the expected behavior?
>
>
>
LSP applies to the contract. The contract may be a class or an interface.
>
> If that is indeed the case, then why is programming to an interface consi... | I'm comparing/contrasting my code practice with LSP at the moment. I think it must be all to do with expectation and deciding how to define what should be expected. I'm not convinced that substitution always means the same thing. For instance, if I defined
```
interface ICalculation
{
double Calculate(double A,... |
12,252,363 | 1) Does LSP also apply to interfaces, meaning that we should be able to use a class implementing a specific interface and still get the expected behavior?
2) If that is indeed the case, then why is programming to an interface considered a good thing ( BTW- I know that programming to an interface increases loose coupl... | 2012/09/03 | [
"https://Stackoverflow.com/questions/12252363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1483278/"
] | >
> Does LSP also apply to interfaces, meaning that we should be able to use a class implementing a specific interface and still get the expected behavior?
>
>
>
LSP applies to the contract. The contract may be a class or an interface.
>
> If that is indeed the case, then why is programming to an interface consi... | Ad 1): Yes. However, it is hard to make interfaces enforce the contracts, and they really should.
Ad 2): Programming against an interface is a trade-off. As you point out interfaces encourages violation of LSP for all interfaces with a non-trivial contract.
I believe these are the answers to your questions, or at lea... |
12,252,363 | 1) Does LSP also apply to interfaces, meaning that we should be able to use a class implementing a specific interface and still get the expected behavior?
2) If that is indeed the case, then why is programming to an interface considered a good thing ( BTW- I know that programming to an interface increases loose coupl... | 2012/09/03 | [
"https://Stackoverflow.com/questions/12252363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1483278/"
] | I'm comparing/contrasting my code practice with LSP at the moment. I think it must be all to do with expectation and deciding how to define what should be expected. I'm not convinced that substitution always means the same thing. For instance, if I defined
```
interface ICalculation
{
double Calculate(double A,... | Ad 1): Yes. However, it is hard to make interfaces enforce the contracts, and they really should.
Ad 2): Programming against an interface is a trade-off. As you point out interfaces encourages violation of LSP for all interfaces with a non-trivial contract.
I believe these are the answers to your questions, or at lea... |
15,442,919 | I've been reading up on SimpleDB and one downfall (for me) is the 1kb max per attribute limit. I do a lot of RSS feed processing and I was hoping to store feed data in SimpleDB (articles) and from what I've read the best way to do this is to shard the article across several attributes. The typical article is < 30kb of ... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15442919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/799575/"
] | Your code doesn't do what you think it does.
```
ArrayList[][] gridList = new ArrayList[300][150];
```
This first line allocates an `array` of `array` of `ArrayList`.
```
ArrayList al = this.gridList[a][b];
```
This second line retrieves the `ArrayList` at offset `b` in the `array` at offset `a` in the `array`... | Something like this may work (if you need container class):
```
struct Item
{ ...
};
typedef std::vector<Item> ArrayList;
// Single row.
struct ArrayListVector : public std::vector<ArrayList>
{
ArrayListVector() { resize(150); }
};
// Whole matrix
struct ArrayListMatrix : public std::vector<ArrayListVector>
{
... |
15,442,919 | I've been reading up on SimpleDB and one downfall (for me) is the 1kb max per attribute limit. I do a lot of RSS feed processing and I was hoping to store feed data in SimpleDB (articles) and from what I've read the best way to do this is to shard the article across several attributes. The typical article is < 30kb of ... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15442919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/799575/"
] | Your code doesn't do what you think it does.
```
ArrayList[][] gridList = new ArrayList[300][150];
```
This first line allocates an `array` of `array` of `ArrayList`.
```
ArrayList al = this.gridList[a][b];
```
This second line retrieves the `ArrayList` at offset `b` in the `array` at offset `a` in the `array`... | If your ArrayList is holding something of type 'Foo', then:
```
std::vector<Foo*> gridList[300][150];
std::vector al = this->gridList[a][b];
``` |
56,019,584 | I have a big file with many lines starting like this:
```
22 16052167 rs375684679 A AAAAC . PASS DR2=0.02;AF=0.4728;IMP GT:DS
```
In these lines, `DR2`values range from 0 to 1 and I would like to extract those lines that contains`DR2`values higher than 0.8.
I've tried both `sed` or `awk` solutions, but neither seem... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56019584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9717188/"
] | This matches lines with a value greater than *or equal to* 0.8. If you insist on strictly greater than, then I'll have to add some complexity to prevent 0.8 from matching.
```
grep 'DR2=\(1\|0\.[89]\)' myfile
```
The trick is that you need two separate subpatterns: one to match 1 and greater, one to match 0.8 and gr... | * **grep:** `grep -E 'DR2=\([1-9]\|0[.][89]\)'`
* **sed:** `sed -n '/\([1-9]\|0[.][89]\)/p'`
* **awk:** `awk '/\([1-9]\|0[.][89]\)/'`
These 3 solutions are all based on a single regular expression and all do the same (see [Ruud HelderMan's solution](https://stackoverflow.com/a/56019874/8344060))
With awk, however, yo... |
56,019,584 | I have a big file with many lines starting like this:
```
22 16052167 rs375684679 A AAAAC . PASS DR2=0.02;AF=0.4728;IMP GT:DS
```
In these lines, `DR2`values range from 0 to 1 and I would like to extract those lines that contains`DR2`values higher than 0.8.
I've tried both `sed` or `awk` solutions, but neither seem... | 2019/05/07 | [
"https://Stackoverflow.com/questions/56019584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9717188/"
] | This matches lines with a value greater than *or equal to* 0.8. If you insist on strictly greater than, then I'll have to add some complexity to prevent 0.8 from matching.
```
grep 'DR2=\(1\|0\.[89]\)' myfile
```
The trick is that you need two separate subpatterns: one to match 1 and greater, one to match 0.8 and gr... | Whenever you have tag=value pairs in your data I find it best to first create an array of those pairings (`f[]`) below and then you can just access the values by their tags. You didn't provide any input of 0.8 to test against so using the data you did provide:
```
$ awk '{split($8,t,/[=;]/); for (i=1; i in t; i+=2) f[... |
2,508,720 | I'm trying to create JUnit tests for my JPA DAO classes, using Spring 2.5.6 and JUnit 4.8.1.
My test case looks like this:
```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:config/jpaDaoTestsConfig.xml"} )
public class MenuItem_Junit4_JPATest extends BaseJPATestCase {
priva... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2508720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/136449/"
] | These are the correct combinations of annotation + interface:
```
@PersistenceContext
private EntityManager entityManager;
@PersistenceUnit
private EntityManagerFactory entityManagerFactory;
```
But when using spring's transaction and entity manager support, you don't need the `EntityManagerFactory` at all.
The re... | I had to do the below combination, apart from adding spring-aspects jar to the project properties->Aspect Path and enabling spring aspects in sts. Ofcourse in my application context config file i defined the Entitymanagerfactory.
@ContextConfiguration(locations = { "/META-INF/spring/applicationContext-domain.xml" })
... |
2,508,720 | I'm trying to create JUnit tests for my JPA DAO classes, using Spring 2.5.6 and JUnit 4.8.1.
My test case looks like this:
```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:config/jpaDaoTestsConfig.xml"} )
public class MenuItem_Junit4_JPATest extends BaseJPATestCase {
priva... | 2010/03/24 | [
"https://Stackoverflow.com/questions/2508720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/136449/"
] | These are the correct combinations of annotation + interface:
```
@PersistenceContext
private EntityManager entityManager;
@PersistenceUnit
private EntityManagerFactory entityManagerFactory;
```
But when using spring's transaction and entity manager support, you don't need the `EntityManagerFactory` at all.
The re... | I too have same problem, When I added java-persistence api problem got resolved.
```
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
``` |
11,053,878 | In a Rails 3.2 app, when I call a non-html format on a class - e.g. json, csv, etc - I get an error
```
Template is missing
Missing partial /path/to/template with {:locale=>[:en], :formats=>[:json].....
```
The template is called from a method in the controller.
How can I create a conditional statement in the cont... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11053878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716294/"
] | In your controller
```
def index # or other method
...
respond_to do |format|
format.html # render index.html.erb
format.json { render json: ...} # one-line block
format.xml do
# multi-line block
end
end
end
``` | Is maybe [this](http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to) what your are looking for? |
11,053,878 | In a Rails 3.2 app, when I call a non-html format on a class - e.g. json, csv, etc - I get an error
```
Template is missing
Missing partial /path/to/template with {:locale=>[:en], :formats=>[:json].....
```
The template is called from a method in the controller.
How can I create a conditional statement in the cont... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11053878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716294/"
] | ```
respond_to do |format|
format.html { my_method_that_causes_the_error }
format.csv { render :something }
end
``` | Is maybe [this](http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to) what your are looking for? |
11,053,878 | In a Rails 3.2 app, when I call a non-html format on a class - e.g. json, csv, etc - I get an error
```
Template is missing
Missing partial /path/to/template with {:locale=>[:en], :formats=>[:json].....
```
The template is called from a method in the controller.
How can I create a conditional statement in the cont... | 2012/06/15 | [
"https://Stackoverflow.com/questions/11053878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716294/"
] | ```
respond_to do |format|
format.html { my_method_that_causes_the_error }
format.csv { render :something }
end
``` | In your controller
```
def index # or other method
...
respond_to do |format|
format.html # render index.html.erb
format.json { render json: ...} # one-line block
format.xml do
# multi-line block
end
end
end
``` |
14,849,026 | I'm trying to pass some values through onclick which to me is so much faster. But I need to use some kind of "live" clicking and I was looking into .on() or .delegate(). However, if I do any of those, passing those values within `followme()` seems a little harder to get. Is there some kind of method that I'm not seeing... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14849026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/659751/"
] | You can assign more data values, and you know what use is logged in, all you need is to pass who to follow:
```
<div class='btn btn-mini follow-btn'
data-status='follow'
data-who='<?php echo $randId; ?>'
id='followBTN'>
Follow
</div>
<script>
$('#followBTN').on('click', function(){
... | just use the jquery 'on' event. Attach a new attribute called data-session to the div and then retrieve it using .attr method. You have the example bellow to show you an alert with the data, you just have to substitute it with your code
```
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.co... |
26,821,797 | Please advise me why I can't create this example in my home html file?
Here is an example from the [site](http://jsfiddle.net/eM2Mg/) and my html file:
```
<head>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<script>
g = new Dygraph(document.getElementById("graph"),
"X,Y,Z\n" +
... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26821797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3731374/"
] | javascript script must be after div or you need to use document ready to load body first and then script
```
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<style>
.dygraph-title {
... | One main issue is that your code is running too early. You are trying to operate on DOM elements before they have even been loaded. Code running in the `<head>` section cannot yet access elements in the DOM because it has not yet been loaded.
You can move your second `<script>` tag to right before the `</body>` tag an... |
26,821,797 | Please advise me why I can't create this example in my home html file?
Here is an example from the [site](http://jsfiddle.net/eM2Mg/) and my html file:
```
<head>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<script>
g = new Dygraph(document.getElementById("graph"),
"X,Y,Z\n" +
... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26821797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3731374/"
] | javascript script must be after div or you need to use document ready to load body first and then script
```
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<style>
.dygraph-title {
... | Because your `getElementById` call will return null because the element doesn't exist yet when you run the Javascript code.
Put the code in the load event so that it runs after the page has been parsed:
```
window.onload = function(){
g = new Dygraph(document.getElementById("graph"),
...
};
``` |
26,821,797 | Please advise me why I can't create this example in my home html file?
Here is an example from the [site](http://jsfiddle.net/eM2Mg/) and my html file:
```
<head>
<script src="http://dygraphs.com/dygraph-dev.js"></script>
<script>
g = new Dygraph(document.getElementById("graph"),
"X,Y,Z\n" +
... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26821797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3731374/"
] | Because your `getElementById` call will return null because the element doesn't exist yet when you run the Javascript code.
Put the code in the load event so that it runs after the page has been parsed:
```
window.onload = function(){
g = new Dygraph(document.getElementById("graph"),
...
};
``` | One main issue is that your code is running too early. You are trying to operate on DOM elements before they have even been loaded. Code running in the `<head>` section cannot yet access elements in the DOM because it has not yet been loaded.
You can move your second `<script>` tag to right before the `</body>` tag an... |
17,955 | Just like it says in the title, how can I store blocks of cheese for max shelf life? I will be making a grilled cheese sandwich and shredding 3 varieties of cheese (cheddar, swiss, parm(?)) and I am afraid that I won't be able to use three whole blocks on one sandwich. | 2011/09/23 | [
"https://cooking.stackexchange.com/questions/17955",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/3818/"
] | Hard, aged cheeses like cheddar and Parmesan are fine to freeze, particularly if you're going to be melting them when you get around to using them anyway. Freezing causes ice particles to break up the molecules of the cheese, and when they thaw, they leave holes in what was (prior to freezing) a pretty smooth cheese. S... | The best way to keep cheese in the fridge ... and the way I've made semisoft cheeses like cheddar last 6-10 weeks, sometimes more:
1. Wrap the cheese in butcher paper, or baking parchment if you can't get butcher paper.
2. Enclose the wrapped cheese in a plastic grocery bag or plastic wrap.
3. Each time you slice off ... |
17,955 | Just like it says in the title, how can I store blocks of cheese for max shelf life? I will be making a grilled cheese sandwich and shredding 3 varieties of cheese (cheddar, swiss, parm(?)) and I am afraid that I won't be able to use three whole blocks on one sandwich. | 2011/09/23 | [
"https://cooking.stackexchange.com/questions/17955",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/3818/"
] | Hard, aged cheeses like cheddar and Parmesan are fine to freeze, particularly if you're going to be melting them when you get around to using them anyway. Freezing causes ice particles to break up the molecules of the cheese, and when they thaw, they leave holes in what was (prior to freezing) a pretty smooth cheese. S... | I've had good luck simply storing the cheese tightly wrapped in plastic wrap in the refrigerator. If you use a good quality wrap material and wrap it tightly, the cheese will stay dry and also not lose moisture.
In the past I tried using ziploc bags, evacuating air before sealing, but the simple plastic wrap approach ... |
17,955 | Just like it says in the title, how can I store blocks of cheese for max shelf life? I will be making a grilled cheese sandwich and shredding 3 varieties of cheese (cheddar, swiss, parm(?)) and I am afraid that I won't be able to use three whole blocks on one sandwich. | 2011/09/23 | [
"https://cooking.stackexchange.com/questions/17955",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/3818/"
] | The best way to keep cheese in the fridge ... and the way I've made semisoft cheeses like cheddar last 6-10 weeks, sometimes more:
1. Wrap the cheese in butcher paper, or baking parchment if you can't get butcher paper.
2. Enclose the wrapped cheese in a plastic grocery bag or plastic wrap.
3. Each time you slice off ... | I've had good luck simply storing the cheese tightly wrapped in plastic wrap in the refrigerator. If you use a good quality wrap material and wrap it tightly, the cheese will stay dry and also not lose moisture.
In the past I tried using ziploc bags, evacuating air before sealing, but the simple plastic wrap approach ... |
58,720,960 | We can use @Input as passing input props or data. We also can use `<ng-content>` to dump a load of html into the children component. Is there any way to pass html as Input. Like @Input html1, @Input html2, and use them in the child class component?
Suppose I have this html in child class:
```
<div class='wrapper'>
... | 2019/11/05 | [
"https://Stackoverflow.com/questions/58720960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7055636/"
] | We can use **innerHTML** to achieve this
Sample example demonstrating this,
parent.component.ts,
```
export class ParentComponent {
htmlOneAsString = `
<div>Welcome Text Header</div>
`;
htmlTwoAsString = `
<div>Welcome Text Content</div>
`;
htmlAsString = `
<div><div>${this.htmlOneAsString}</... | You can place your html in a string like
```
htmlStr = "<strong>This is an example</strong>";
```
and pass it through to a service:
```
this.whateverService.setHtml(this.htmlStr);
```
then in the receiving component:
```
import { WhateverService } from 'src/app/shared/service/whatever.service';
export class Re... |
58,720,960 | We can use @Input as passing input props or data. We also can use `<ng-content>` to dump a load of html into the children component. Is there any way to pass html as Input. Like @Input html1, @Input html2, and use them in the child class component?
Suppose I have this html in child class:
```
<div class='wrapper'>
... | 2019/11/05 | [
"https://Stackoverflow.com/questions/58720960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7055636/"
] | I have found the solution, this can be done by:
```
<div class='wrapper'>
<div class="exclusive-css-defined-to-this-component">
<div><ng-content select="[content1]"></ng-content></div>
</div>
<div class="exclusive-css-defined-to-this-component-2">
<div><ng-content select="[content2]"></ng-content></div>... | You can place your html in a string like
```
htmlStr = "<strong>This is an example</strong>";
```
and pass it through to a service:
```
this.whateverService.setHtml(this.htmlStr);
```
then in the receiving component:
```
import { WhateverService } from 'src/app/shared/service/whatever.service';
export class Re... |
58,720,960 | We can use @Input as passing input props or data. We also can use `<ng-content>` to dump a load of html into the children component. Is there any way to pass html as Input. Like @Input html1, @Input html2, and use them in the child class component?
Suppose I have this html in child class:
```
<div class='wrapper'>
... | 2019/11/05 | [
"https://Stackoverflow.com/questions/58720960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7055636/"
] | I have found the solution, this can be done by:
```
<div class='wrapper'>
<div class="exclusive-css-defined-to-this-component">
<div><ng-content select="[content1]"></ng-content></div>
</div>
<div class="exclusive-css-defined-to-this-component-2">
<div><ng-content select="[content2]"></ng-content></div>... | We can use **innerHTML** to achieve this
Sample example demonstrating this,
parent.component.ts,
```
export class ParentComponent {
htmlOneAsString = `
<div>Welcome Text Header</div>
`;
htmlTwoAsString = `
<div>Welcome Text Content</div>
`;
htmlAsString = `
<div><div>${this.htmlOneAsString}</... |
988,032 | I need to write a script which writes to a file how many times this script has been executed.
How can I do that? | 2017/12/20 | [
"https://askubuntu.com/questions/988032",
"https://askubuntu.com",
"https://askubuntu.com/users/773615/"
] | I assume you want to have a single file `countfile` that only contains one single number representing the execution counter.
You can read this counter into a shell variable `$counter` e.g. using one of these lines:
* ```
read counter < countfile
```
* ```
counter=$(cat countfile)
```
Simple integer additions can b... | Just let the script create a log file, add for example a line in your script at the end:
```
echo "Script has been executed at $(date +\%Y-\%m-\%d) $(date +\%H-\%M-\%S)" >> ~/script.log
```
This way you can format the way you present date and time yourself, but if you simply want to go with a full date and time (and... |
988,032 | I need to write a script which writes to a file how many times this script has been executed.
How can I do that? | 2017/12/20 | [
"https://askubuntu.com/questions/988032",
"https://askubuntu.com",
"https://askubuntu.com/users/773615/"
] | I assume you want to have a single file `countfile` that only contains one single number representing the execution counter.
You can read this counter into a shell variable `$counter` e.g. using one of these lines:
* ```
read counter < countfile
```
* ```
counter=$(cat countfile)
```
Simple integer additions can b... | This solution uses the same approach as [Byte Commander’s answer](/a/988035/175814) but it doesn't rely on shell arithmetic or other Bashisms.
```
exec 2>&3 2>/dev/null
read counter < counter.txt || counter=0
exec 3>&2 3>&-
expr "$counter" + 1 > counter.txt
```
The stream redirections
1. duplicate the standard erro... |
988,032 | I need to write a script which writes to a file how many times this script has been executed.
How can I do that? | 2017/12/20 | [
"https://askubuntu.com/questions/988032",
"https://askubuntu.com",
"https://askubuntu.com/users/773615/"
] | I assume you want to have a single file `countfile` that only contains one single number representing the execution counter.
You can read this counter into a shell variable `$counter` e.g. using one of these lines:
* ```
read counter < countfile
```
* ```
counter=$(cat countfile)
```
Simple integer additions can b... | A different approach
====================
A separate counter file has disadvantages:
* It takes 4096 bytes (or whatever your block size is) for each counter file.
* You have to look up the name of the file in the bash script and then open the file to see the count.
* There is no file locking (in other answers) so it'... |
988,032 | I need to write a script which writes to a file how many times this script has been executed.
How can I do that? | 2017/12/20 | [
"https://askubuntu.com/questions/988032",
"https://askubuntu.com",
"https://askubuntu.com/users/773615/"
] | Just let the script create a log file, add for example a line in your script at the end:
```
echo "Script has been executed at $(date +\%Y-\%m-\%d) $(date +\%H-\%M-\%S)" >> ~/script.log
```
This way you can format the way you present date and time yourself, but if you simply want to go with a full date and time (and... | A different approach
====================
A separate counter file has disadvantages:
* It takes 4096 bytes (or whatever your block size is) for each counter file.
* You have to look up the name of the file in the bash script and then open the file to see the count.
* There is no file locking (in other answers) so it'... |
988,032 | I need to write a script which writes to a file how many times this script has been executed.
How can I do that? | 2017/12/20 | [
"https://askubuntu.com/questions/988032",
"https://askubuntu.com",
"https://askubuntu.com/users/773615/"
] | This solution uses the same approach as [Byte Commander’s answer](/a/988035/175814) but it doesn't rely on shell arithmetic or other Bashisms.
```
exec 2>&3 2>/dev/null
read counter < counter.txt || counter=0
exec 3>&2 3>&-
expr "$counter" + 1 > counter.txt
```
The stream redirections
1. duplicate the standard erro... | A different approach
====================
A separate counter file has disadvantages:
* It takes 4096 bytes (or whatever your block size is) for each counter file.
* You have to look up the name of the file in the bash script and then open the file to see the count.
* There is no file locking (in other answers) so it'... |
420,325 | **Problem: It's a common problem for "NON-inverter" type microwave ovens to pop circuit breakers**, and mine is no exception.
**UPDATE Jan 2021: Extension / power strip added, (mentioned below) has still eliminated this problem completely! I think I've only popped that breaker once in two years.** Fascinating as this ... | 2019/02/03 | [
"https://electronics.stackexchange.com/questions/420325",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/211801/"
] | In an older model microwave with a huge heavy transformer, the inrush current may be due to the transformer saturating when power is switched on at the peak of the voltage waveform. If that is the case, very little additional impedance may be required. I have seen the problem in a location where the distribution panel ... | 3 recommendations
=================
* Test or replace bulk Film cap (test by RLC meter @120Hz)
* insert an Inrush Current Limiter (ICL) for rated current eg 120Vac, 10A a) 7 Ω to 0.08 Ω or b) 20 Ω to 0.18 Ω. (Slow response)
* add series 12 Ω power R and Time delay SPST 10A relay to shunt R
My Panasonic oven may have ... |
420,325 | **Problem: It's a common problem for "NON-inverter" type microwave ovens to pop circuit breakers**, and mine is no exception.
**UPDATE Jan 2021: Extension / power strip added, (mentioned below) has still eliminated this problem completely! I think I've only popped that breaker once in two years.** Fascinating as this ... | 2019/02/03 | [
"https://electronics.stackexchange.com/questions/420325",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/211801/"
] | In an older model microwave with a huge heavy transformer, the inrush current may be due to the transformer saturating when power is switched on at the peak of the voltage waveform. If that is the case, very little additional impedance may be required. I have seen the problem in a location where the distribution panel ... | What happens is, the transformer saturates on startup. The magnetization current normally passes through zero at about 1/2 way through each 1/2 cycle. If it gets turned at the beginning, the mag. current starts from zero instead of -peak, so it heads towards double peak and saturates the core. The coil then behaves lik... |
420,325 | **Problem: It's a common problem for "NON-inverter" type microwave ovens to pop circuit breakers**, and mine is no exception.
**UPDATE Jan 2021: Extension / power strip added, (mentioned below) has still eliminated this problem completely! I think I've only popped that breaker once in two years.** Fascinating as this ... | 2019/02/03 | [
"https://electronics.stackexchange.com/questions/420325",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/211801/"
] | 3 recommendations
=================
* Test or replace bulk Film cap (test by RLC meter @120Hz)
* insert an Inrush Current Limiter (ICL) for rated current eg 120Vac, 10A a) 7 Ω to 0.08 Ω or b) 20 Ω to 0.18 Ω. (Slow response)
* add series 12 Ω power R and Time delay SPST 10A relay to shunt R
My Panasonic oven may have ... | What happens is, the transformer saturates on startup. The magnetization current normally passes through zero at about 1/2 way through each 1/2 cycle. If it gets turned at the beginning, the mag. current starts from zero instead of -peak, so it heads towards double peak and saturates the core. The coil then behaves lik... |
63,598,072 | I have a deeply nested JSON document that is variable length and has variable arrays respective to the document, I am looking to unnest certain sections and write them to BigQuery, and disregard others.
I was excited about Dataprep by Trifacta but as they will be accessing the data, this will not work for my company. ... | 2020/08/26 | [
"https://Stackoverflow.com/questions/63598072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12928451/"
] | You can try this:
**[1] Flatten the JSON document using `jq`:**
```
cat source.json | jq -c '.[]' > target.json
```
**[2] Load transformed JSON file (using `autodetect`):**
```
bq load --autodetect --source_format=NEWLINE_DELIMITED_JSON mydataset.mytable target.json
```
**Result:**
>
> BigQuery will automatica... | [Dataflow](https://cloud.google.com/dataflow) can also be useful for this purpose:
* With this product you can create Apache Beam preprocessing pipelines that run only on Google servers.
* With Beam's [ParDo funcion](https://beam.apache.org/releases/javadoc/2.2.0/org/apache/beam/sdk/transforms/ParDo.html) you can appl... |
32,631,274 | ```
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
my ( $func, @list, $num );
$func = sub {
print $num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach $num ( @list ) {
$func->();
};
```
This piece of perl prints
```
undef
undef
undef
```
instead of
```
1
2
3
```
The `$f... | 2015/09/17 | [
"https://Stackoverflow.com/questions/32631274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1717295/"
] | Because `foreach` loops implicitly localise their iterator variables.
See: [`perlsyn`](http://perldoc.perl.org/perlsyn.html#Foreach-Loops)
>
> The foreach loop iterates over a normal list value and sets the variable VAR to be each element of the list in turn. If the variable is preceded with the keyword my, then it... | Well, guess the reason is this, from the docs:
>
> The foreach loop iterates over a normal list value and sets the
> variable VAR to be each element of the list in turn. If the variable
> is preceded with the keyword my, then it is lexically scoped, and is
> therefore visible only within the loop. Otherwise, the v... |
32,631,274 | ```
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
my ( $func, @list, $num );
$func = sub {
print $num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach $num ( @list ) {
$func->();
};
```
This piece of perl prints
```
undef
undef
undef
```
instead of
```
1
2
3
```
The `$f... | 2015/09/17 | [
"https://Stackoverflow.com/questions/32631274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1717295/"
] | Because `foreach` loops implicitly localise their iterator variables.
See: [`perlsyn`](http://perldoc.perl.org/perlsyn.html#Foreach-Loops)
>
> The foreach loop iterates over a normal list value and sets the variable VAR to be each element of the list in turn. If the variable is preceded with the keyword my, then it... | You are accessing a localized version of the `$num` variable, like Sobrique says. What you intended was to use a reference to the variable `$num`. Which is what I show here:
```
my ( $func, @list, $num );
$func = sub {
print $$num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach ( @list ) {
$num = \$_;
... |
32,631,274 | ```
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
my ( $func, @list, $num );
$func = sub {
print $num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach $num ( @list ) {
$func->();
};
```
This piece of perl prints
```
undef
undef
undef
```
instead of
```
1
2
3
```
The `$f... | 2015/09/17 | [
"https://Stackoverflow.com/questions/32631274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1717295/"
] | Because `foreach` loops implicitly localise their iterator variables.
See: [`perlsyn`](http://perldoc.perl.org/perlsyn.html#Foreach-Loops)
>
> The foreach loop iterates over a normal list value and sets the variable VAR to be each element of the list in turn. If the variable is preceded with the keyword my, then it... | I could quote perlsyn, but perlsyn does not appear to say clearly what is the case. The variable is not "localized", and there is nothing that "regains" its value upon exiting the loop. The outer variable is *hidden* when you declare the loop variable, and visible after you're out of the loop.
It implicitly *hides* th... |
32,631,274 | ```
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
my ( $func, @list, $num );
$func = sub {
print $num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach $num ( @list ) {
$func->();
};
```
This piece of perl prints
```
undef
undef
undef
```
instead of
```
1
2
3
```
The `$f... | 2015/09/17 | [
"https://Stackoverflow.com/questions/32631274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1717295/"
] | You are accessing a localized version of the `$num` variable, like Sobrique says. What you intended was to use a reference to the variable `$num`. Which is what I show here:
```
my ( $func, @list, $num );
$func = sub {
print $$num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach ( @list ) {
$num = \$_;
... | Well, guess the reason is this, from the docs:
>
> The foreach loop iterates over a normal list value and sets the
> variable VAR to be each element of the list in turn. If the variable
> is preceded with the keyword my, then it is lexically scoped, and is
> therefore visible only within the loop. Otherwise, the v... |
32,631,274 | ```
#!/usr/bin/env perl
use strict;
use warnings FATAL => qw ( all );
my ( $func, @list, $num );
$func = sub {
print $num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach $num ( @list ) {
$func->();
};
```
This piece of perl prints
```
undef
undef
undef
```
instead of
```
1
2
3
```
The `$f... | 2015/09/17 | [
"https://Stackoverflow.com/questions/32631274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1717295/"
] | You are accessing a localized version of the `$num` variable, like Sobrique says. What you intended was to use a reference to the variable `$num`. Which is what I show here:
```
my ( $func, @list, $num );
$func = sub {
print $$num // "undef"; print "\n";
};
@list = ( 1,2,3 );
foreach ( @list ) {
$num = \$_;
... | I could quote perlsyn, but perlsyn does not appear to say clearly what is the case. The variable is not "localized", and there is nothing that "regains" its value upon exiting the loop. The outer variable is *hidden* when you declare the loop variable, and visible after you're out of the loop.
It implicitly *hides* th... |
307,168 | Why I can't feel the actual speed of plane when the plane in the sky? I mean I cannot judge how fast the plane is going in terms of the light on the ground and I feel it is flying so slow. How can I explain this mismatch? | 2017/01/24 | [
"https://physics.stackexchange.com/questions/307168",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/118807/"
] | You do not feel speed, you only feel acceleration, or other forces, like those from the wind on your face - and you cannot feel that in a plane.
So you do feel something when the plane is accelerating, taking off, sometimes when it banks, or in bad weather.
But a plane's speed is typically steady, unchanging, for mos... | I believe it's an illusion that has to do more with cognitive science. The treatment of objects movements and the evaluation of their speed is done pretty unconsciously through different visual areas of the cortex. [Some people for example cannot perceive](https://en.wikipedia.org/wiki/Akinetopsia) motion even though t... |
203,057 | I just realized that both seems to mean the same thing. However, I am not sure if this is something that's context-dependent or not. What do you think?
For example:
>
> I pressed and used the buttons at the right time and in the right
> combination.
>
>
> I pressed and used the buttons at the right time and with ... | 2019/03/30 | [
"https://ell.stackexchange.com/questions/203057",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/91596/"
] | Interesting question! I've never thought about this before.
This might depend on the individual and the dialect, so I will only be answering for myself and Australian English.
**In** a combination is used to describe a series of actions (for example, pressing buttons) being done in a particular order. The actions the... | I suggest using *I pressed and used the buttons in combination with right time and right combination*. If you'd like to use *with the right combination* I think you should add *of sth* after combination, i.e. *with the right combination of sth* Please refer to [this post](https://english.stackexchange.com/questions/769... |
5,095,525 | After discovering jQuery a few years ago, I realized how easy it was to really make interactive and user friendly websites without writing books of code. As the projects increased in size, so did also the time required to carry out any debugging or perhaps implementing a change or new feature.
From reading various bl... | 2011/02/23 | [
"https://Stackoverflow.com/questions/5095525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198128/"
] | Check out this book, mainly chapter 10 <http://jqfundamentals.com/book/index.html#chapter-10> | My suggestion would be is to isolate as much javascript as possible into external js files, outside of your views, and simply reference them in the headers. Not only does this allow javascript re-use from page to page, but it separates your concerns on a fair level, spreading out your code to allow for easier debugging... |
5,095,525 | After discovering jQuery a few years ago, I realized how easy it was to really make interactive and user friendly websites without writing books of code. As the projects increased in size, so did also the time required to carry out any debugging or perhaps implementing a change or new feature.
From reading various bl... | 2011/02/23 | [
"https://Stackoverflow.com/questions/5095525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198128/"
] | Both Backbone.js and JavascriptMVC are great examples of using a framework to organize large projects in a sane way ([SproutCore](http://www.sproutcore.com/) and [Cappuccino](http://cappuccino.org/) are nice too). I definitely suggest you choose a standard way of deal with data from the server, handling events from the... | Check out this book, mainly chapter 10 <http://jqfundamentals.com/book/index.html#chapter-10> |
5,095,525 | After discovering jQuery a few years ago, I realized how easy it was to really make interactive and user friendly websites without writing books of code. As the projects increased in size, so did also the time required to carry out any debugging or perhaps implementing a change or new feature.
From reading various bl... | 2011/02/23 | [
"https://Stackoverflow.com/questions/5095525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198128/"
] | Both Backbone.js and JavascriptMVC are great examples of using a framework to organize large projects in a sane way ([SproutCore](http://www.sproutcore.com/) and [Cappuccino](http://cappuccino.org/) are nice too). I definitely suggest you choose a standard way of deal with data from the server, handling events from the... | My suggestion would be is to isolate as much javascript as possible into external js files, outside of your views, and simply reference them in the headers. Not only does this allow javascript re-use from page to page, but it separates your concerns on a fair level, spreading out your code to allow for easier debugging... |
5,095,525 | After discovering jQuery a few years ago, I realized how easy it was to really make interactive and user friendly websites without writing books of code. As the projects increased in size, so did also the time required to carry out any debugging or perhaps implementing a change or new feature.
From reading various bl... | 2011/02/23 | [
"https://Stackoverflow.com/questions/5095525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198128/"
] | I would like to recommend using javascript in a functional style which can be helped by abstractions like [coffeescript](http://jashkenas.github.com/coffee-script/) and [underscore.js](http://documentcloud.github.com/underscore/).
Also minimising the cross module interaction and relying on an event driven code is a gr... | My suggestion would be is to isolate as much javascript as possible into external js files, outside of your views, and simply reference them in the headers. Not only does this allow javascript re-use from page to page, but it separates your concerns on a fair level, spreading out your code to allow for easier debugging... |
5,095,525 | After discovering jQuery a few years ago, I realized how easy it was to really make interactive and user friendly websites without writing books of code. As the projects increased in size, so did also the time required to carry out any debugging or perhaps implementing a change or new feature.
From reading various bl... | 2011/02/23 | [
"https://Stackoverflow.com/questions/5095525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/198128/"
] | Both Backbone.js and JavascriptMVC are great examples of using a framework to organize large projects in a sane way ([SproutCore](http://www.sproutcore.com/) and [Cappuccino](http://cappuccino.org/) are nice too). I definitely suggest you choose a standard way of deal with data from the server, handling events from the... | I would like to recommend using javascript in a functional style which can be helped by abstractions like [coffeescript](http://jashkenas.github.com/coffee-script/) and [underscore.js](http://documentcloud.github.com/underscore/).
Also minimising the cross module interaction and relying on an event driven code is a gr... |
71,084,990 | I have this question and I haven't found specific documentation to confirm the behavior and am unaware of how to manually check this myself.
Consider I have table A with b\_id foreign key to table B. If I run an update on a row in table A, does mysql always run the foreign key constraint check on table B even if A's b... | 2022/02/11 | [
"https://Stackoverflow.com/questions/71084990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3509128/"
] | Foreign key integrity is checked always when the server detects that the data is changed by fact and needs in save to the disk. It is checked after all BEFORE UPDATE triggers execution (rather than data type check which is performed each time, before and after each separate trigger).
The reason is simple. Server does ... | When you add a foreign key constraint, [MySQL requires an index](https://dev.mysql.com/doc/refman/8.0/en/constraint-foreign-key.html):
>
> MySQL requires that foreign key columns be indexed; if you create a table with a foreign key constraint but no index on a given column, an index is created.
>
>
>
To clarify, ... |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | I use a log table instead of dbms\_output. Make sure to setup as autonomous transaction, something like (modify for your needs of course):
```
create or replace package body somePackage as
...
procedure ins_log(
i_msg in varchar2,
i_msg_type in varchar2,
i_msg_code in number default 0,
i_msg_context in varchar2 defaul... | It depends on the ratio of how many times you call `dbms_output.put_line` versus what else you do in PL/SQL. |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | Yes, it's another piece of code that needs to be executed, but unless the output is actually turned on, I think the overhead is quite minimal.
Here's an AskTom question with more details: [Is there a performance impact for dbms\_output.put\_line statements left in packages?](http://asktom.oracle.com/pls/asktom/f?p=100... | You can look into [conditional compilation](http://www.oracle-base.com/articles/10g/ConditionalCompilation_10gR2.php) so that the DBMS\_OUTPUT.PUT\_LINE are only in the pre-parsed code if the procedure is compiled with the appropriate option.
One question is, has DBMS\_OUTPUT.ENABLE been called.
If so, any value in a ... |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | Yes, it's another piece of code that needs to be executed, but unless the output is actually turned on, I think the overhead is quite minimal.
Here's an AskTom question with more details: [Is there a performance impact for dbms\_output.put\_line statements left in packages?](http://asktom.oracle.com/pls/asktom/f?p=100... | Using DMBS\_OUTPUT might also be the cause of the following error:
ORA-04036: PGA memory used by the instance exceeds PGA\_AGGREGATE\_LIMIT |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | You can look into [conditional compilation](http://www.oracle-base.com/articles/10g/ConditionalCompilation_10gR2.php) so that the DBMS\_OUTPUT.PUT\_LINE are only in the pre-parsed code if the procedure is compiled with the appropriate option.
One question is, has DBMS\_OUTPUT.ENABLE been called.
If so, any value in a ... | It depends on the ratio of how many times you call `dbms_output.put_line` versus what else you do in PL/SQL. |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | *Every* extra line of code decreases the performance of code. After all, it is an extra instruction to be executed, which at least consumes some CPU. So yes, dbms\_output.put\_line decreases the performance.
The real question is: does the benefit of this extra line of code outweigh the performance penalty? Only you ca... | I use a log table instead of dbms\_output. Make sure to setup as autonomous transaction, something like (modify for your needs of course):
```
create or replace package body somePackage as
...
procedure ins_log(
i_msg in varchar2,
i_msg_type in varchar2,
i_msg_code in number default 0,
i_msg_context in varchar2 defaul... |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | Yes, it's another piece of code that needs to be executed, but unless the output is actually turned on, I think the overhead is quite minimal.
Here's an AskTom question with more details: [Is there a performance impact for dbms\_output.put\_line statements left in packages?](http://asktom.oracle.com/pls/asktom/f?p=100... | It depends on the ratio of how many times you call `dbms_output.put_line` versus what else you do in PL/SQL. |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | You can look into [conditional compilation](http://www.oracle-base.com/articles/10g/ConditionalCompilation_10gR2.php) so that the DBMS\_OUTPUT.PUT\_LINE are only in the pre-parsed code if the procedure is compiled with the appropriate option.
One question is, has DBMS\_OUTPUT.ENABLE been called.
If so, any value in a ... | Using DMBS\_OUTPUT might also be the cause of the following error:
ORA-04036: PGA memory used by the instance exceeds PGA\_AGGREGATE\_LIMIT |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | I use a log table instead of dbms\_output. Make sure to setup as autonomous transaction, something like (modify for your needs of course):
```
create or replace package body somePackage as
...
procedure ins_log(
i_msg in varchar2,
i_msg_type in varchar2,
i_msg_code in number default 0,
i_msg_context in varchar2 defaul... | Using DMBS\_OUTPUT might also be the cause of the following error:
ORA-04036: PGA memory used by the instance exceeds PGA\_AGGREGATE\_LIMIT |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | *Every* extra line of code decreases the performance of code. After all, it is an extra instruction to be executed, which at least consumes some CPU. So yes, dbms\_output.put\_line decreases the performance.
The real question is: does the benefit of this extra line of code outweigh the performance penalty? Only you ca... | Using DMBS\_OUTPUT might also be the cause of the following error:
ORA-04036: PGA memory used by the instance exceeds PGA\_AGGREGATE\_LIMIT |
4,919,437 | Does `dbms_output.put_line` decrease the performance in `plsql` code? | 2011/02/07 | [
"https://Stackoverflow.com/questions/4919437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/606147/"
] | Yes, it's another piece of code that needs to be executed, but unless the output is actually turned on, I think the overhead is quite minimal.
Here's an AskTom question with more details: [Is there a performance impact for dbms\_output.put\_line statements left in packages?](http://asktom.oracle.com/pls/asktom/f?p=100... | I use a log table instead of dbms\_output. Make sure to setup as autonomous transaction, something like (modify for your needs of course):
```
create or replace package body somePackage as
...
procedure ins_log(
i_msg in varchar2,
i_msg_type in varchar2,
i_msg_code in number default 0,
i_msg_context in varchar2 defaul... |
72,038,470 | WHy does the value of `calendar.SelectedDate` include a time (eg.: 22-04-2022 00:00:00) when the user has picked a date?
In fact, I am interested in picking both a date and time but apparently, from what I've read, it seems like you can't pick a time from the calendar element in the program UI and I don't understand wh... | 2022/04/28 | [
"https://Stackoverflow.com/questions/72038470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18750341/"
] | WPF calendar has the default DateTime property. Neither only Date nor only Time it has `Nullable<DateTime>` default property, so it always along with Time. You would avoid it by setting below code
```
post.date = calendar.SelectedDate.Value.Date.ToShortDateString();
``` | >
> WHy does the value of calendar.SelectedDate include a time (eg.: 22-04-2022 00:00:00) when the user has picked a date?
>
>
>
Simply because there is no date-only data type available in .NET and the `Calendar` control uses the `DateTime` type to store the selected date. That's why.
>
> it seems like you can't... |
72,038,470 | WHy does the value of `calendar.SelectedDate` include a time (eg.: 22-04-2022 00:00:00) when the user has picked a date?
In fact, I am interested in picking both a date and time but apparently, from what I've read, it seems like you can't pick a time from the calendar element in the program UI and I don't understand wh... | 2022/04/28 | [
"https://Stackoverflow.com/questions/72038470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18750341/"
] | DateTime.toString() support formatting the date and time and this can be use to get only date not time as shown in the below code.
```
post.date = calendar.sele.ToString("dd-MMM-yyyy");
DateLabel.Content = $"Date and time for post: {post.date}";
``` | >
> WHy does the value of calendar.SelectedDate include a time (eg.: 22-04-2022 00:00:00) when the user has picked a date?
>
>
>
Simply because there is no date-only data type available in .NET and the `Calendar` control uses the `DateTime` type to store the selected date. That's why.
>
> it seems like you can't... |
46,117,380 | I have an express app that I start in terminal with following command to enable debug logs in it:
```
DEBUG=custom:* npm start (on Ubuntu)
SET DEBUG=custom:* & npm start (on Windows)
```
On production server, I start app with PM2 using following command:
```
pm2 start bin/www -i 0
```
But this does not enable the... | 2017/09/08 | [
"https://Stackoverflow.com/questions/46117380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3801947/"
] | You can parse it yourself with a function, here's an example:
```
function getTextWithInputValues(id) {
var element = document.getElementById(id);
if (!element) {
return null;
}
var elementText = element.innerHTML; // Get the entire text from your element
var elementInputs = element.getEl... | Even though you asked for `REGEX`, I don't believe it is by any means needed.
This will return the data in an array. With the first index being the body text, and each input field value thereafter.
```
var values = [];
values.push($('#body').text());
var inputs = $('#body input');
for(var i = 0; i < $(inputs).lengt... |
25,349,941 | I'm struggling for about 3 hours for now to fasten my Project Euler #12 code. I achieved to save a few seconds for the case that numbers has over 130 divisors, my first program went to 2.33 seconds now it does it in 1.169 seconds. However I never had the patience to wait for the 500 divisors number. How can I fasten my... | 2014/08/17 | [
"https://Stackoverflow.com/questions/25349941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3899440/"
] | The **big** slow down is in your isPrime() method.
Take a look at counting factors by prime factorization. You'll see that counting 500 factors is MUCH quicker this way.
<http://www.mathsisfun.com/prime-factorization.html>
Also, how you're getting your triangular numbers should be much simpler.
```
1, 3, 6, 10, 15,... | Some Python functions around this question. It uses [Counters](https://docs.python.org/2/library/collections.html#collections.Counter), the perfect
high level tool to do that. Hope this can help you to find the keys enhancements.
```
from collections import Counter
def factors(n):
divisor=2
while divisor*d... |
25,349,941 | I'm struggling for about 3 hours for now to fasten my Project Euler #12 code. I achieved to save a few seconds for the case that numbers has over 130 divisors, my first program went to 2.33 seconds now it does it in 1.169 seconds. However I never had the patience to wait for the 500 divisors number. How can I fasten my... | 2014/08/17 | [
"https://Stackoverflow.com/questions/25349941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3899440/"
] | The **big** slow down is in your isPrime() method.
Take a look at counting factors by prime factorization. You'll see that counting 500 factors is MUCH quicker this way.
<http://www.mathsisfun.com/prime-factorization.html>
Also, how you're getting your triangular numbers should be much simpler.
```
1, 3, 6, 10, 15,... | I solved this question using a Greedy algorithm less than 0.187 ms.
```
static void Main(string[] args)
{
// 76576500
long age = 10000;
double alpha = 1.5;
double betta = 0.1;
Random ran = new Random();
long mmm = long.MaxValue;
double RR = 0;
var... |
932,278 | Let say
$$f(x) := \left\{\begin{array}{l l}x+1 & \text{ if } -2\leq x<0 \\ x-1 & \text{ if }0\leq x\leq 2\end{array}\right.$$
How can we find out $f\circ f$? | 2014/09/15 | [
"https://math.stackexchange.com/questions/932278",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/176196/"
] | **Hint:** First, verify that $f(x) \subset [-2,2]$ to be sure that the composition $f \circ f$ is well defined. Then you should carefully separate the cases. Here's an example for the first steps:
If $-2 \leq x < 0$ then $f(x) = x+1$ and so $f(x) < 0$ for $-2 \leq x < -1$, it follows that $f\circ f(x) = ((x+1)+1)$ for... | Hint: The first thing to do is to write down the domain and codomain of your function. Here we have:
\begin{equation}
f:[-2,2]\longrightarrow[-1,1]
\end{equation}
Next, since $[-1,1]\subset[-2,2]$, it is OK to compose $f$ with itself. Try to figure out yourself what $f\circ f$ does. |
66,144,093 | This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to... | 2021/02/10 | [
"https://Stackoverflow.com/questions/66144093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443654/"
] | **Solved**!
Step;
1. Clean your project
2. Generate signed yours bundle/.apk file
3. Uncheck the "Remember password"
4. Manually put your password at "Key store password" and "Key password"
5. Click Next and you Done!.
*Android studio update bring this bug.* | I faced the same problem. Android Studio saves passwords in a bad format.
I solved it by typing the password manually again. |
66,144,093 | This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to... | 2021/02/10 | [
"https://Stackoverflow.com/questions/66144093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443654/"
] | It is a bug in Android Studio 4.2.+
You have to manually type password each time you generate signed APK! | I faced the same problem. Android Studio saves passwords in a bad format.
I solved it by typing the password manually again. |
66,144,093 | This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to... | 2021/02/10 | [
"https://Stackoverflow.com/questions/66144093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443654/"
] | **Solved**!
Step;
1. Clean your project
2. Generate signed yours bundle/.apk file
3. Uncheck the "Remember password"
4. Manually put your password at "Key store password" and "Key password"
5. Click Next and you Done!.
*Android studio update bring this bug.* | It is a bug in Android Studio 4.2.+
You have to manually type password each time you generate signed APK! |
66,144,093 | This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to... | 2021/02/10 | [
"https://Stackoverflow.com/questions/66144093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443654/"
] | **Solved**!
Step;
1. Clean your project
2. Generate signed yours bundle/.apk file
3. Uncheck the "Remember password"
4. Manually put your password at "Key store password" and "Key password"
5. Click Next and you Done!.
*Android studio update bring this bug.* | Android Studio tries to use the ASCII which is generated as you give your passwords but as it tries to re generate it based on your system language and datetime it can differ in some charachters. So, in some special cases it is better to use your keyboard to type your password.
](https://i.stack.imgur.com/78EnQ.png) |
66,144,093 | This happens in Android Studio Beta. Used to work in the other builds as I recall. Now, I either have to generate a new key every time I generate the apk or manually enter my password due to this error. My password is ASCII. Simple characters A thru Z and a thru z. It takes the key just fine, but the next time I try to... | 2021/02/10 | [
"https://Stackoverflow.com/questions/66144093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443654/"
] | It is a bug in Android Studio 4.2.+
You have to manually type password each time you generate signed APK! | Android Studio tries to use the ASCII which is generated as you give your passwords but as it tries to re generate it based on your system language and datetime it can differ in some charachters. So, in some special cases it is better to use your keyboard to type your password.
](https://i.stack.imgur.com/78EnQ.png) |
661,104 | I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL.
**Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac... | 2009/03/19 | [
"https://Stackoverflow.com/questions/661104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2405/"
] | You could initiate the wizard from within JavaScript and have the applet return the execution flow to the JavaScript caller on clicking the 'Finish' button. Once you are in JavaScript you could then navigate to a new location, either by doing a form post or by doing changing the window.location property.
In the worst ... | If you're using Java 6 and above, see the [Desktop](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/) API. That'll drive a browser. However I don't know if the applet security model will interfere with this.
Other than that, I've used [BrowserLauncher2](http://browserlaunch2.sourceforg... |
661,104 | I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL.
**Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac... | 2009/03/19 | [
"https://Stackoverflow.com/questions/661104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2405/"
] | From the applet you can simply get the applet context and call [showDocument(url)](http://java.sun.com/javase/6/docs/api/java/applet/AppletContext.html#showDocument(java.net.URL)).
This will navigate away from the current page to the specified URL:
```
getAppletContext().showDocument(url);
```
Additionally you can ... | You could initiate the wizard from within JavaScript and have the applet return the execution flow to the JavaScript caller on clicking the 'Finish' button. Once you are in JavaScript you could then navigate to a new location, either by doing a form post or by doing changing the window.location property.
In the worst ... |
661,104 | I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL.
**Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac... | 2009/03/19 | [
"https://Stackoverflow.com/questions/661104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2405/"
] | You could initiate the wizard from within JavaScript and have the applet return the execution flow to the JavaScript caller on clicking the 'Finish' button. Once you are in JavaScript you could then navigate to a new location, either by doing a form post or by doing changing the window.location property.
In the worst ... | ```
String googleURL = "https://www.google.com/";
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(googleURL));
}
catch(IOException ex) {
Logger.getLogger(UI.class.getName()).log(Level.SEVERE,null, ex);
}
``` |
661,104 | I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL.
**Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac... | 2009/03/19 | [
"https://Stackoverflow.com/questions/661104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2405/"
] | From the applet you can simply get the applet context and call [showDocument(url)](http://java.sun.com/javase/6/docs/api/java/applet/AppletContext.html#showDocument(java.net.URL)).
This will navigate away from the current page to the specified URL:
```
getAppletContext().showDocument(url);
```
Additionally you can ... | If you're using Java 6 and above, see the [Desktop](http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/) API. That'll drive a browser. However I don't know if the applet security model will interfere with this.
Other than that, I've used [BrowserLauncher2](http://browserlaunch2.sourceforg... |
661,104 | I have a Java applet consisting of a wizard-like form with three steps. At the final step, the user can click a "finish" button. I want that button to cause the web browser to navigate to a specific URL.
**Question:** Is there a way to cause the browser to navigate to a specific URL, in such a way that it will work ac... | 2009/03/19 | [
"https://Stackoverflow.com/questions/661104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2405/"
] | From the applet you can simply get the applet context and call [showDocument(url)](http://java.sun.com/javase/6/docs/api/java/applet/AppletContext.html#showDocument(java.net.URL)).
This will navigate away from the current page to the specified URL:
```
getAppletContext().showDocument(url);
```
Additionally you can ... | ```
String googleURL = "https://www.google.com/";
try {
java.awt.Desktop.getDesktop().browse(java.net.URI.create(googleURL));
}
catch(IOException ex) {
Logger.getLogger(UI.class.getName()).log(Level.SEVERE,null, ex);
}
``` |
44,251,180 | So after a bit of stringy business, I was able to get a large chunk of substring from a haystack of string closer to my target after searching the first occurrence of `"getflashmedia"`
```
var_dump($str) =
string(1735) "getflashmedia" src="http://www.exampleURL.com/media-name.mp4"></object>
.../*a haystack of... | 2017/05/29 | [
"https://Stackoverflow.com/questions/44251180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4169959/"
] | Use a regular expression, I'd recommend the following: `src="(.*?)"`.
This expression matches `src="` literally, then starts capturing and stops when it finds another `"`.
```
<?php
$input = 'getflashmedia" src="http://www.exampleURL.com/media-name.mp4"></object>';
preg_match_all('/src="(.*?)"/', $input, $matches)... | I would strongly recommend rather than using string functions or regular expressions to parse XML/HTML, you should use XML parsers. You can build a much more reliable scraper this way.
XML parsers can handle situations you may not think of when writing your string handling code.
See XML Parser: <http://php.net/manua... |
5,469,736 | I want paste button only when I select copy option. When copy option is not selected the paste button should not come on the screen.
How can I do it? | 2011/03/29 | [
"https://Stackoverflow.com/questions/5469736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | >
> Where is the best place to start?
>
>
>
Here: <http://www.asp.net/mvc/mvc3> | I wrote a blog post on [Dealing with javascript or JSON results after an AJAX call with Ajax.ActionLink, unobtrusive AJAX and MVC 3](http://www.sharpedgesoftware.com/Blog/2011/02/27/dealing-with-javascript-or-json-results-after-an-ajax-call-with-ajaxactionlink-unobtrusive-ajax-and-) that might help you along. |
5,469,736 | I want paste button only when I select copy option. When copy option is not selected the paste button should not come on the screen.
How can I do it? | 2011/03/29 | [
"https://Stackoverflow.com/questions/5469736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | >
> Where is the best place to start?
>
>
>
Here: <http://www.asp.net/mvc/mvc3> | I always found pluralsight tutorials very helpful and they have a couple on MVC3.
<http://www.pluralsight-training.net/microsoft/olt/courses.aspx>
Alternatively check out this article by Jon Galloway which lists lots of tutorials and resources:
<http://weblogs.asp.net/jgalloway/archive/2011/03/17/asp-net-mvc-3-roundu... |
5,469,736 | I want paste button only when I select copy option. When copy option is not selected the paste button should not come on the screen.
How can I do it? | 2011/03/29 | [
"https://Stackoverflow.com/questions/5469736",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I always found pluralsight tutorials very helpful and they have a couple on MVC3.
<http://www.pluralsight-training.net/microsoft/olt/courses.aspx>
Alternatively check out this article by Jon Galloway which lists lots of tutorials and resources:
<http://weblogs.asp.net/jgalloway/archive/2011/03/17/asp-net-mvc-3-roundu... | I wrote a blog post on [Dealing with javascript or JSON results after an AJAX call with Ajax.ActionLink, unobtrusive AJAX and MVC 3](http://www.sharpedgesoftware.com/Blog/2011/02/27/dealing-with-javascript-or-json-results-after-an-ajax-call-with-ajaxactionlink-unobtrusive-ajax-and-) that might help you along. |
7,800,882 | I have two services IServiceA and IServiceB. The concrete implementation of IServiceB looks like this:
```
public class ServiceB : IServiceB {
public ServiceB(string path, IServiceA serviceA) { ... }
}
```
So I need to pass in a string and a ServiceA.
I'm kinda stuck how I would do that. I have this right now:
... | 2011/10/17 | [
"https://Stackoverflow.com/questions/7800882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91/"
] | It's not particularly well documented, but this appears to work:
```
container.RegisterType<IServiceA, ServiceA>();
container.RegisterType<IServiceB, ServiceB>(
new InjectionConstructor(path, new ResolvedParameter<IServiceA>()));
```
I would recommend testing it before using it in production. | I believe you also can do:
```
container.RegisterType<IServiceA, ServiceA>();
container.RegisterType<IServiceB, ServiceB>(
new InjectionConstructor(path, typeof(IServiceA)));
``` |
15,868 | I have designed a hybrid(keywords and data in same excel sheet) framework using `WebDriver`+`Java`+`TestNG`+`Maven`. I am using `PageFactory`, `Singleton Pattern` . I am using different type of HTML locators in my framework like `id`, `css`, `xpath`. I run tests on UNIX environment.
I was told that using id instead of... | 2015/11/30 | [
"https://sqa.stackexchange.com/questions/15868",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/7741/"
] | This may not be a full answer to your question but I think it fits to the topic:
I was wondering about the "id is faster than xpath" and start searching. [This SO-Question/Answer](https://stackoverflow.com/questions/16788310/what-is-the-difference-between-css-selector-xpath-which-is-betteraccording-t) gives an answer ... | A typical way to measure the length of a short operation is to measure the total time required to perform the operation many times, divided by the number of times you performed it. How many times? It depends on the operation; I usually start with a small number and keep doubling it, or multiplying by ten, until the ans... |
15,868 | I have designed a hybrid(keywords and data in same excel sheet) framework using `WebDriver`+`Java`+`TestNG`+`Maven`. I am using `PageFactory`, `Singleton Pattern` . I am using different type of HTML locators in my framework like `id`, `css`, `xpath`. I run tests on UNIX environment.
I was told that using id instead of... | 2015/11/30 | [
"https://sqa.stackexchange.com/questions/15868",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/7741/"
] | I see two possible intepretations of your question here. The first is "How can I improve the speed of how elements are found on a page?". Another is "How can I improve execution speed of my suite of tests?".
The first question has some answers already. You've found that `xpath` vs `id` doesn't provide much speedup, s... | A typical way to measure the length of a short operation is to measure the total time required to perform the operation many times, divided by the number of times you performed it. How many times? It depends on the operation; I usually start with a small number and keep doubling it, or multiplying by ten, until the ans... |
59,081,148 | First a question:
I am a complete newbie. Is it correct that postgresql installs with some default passwords without asking to change it during installation? What are those passwords? I am just playing with an app and if I know the default passwords, everything will be okay.
As you could tell I don't have the default... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59081148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4732120/"
] | If you have an object to log, I recommend just pass it directly to `console.log()`. `JSON.stringify()` might be adding carriage returns, which could be interpreted as multiple lines to log.
```
console.log({key1: 'val1', key2: 'val2'})
```
Just make sure that the object doesn't contain references to other very compl... | Neither console.log(data) nor console.log(JSON.stringify(data)) worked for me.
Using the sdk logger worked for me:
```
import * as functions from 'firebase-functions';
functions.logger.log(data);
```
As described here:
<https://firebase.google.com/docs/functions/writing-and-viewing-logs#logger-sdk> |
59,081,148 | First a question:
I am a complete newbie. Is it correct that postgresql installs with some default passwords without asking to change it during installation? What are those passwords? I am just playing with an app and if I know the default passwords, everything will be okay.
As you could tell I don't have the default... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59081148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4732120/"
] | If you have an object to log, I recommend just pass it directly to `console.log()`. `JSON.stringify()` might be adding carriage returns, which could be interpreted as multiple lines to log.
```
console.log({key1: 'val1', key2: 'val2'})
```
Just make sure that the object doesn't contain references to other very compl... | If you put
```
require('firebase-functions/lib/logger/compat');
```
at the top of your functions code with the latest version of the sdk
logs should come in 1 single line
src: <https://github.com/firebase/firebase-functions/issues/612#issuecomment-646652675> |
59,081,148 | First a question:
I am a complete newbie. Is it correct that postgresql installs with some default passwords without asking to change it during installation? What are those passwords? I am just playing with an app and if I know the default passwords, everything will be okay.
As you could tell I don't have the default... | 2019/11/28 | [
"https://Stackoverflow.com/questions/59081148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4732120/"
] | Neither console.log(data) nor console.log(JSON.stringify(data)) worked for me.
Using the sdk logger worked for me:
```
import * as functions from 'firebase-functions';
functions.logger.log(data);
```
As described here:
<https://firebase.google.com/docs/functions/writing-and-viewing-logs#logger-sdk> | If you put
```
require('firebase-functions/lib/logger/compat');
```
at the top of your functions code with the latest version of the sdk
logs should come in 1 single line
src: <https://github.com/firebase/firebase-functions/issues/612#issuecomment-646652675> |
14,850,855 | **CODE :**
**.htaccess:**
```
RewriteEngine On
RewriteRule ^(.*)/*$ base.php?request=$1 [NC,L]
```
**base.php**
```
<?php
echo "this is base.php <br/> and Get Vaiables <br> ";
print_r($_GET);
?>
```
*for the request:*
```
localhost/blahblahproject/hello
```
**EXPECTED RESULT:**
>
> t... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14850855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2067797/"
] | Change your .htaccess rule to this:
```
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ /base.php?request=$1 [QSA,L]
``` | `.htaccess` only redirects url to your get parameter. To retrieve the url value, use `parse_url` or similar command.
I have a function like this to do the job:
```
/**
* Sets current request url
*/
private function setUrl() {
$path = parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH );
$pathTrimmed = trim(... |
14,850,855 | **CODE :**
**.htaccess:**
```
RewriteEngine On
RewriteRule ^(.*)/*$ base.php?request=$1 [NC,L]
```
**base.php**
```
<?php
echo "this is base.php <br/> and Get Vaiables <br> ";
print_r($_GET);
?>
```
*for the request:*
```
localhost/blahblahproject/hello
```
**EXPECTED RESULT:**
>
> t... | 2013/02/13 | [
"https://Stackoverflow.com/questions/14850855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2067797/"
] | Change your .htaccess rule to this:
```
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ /base.php?request=$1 [QSA,L]
``` | If you are interested in the string after the last "/", change your .htaccess file to:
```
RewriteEngine On
RewriteRule ^.*/(.*)$ base.php?request=$1 [NC,L]
``` |
6,537,541 | I've followed the Google app script tutorial [here](http://www.youtube.com/user/GoogleDocsCommunity#p/c/0/5VmEPo6Rkq4) which is a very simple script with two functions. `showDialog` (which presents a dialog box with a text field and submit button ) and `respondToSubmit(e)` which handles the submit button and adds the e... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/516286/"
] | As of right now, the debugger has some unexpected behaviours. Mostly, it seems to only respect breakpoints during calls from the script editor, so to debug your event handler you must call it from the debugger, not the UI. If you need to peek into variables such as the event object passed to the function, for example, ... | It seems to me that the Logger does not work either, unless run from the script editor. I did manage `Browser.msgbox(Utilities.jsonStringify(e))` which had brought the (expected) result:
`{"parameter":{"clientY":"45","clientX":"37","eventType":"click","ctrl":"false","meta":"false","source":"u12053277590","button":"1",... |
6,537,541 | I've followed the Google app script tutorial [here](http://www.youtube.com/user/GoogleDocsCommunity#p/c/0/5VmEPo6Rkq4) which is a very simple script with two functions. `showDialog` (which presents a dialog box with a text field and submit button ) and `respondToSubmit(e)` which handles the submit button and adds the e... | 2011/06/30 | [
"https://Stackoverflow.com/questions/6537541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/516286/"
] | For reference Utilities.jsonStringify(e) is depricated, use JSON.stringify() and JSON.parse() instead. | It seems to me that the Logger does not work either, unless run from the script editor. I did manage `Browser.msgbox(Utilities.jsonStringify(e))` which had brought the (expected) result:
`{"parameter":{"clientY":"45","clientX":"37","eventType":"click","ctrl":"false","meta":"false","source":"u12053277590","button":"1",... |
7,333,873 | I am buidling an app in CakePHP. I have 2 models:
- Project
- User
The Project model has various belongsTo relations to the user model, one for the creator, one for the last editor and one for the manager. This works fine.
Then I add a virtual field to the User model, called 'name', which is CONCAT(first\_name, ' ', ... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7333873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565907/"
] | Showing the exact queries should help resolve this problem. But if you are joining 2 tables, and they both have a column with the same name. you have to reference the column with TableName.ColumnName, like this.
```
Select Table1.Column1 AS someColumn, Table2.Column1 AS SomeOtherColumn
FROM Table1
INNER JOIN Table2
O... | Try specifying what table the first\_name column is from. Something like this:
```
CONCAT(table1.first_name,'',table1.last_name)
``` |
7,333,873 | I am buidling an app in CakePHP. I have 2 models:
- Project
- User
The Project model has various belongsTo relations to the user model, one for the creator, one for the last editor and one for the manager. This works fine.
Then I add a virtual field to the User model, called 'name', which is CONCAT(first\_name, ' ', ... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7333873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565907/"
] | I found the solution: <http://book.cakephp.org/view/1632/Virtual-fields-and-model-aliases> | Try specifying what table the first\_name column is from. Something like this:
```
CONCAT(table1.first_name,'',table1.last_name)
``` |
31,541,814 | There are topics online that are discussing this problem however, I couldn't find any tidy explanation of the problem or any solid answers for the question. What I am trying to achieve is connecting Laravel 5.1 to MySQL Database of MAMP.
---
In my ***config>app.php:***
```
'default' => env('DB_CONNECTION', 'mysql... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31541814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4705339/"
] | It was pretty simple for me, I added :8889 to the localhost in the .env file.
DB\_HOST=localhost:8889
This is because in the MAMP preferences, :8889 is the default port. | **Found my answer. Here is a way to fix it:**
* Start MAMP
* On the top left, go to "MAMP" -> "Preferences"
* Go to the "PHP" tab
* Tick PHP 5.5.17 (or whatever you have) instead of the one which is ticked by default (5.6.1 -> 5.5.17 with he latest version of MAMP) |
31,541,814 | There are topics online that are discussing this problem however, I couldn't find any tidy explanation of the problem or any solid answers for the question. What I am trying to achieve is connecting Laravel 5.1 to MySQL Database of MAMP.
---
In my ***config>app.php:***
```
'default' => env('DB_CONNECTION', 'mysql... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31541814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4705339/"
] | The most important thing for me was defining the UNIX socket. Because I have another MYSQL on my machine - Laravel was trying to connect to a database in that MYSQL process.
Defining the UNIX for the MAMP database to be used worked perfectly. Try adding this to your MYSQL configuration in database.php
```
'mysql'... | **Found my answer. Here is a way to fix it:**
* Start MAMP
* On the top left, go to "MAMP" -> "Preferences"
* Go to the "PHP" tab
* Tick PHP 5.5.17 (or whatever you have) instead of the one which is ticked by default (5.6.1 -> 5.5.17 with he latest version of MAMP) |
31,541,814 | There are topics online that are discussing this problem however, I couldn't find any tidy explanation of the problem or any solid answers for the question. What I am trying to achieve is connecting Laravel 5.1 to MySQL Database of MAMP.
---
In my ***config>app.php:***
```
'default' => env('DB_CONNECTION', 'mysql... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31541814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4705339/"
] | On mac or unix you have to include the socket path in the configuration database.php file
i.e `'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',` | **Found my answer. Here is a way to fix it:**
* Start MAMP
* On the top left, go to "MAMP" -> "Preferences"
* Go to the "PHP" tab
* Tick PHP 5.5.17 (or whatever you have) instead of the one which is ticked by default (5.6.1 -> 5.5.17 with he latest version of MAMP) |
31,541,814 | There are topics online that are discussing this problem however, I couldn't find any tidy explanation of the problem or any solid answers for the question. What I am trying to achieve is connecting Laravel 5.1 to MySQL Database of MAMP.
---
In my ***config>app.php:***
```
'default' => env('DB_CONNECTION', 'mysql... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31541814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4705339/"
] | It was pretty simple for me, I added :8889 to the localhost in the .env file.
DB\_HOST=localhost:8889
This is because in the MAMP preferences, :8889 is the default port. | The most important thing for me was defining the UNIX socket. Because I have another MYSQL on my machine - Laravel was trying to connect to a database in that MYSQL process.
Defining the UNIX for the MAMP database to be used worked perfectly. Try adding this to your MYSQL configuration in database.php
```
'mysql'... |
31,541,814 | There are topics online that are discussing this problem however, I couldn't find any tidy explanation of the problem or any solid answers for the question. What I am trying to achieve is connecting Laravel 5.1 to MySQL Database of MAMP.
---
In my ***config>app.php:***
```
'default' => env('DB_CONNECTION', 'mysql... | 2015/07/21 | [
"https://Stackoverflow.com/questions/31541814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4705339/"
] | It was pretty simple for me, I added :8889 to the localhost in the .env file.
DB\_HOST=localhost:8889
This is because in the MAMP preferences, :8889 is the default port. | As far as I am concerned it doesn't make any sense to set in **database.php** as many of them suggested.
Since this change would be mostly required in the **development mode**. So the proper way of setting the **unix\_socket** is as below
file: **.env**
```
DB_SOCKET='/Applications/MAMP/tmp/mysql/mysql.sock'
```
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.