qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
45,003,631 | I have a column where a date store in ddmmyy format (e.g. 151216). How can I convert it to yyyy-mm-dd format (e.g 2016-12-15) for calculating a date difference from the current date? I try using DATE\_FORMAT function but its not appropriate for this. | 2017/07/10 | ['https://Stackoverflow.com/questions/45003631', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2231075/'] | You can use the function, `STR_TO_DATE()` for this.
```
STR_TO_DATE('151216', '%d%m%y')
```
A query would look something like:
```
select
foo.bar
from
foo
where
STR_TO_DATE(foo.baz, '%d%m%y') < CURDATE()
```
Note: Since both `STR_TO_DATE()` and `CURDATE()` return date objects, there's no reason to cha... | ```
SELECT STR_TO_DATE('151216', '%d%m%y') FROM `table`
```
use this '%d%m%y' |
45,003,631 | I have a column where a date store in ddmmyy format (e.g. 151216). How can I convert it to yyyy-mm-dd format (e.g 2016-12-15) for calculating a date difference from the current date? I try using DATE\_FORMAT function but its not appropriate for this. | 2017/07/10 | ['https://Stackoverflow.com/questions/45003631', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2231075/'] | If you want to get the date difference, you can use `to_days()` after converting the string to a date using `str_to_date()`:
```
select to_days(curdate()) - to_days(str_to_date(col, '%d%m%y'))
```
or `datediff()`:
```
select datediff(curdate(), str_to_date(col, '%d%m%y'))
```
or `timestampdiff()`:
```
select tim... | ```
SELECT STR_TO_DATE('151216', '%d%m%y') FROM `table`
```
use this '%d%m%y' |
31,648,275 | I need to serialize a object class:
```
public class DigitalInput {
private String id;
private Date timestamp;
private String matter;
private String comment;
private String channelId;
private List<IndexableProperty> otherProps;
...
}
```
And I receive this JSON:
```
{
"timestamp":"... | 2015/07/27 | ['https://Stackoverflow.com/questions/31648275', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3227319/'] | Have you look at `Multibinder`?
This is example directly from [API](http://google.github.io/guice/api-docs/latest/javadoc/com/google/inject/multibindings/Multibinder.html)
```
public class SnacksModule extends AbstractModule {
protected void configure() {
Multibinder<Snack> multibinder
= Multibinder... | If you wanted to do something like this:
```
baseClass obj1;
obj1.add(new classAbc);
obj2.add(new classDef);
bind(interface1.class).toInstance(obj1);
```
You could, but only if your `baseClass` is of the *Composite pattern* (where objects can also act as containers for other objects). Otherwise, you'll need to pro... |
26,731,856 | Our parallel Fortran program is running more than twice slower after updating the OS to Ubuntu 14.04 and rebuilding with Gfortran 4.8.2. To measure which parts of the code were slowed down is unfortunately not possible any more (not without downgrading the OS) since I did not save any profiling information for gprof wh... | 2014/11/04 | ['https://Stackoverflow.com/questions/26731856', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4213557/'] | Probably this is not 100% a satisfactory answer, but it solved my performance problem. So here it is:
I decided to use GDB (Valgrid did not work for me): I compiled with the flag -g, executed with “gdb myprogramname”, typed “run” in the GDB prompt to execute the program, paused with ctr+C, checked what the threads wer... | ```
RW = 999.842594 + 6.793952E-2*T - 9.095290E-3*T*T+ 1.001685E-4*T*T*T - 1.120083E-6*T*T*T*T + 6.536332E-9*T*T*T*T*T
```
IF you need further improvement you can write above line as:
```
T2=T*T
T3=T2*T
T4=T3*T
T5=T4*T
RW=999.842594 + 6.793952E-2*T - 9.095290E-3*T2+ 1.001685E-4*T3 - 1.120083E-6*T4 + 6.536332E-9*... |
20,742,668 | The idea is to compare two jars and see if they were generated from same source and compare if they're identical at Binary/Byte code level. Also if they're both compiled with the same compiler i.e. Eclipse JDT or JIT etc compiler.
I've looked at Apache Common BCEL, but it only does comparison after decomposing the or... | 2013/12/23 | ['https://Stackoverflow.com/questions/20742668', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1257986/'] | you may try any of these following jar comparator tool as based on yours requirement..
[extradata-product](http://www.extradata.com/products/jarc/) free for personal use
[zardiff](http://zipdiff.sourceforge.net/) on sourceforge.
[japi-compilance-checker](http://ispras.linuxbase.org/index.php/Java_API_Compliance_Chec... | I like to use Beyond Compare (beware that it is not a free application)
<http://www.scootersoftware.com/> |
72,734,474 | Unable to load S3-hosted CSV into Spark Dataframe on Jupyter Notebook.
I believe I uploaded the 2 required packages with the `os.environ` line below. If I did it incorrectly please show me how to correctly install it. The Jupyter Notebook is hosted on an EC2 instance, which is why I'm trying to pull the CSV from a S3 ... | 2022/06/23 | ['https://Stackoverflow.com/questions/72734474', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3713236/'] | Here is an example using s3a.
```py
import os
import pyspark
os.environ['PYSPARK_SUBMIT_ARGS'] = '--packages com.amazonaws:aws-java-sdk-pom:1.10.34,org.apache.hadoop:hadoop-aws:2.7.2 pyspark-shell'
from pyspark.sql import SQLContext
from pyspark import SparkContext
sc = SparkContext()
sqlContext = SQLContext(sc)
fileP... | Try using `s3a` as protocol, you can find more details [here](https://hadoop.apache.org/docs/stable/hadoop-aws/tools/hadoop-aws/index.html).
```
df = spark.read.csv(f"s3a://{AWS_BUCKET}/prices/{ts}_all_prices_{user}.csv", inferSchema = True, header = True)
``` |
8,545,687 | after upgrading to latest version of eclipse **Helios 3.6**, **M2E 1.0** , **WTP 3.2.5**
and trying to run my maven project which uses **JSF 2.1.3** and **Spring 3** on **tomcat 7**, i am getting the following exception:
```
java.lang.ClassNotFoundException: javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObject... | 2011/12/17 | ['https://Stackoverflow.com/questions/8545687', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/429377/'] | You should add these dependencies only if you require them in your code meaning that they are required to compile your code. If you don't use JSP or EL classes in your code, you can remove the dependencies. So you can test if you need the dependencies by just removing them. If your code still compiles, you don't need t... | I had a similar problem: I was able to run a project in one computer, but in another one, I was obtaining the ClassNotFoundException described in the question.
The only difference between the 2 environments was the version of the tomcat server: 7.0.26 in the working computer and 7.0.16 in the other one. I installed th... |
55,885,621 | I'm trying to calculate two numbers and display them but when I click Calculate Total nothing happens and no numbers are displayed. I've been looking for a solution for hours now and just can't figure out why nothing happens when I click the button. If someone could help me out a little bit I'd be very grateful!
```js... | 2019/04/27 | ['https://Stackoverflow.com/questions/55885621', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11421201/'] | You can use [Laravel Queues](https://laravel.com/docs/5.8/queues#introduction) to defer the time consuming part (like api calls) to background jobs.
>
> Queues allow you to defer the processing of a time consuming task, such as sending an email, until a later time. Deferring these time consuming tasks drastically spe... | You could consider using **Guzzle's Promises** and sent requests in paralel.
The library is located here: <https://github.com/guzzle/promises>.
Guzzle client wraps the promises with magic methods like...
```php
$promise = $client->getAsync('http://httpbin.org/get');
$promise = $client->deleteAsync('http://httpbin.o... |
742,224 | Is there anything preventing this from happening? Is it a possible scenario?
ns1.edgecastdns.net. 172,800 IN (Internet) A (IPV4 Host Address) 192.16.16.5
ns1.edgecastdns.net. 172,800 IN (Internet) AAAA (IPV6 Host Address) 2606:2800:3::5
These two records have the same name so I think it could be serving the wrong re... | 2015/12/10 | ['https://serverfault.com/questions/742224', 'https://serverfault.com', 'https://serverfault.com/users/326614/'] | It's always possible that the DNS server could be buggy but it seems unlikely. If you query for a record of a particular type, that's the type you should get.
However, it is common for DNS servers to answer questions that haven't been asked as an optimization. In this case, it does appear to supply AAAA records as 'ad... | In a word: ***NO***
When you ask for an "A" record (IPv4), you will get an "A" answer or nothing. Likewise, when you ask for a "AAAA" record (IPv6), you will get a "AAAA" answer or nothing.
(IPv4 and IPv6 are *different* protocols. Just because they share the letters EYE and PEE, doesn't mean they are even remotely c... |
742,224 | Is there anything preventing this from happening? Is it a possible scenario?
ns1.edgecastdns.net. 172,800 IN (Internet) A (IPV4 Host Address) 192.16.16.5
ns1.edgecastdns.net. 172,800 IN (Internet) AAAA (IPV6 Host Address) 2606:2800:3::5
These two records have the same name so I think it could be serving the wrong re... | 2015/12/10 | ['https://serverfault.com/questions/742224', 'https://serverfault.com', 'https://serverfault.com/users/326614/'] | It's always possible that the DNS server could be buggy but it seems unlikely. If you query for a record of a particular type, that's the type you should get.
However, it is common for DNS servers to answer questions that haven't been asked as an optimization. In this case, it does appear to supply AAAA records as 'ad... | Just adding a little to the other answers.
The others answers are correct regarding what you get in the answer section of your packet. If your client asks for an `A` record in the query, the answer section will only return an `A` record or a `CNAME` which may or may not point to a different record containing an `A` va... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | After selecting all summernote's you need to access their attributes by specifying one element like:
```
<script>
$('.summernote').each(function(i, obj) { $(obj).summernote({
onblur: function(e) {
var id = $(obj).data('id');
var sHTML = $(obj).code();
alert(sHTML);
}
});
});
</script>
``... | I Finally got the code working for multiple summernote editors and image uploading!
To fix
>
> "undefined"
>
>
>
, try:
>
> var id = $(obj).data('id');
>
>
>
to
>
> var id= $(obj).attr('id'))
>
>
>
Source:
<https://github.com/neblina-software/balerocms-enterprise/blob/master/src/main/resources/stat... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | After selecting all summernote's you need to access their attributes by specifying one element like:
```
<script>
$('.summernote').each(function(i, obj) { $(obj).summernote({
onblur: function(e) {
var id = $(obj).data('id');
var sHTML = $(obj).code();
alert(sHTML);
}
});
});
</script>
``... | To display multiple editors on a page, you need to place more than two `<div>` elements in HTML.
**Example:**
```
<div class="summernote">summernote 1</div>
<div class="summernote">summernote 2</div>
```
**Then run summernote with jQuery selector.**
```
$(document).ready(function() {
$('.summernote').summernote(... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | After selecting all summernote's you need to access their attributes by specifying one element like:
```
<script>
$('.summernote').each(function(i, obj) { $(obj).summernote({
onblur: function(e) {
var id = $(obj).data('id');
var sHTML = $(obj).code();
alert(sHTML);
}
});
});
</script>
``... | For anyone looking to use summernote to output multiple content with `foreach`, loop/repetitive statement etc
Summernote works for the first output only but you can make it work for others by using the ***class twice***:
```
<div class"summernote summernote"> </div>
```
Provided your script is like this:
```
<scri... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | After selecting all summernote's you need to access their attributes by specifying one element like:
```
<script>
$('.summernote').each(function(i, obj) { $(obj).summernote({
onblur: function(e) {
var id = $(obj).data('id');
var sHTML = $(obj).code();
alert(sHTML);
}
});
});
</script>
``... | if you are using summernote inside a textarea in a form and you intend to apply it on multiple textarea(s) on the same form, replace `id=summernote` with `class="summernote"`
Dont forget to do the same on your initialisation script
```
<script>
$('.summernote').summernote({
height: 200 //just specifies th... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | To display multiple editors on a page, you need to place more than two `<div>` elements in HTML.
**Example:**
```
<div class="summernote">summernote 1</div>
<div class="summernote">summernote 2</div>
```
**Then run summernote with jQuery selector.**
```
$(document).ready(function() {
$('.summernote').summernote(... | I Finally got the code working for multiple summernote editors and image uploading!
To fix
>
> "undefined"
>
>
>
, try:
>
> var id = $(obj).data('id');
>
>
>
to
>
> var id= $(obj).attr('id'))
>
>
>
Source:
<https://github.com/neblina-software/balerocms-enterprise/blob/master/src/main/resources/stat... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | To display multiple editors on a page, you need to place more than two `<div>` elements in HTML.
**Example:**
```
<div class="summernote">summernote 1</div>
<div class="summernote">summernote 2</div>
```
**Then run summernote with jQuery selector.**
```
$(document).ready(function() {
$('.summernote').summernote(... | For anyone looking to use summernote to output multiple content with `foreach`, loop/repetitive statement etc
Summernote works for the first output only but you can make it work for others by using the ***class twice***:
```
<div class"summernote summernote"> </div>
```
Provided your script is like this:
```
<scri... |
22,619,110 | I am trying to get the code of a specific summer note div with multiple ones on a single page.
My summer notes are created from a database with php as follows:
```
<div class="tab-content">
<?php $i=-1; foreach($contents as $content): ?>
<?php $i++; ?>
<div class="tab-pane" id="<?php echo $content->co... | 2014/03/24 | ['https://Stackoverflow.com/questions/22619110', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3367639/'] | To display multiple editors on a page, you need to place more than two `<div>` elements in HTML.
**Example:**
```
<div class="summernote">summernote 1</div>
<div class="summernote">summernote 2</div>
```
**Then run summernote with jQuery selector.**
```
$(document).ready(function() {
$('.summernote').summernote(... | if you are using summernote inside a textarea in a form and you intend to apply it on multiple textarea(s) on the same form, replace `id=summernote` with `class="summernote"`
Dont forget to do the same on your initialisation script
```
<script>
$('.summernote').summernote({
height: 200 //just specifies th... |
226,645 | Is "lemonade" countable or uncountable? Could I say the following sentence?
>
> Could you please bring me a lemonade?
>
>
>
Or *must* I say "a glass of lemonade" ? | 2019/10/03 | ['https://ell.stackexchange.com/questions/226645', 'https://ell.stackexchange.com', 'https://ell.stackexchange.com/users/92124/'] | "Lemonade" is usually uncountable, but it can be used as a countable noun to mean "a glass of lemonade". It is uncommon, but possible, to treat "lemonade" as a countable noun.
This applies not only to lemonade but to most beverages. | >
> Or must I say "a glass of lemonade" ?
>
>
>
You don't need to.
From Collins
>
> A glass of lemonade can be referred to as *a lemonade*. Example: I'm going to get you a lemonade.
>
>
>
Take a look at the following Q and A.
>
> *What can I get you?*
>
>
> * A diet coke, please!
> * A can of diet cok... |
114,417 | Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.
Any great ideas on how to execute a piece of cod... | 2008/09/22 | ['https://Stackoverflow.com/questions/114417', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4333/'] | A cookie would work just fine. Or you could modify the query string each time with a "mode=x" or "load=x" parameter.
This would present a problem if the user tries to bookmark the final page, though. If that's an option, the cookie solution is fine. I would guess they need cookies enabled to get that far in the app an... | A cookie, or pass a query string parameter indicating which javascript function has been run. We had to do something along these lines to trip out a piece of our software. That's really the best I got. |
114,417 | Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.
Any great ideas on how to execute a piece of cod... | 2008/09/22 | ['https://Stackoverflow.com/questions/114417', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4333/'] | A cookie would work just fine. Or you could modify the query string each time with a "mode=x" or "load=x" parameter.
This would present a problem if the user tries to bookmark the final page, though. If that's an option, the cookie solution is fine. I would guess they need cookies enabled to get that far in the app an... | Use a cookie or set a hidden field value. My vote would be for the field value. |
114,417 | Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.
Any great ideas on how to execute a piece of cod... | 2008/09/22 | ['https://Stackoverflow.com/questions/114417', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4333/'] | A cookie would work just fine. Or you could modify the query string each time with a "mode=x" or "load=x" parameter.
This would present a problem if the user tries to bookmark the final page, though. If that's an option, the cookie solution is fine. I would guess they need cookies enabled to get that far in the app an... | This might be a cute case for using window.name, 'the property that survives page reloads'. |
114,417 | Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.
Any great ideas on how to execute a piece of cod... | 2008/09/22 | ['https://Stackoverflow.com/questions/114417', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4333/'] | A cookie, or pass a query string parameter indicating which javascript function has been run. We had to do something along these lines to trip out a piece of our software. That's really the best I got. | Use a cookie or set a hidden field value. My vote would be for the field value. |
114,417 | Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.
Any great ideas on how to execute a piece of cod... | 2008/09/22 | ['https://Stackoverflow.com/questions/114417', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4333/'] | A cookie, or pass a query string parameter indicating which javascript function has been run. We had to do something along these lines to trip out a piece of our software. That's really the best I got. | This might be a cute case for using window.name, 'the property that survives page reloads'. |
26,933,422 | Who can share practical examples of the use of the `GET_LOCK` function?
Example function:
```
mysql> SELECT GET_LOCK('b',10);
+------------------+
| GET_LOCK('b',10) |
+------------------+
| 1 |
+------------------+
1 row in set (0.00 sec)
mysql> SELECT IS_FREE_LOCK('b');
+-------------------+
| IS_FR... | 2014/11/14 | ['https://Stackoverflow.com/questions/26933422', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2645137/'] | This should be enough:
```
self.collectionView.pagingEnabled = YES;
```
Swift version:
```
self.collectionView.pagingEnabled = true
``` | If you want your cells to be moved only one at a time then you need to set the frame of cell equals to the collection view and then set the collectionView's paging enabled as below,
```
[collectionView setPagingEnabled:YES];
```
or
```
collectionView.pagingEnabled=YES;
``` |
29,214,407 | I have a Queue of an abstract class KVP. I queue 2 different objects which inherit from KVP. Everything works fine when I serialize the queue, but since KVP cannot be constructed it fails on deserialization.
If it was a single non generic object I could deserialize as dynamic, but I'm not sure how to deserialize a que... | 2015/03/23 | ['https://Stackoverflow.com/questions/29214407', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1104177/'] | You could
1. Enable [TypeNameHandling](http://www.newtonsoft.com/json/help/html/P_Newtonsoft_Json_JsonSerializerSettings_TypeNameHandling.htm) (in both serialization and deserialization):
```
var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto };
var serializedText= JsonConve... | This should work if you use the following setting in the JSON.NET serialiser settings:
```
var settings = new JsonSerializerSettings {TypeNameHandling = TypeNameHandling.Auto};
```
This will encode the object type into the JSON stream, which will help the deserializer determined the specific object type to construct... |
18,659,832 | I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward.
Maybe there are better alternatives done in code if there... | 2013/09/06 | ['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/'] | **Code:**
To allow multiple line you can use:
```
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.textAlignment = UITextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];
```
In **iOS 6**, `UILineBreakModeWordWrap` and `UITextAlignmentCenter` are depreca... | You can do solely in Interface Builder a couple ways.
* First by simply setting the wrap feature. This offers limited customizability though.
* For more customizability, change the "Plain Text" to "Attributed Text" and then you can do most things without any code. |
18,659,832 | I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward.
Maybe there are better alternatives done in code if there... | 2013/09/06 | ['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/'] | **Code:**
To allow multiple line you can use:
```
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.textAlignment = UITextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];
```
In **iOS 6**, `UILineBreakModeWordWrap` and `UITextAlignmentCenter` are depreca... | Just to mention if one does not want word wrap but still want to achieve multi line title on a UIButton it can be done by setting lineBreakMode before numberOfLines,
This is because lineBreakMode seems to cancel out numberOfLines set hence we are doing it in this order.
Swift:
>
> button.titleLabel?.lineBreakMode = ... |
18,659,832 | I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward.
Maybe there are better alternatives done in code if there... | 2013/09/06 | ['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/'] | **Code:**
To allow multiple line you can use:
```
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.textAlignment = UITextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];
```
In **iOS 6**, `UILineBreakModeWordWrap` and `UITextAlignmentCenter` are depreca... | In the case you are using only plain XCode 9.4:
Set Line Break to any option (to enable numberOfLines) in the Attributes inspector:
[](https://i.stack.imgur.com/Q1Rd1.png)
Then you can set KeyPath as
```
titleLabel.numberOfLines
```
in the Identity in... |
18,659,832 | I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward.
Maybe there are better alternatives done in code if there... | 2013/09/06 | ['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/'] | You can do solely in Interface Builder a couple ways.
* First by simply setting the wrap feature. This offers limited customizability though.
* For more customizability, change the "Plain Text" to "Attributed Text" and then you can do most things without any code. | Just to mention if one does not want word wrap but still want to achieve multi line title on a UIButton it can be done by setting lineBreakMode before numberOfLines,
This is because lineBreakMode seems to cancel out numberOfLines set hence we are doing it in this order.
Swift:
>
> button.titleLabel?.lineBreakMode = ... |
18,659,832 | I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward.
Maybe there are better alternatives done in code if there... | 2013/09/06 | ['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/'] | In the case you are using only plain XCode 9.4:
Set Line Break to any option (to enable numberOfLines) in the Attributes inspector:
[](https://i.stack.imgur.com/Q1Rd1.png)
Then you can set KeyPath as
```
titleLabel.numberOfLines
```
in the Identity in... | Just to mention if one does not want word wrap but still want to achieve multi line title on a UIButton it can be done by setting lineBreakMode before numberOfLines,
This is because lineBreakMode seems to cancel out numberOfLines set hence we are doing it in this order.
Swift:
>
> button.titleLabel?.lineBreakMode = ... |
77,623 | knowing that the characteristic of an integral domain is $0$ or a prime number, i want to prove that the characteristic of a finite field $F\_n$ is a prime number, that is $\operatorname{char}(F\_n)\not = 0$. the proof i'm reading uses the fact that within $e,2e,3e,\ldots$ there are two that are necessarily equal $ie=(... | 2011/10/31 | ['https://math.stackexchange.com/questions/77623', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/10463/'] | Let $1$ denote the *multiplicative* identity of the field. Then, $1 \neq 0$ where $0$ is the *additive* identity. So every field must have at least two elements: your notion of a field with one element $0$ is not correct.
So, since the field contains $1$, it contains $1+1$, $1+1+1$, $1 + 1 + 1 + 1, \ldots, 1 + 1 + \c... | I feel as though the answer you are stating is making things more difficult. As you pointed out all integral domains are either characterstic zero or of prime characteristic, and so in particular all fields are of prime characteristic or zero characteristic. But, if a field has characteristic zero you know that it's mu... |
33,710,057 | So I'm working on implementing an insert method for a binary tree.
From what I can tell, the problem is that the changes made in the arguments of the function don't get properly returned back to main().
```
static void addChild(Child c, Child tree){
if(tree==null){
tree=c;
}
else{
if(c.cid... | 2015/11/14 | ['https://Stackoverflow.com/questions/33710057', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4695822/'] | The recursive method only modifies the local copy on the stack.. Instead you should be passing a pointer or pass a reference to the tree nodes so that when u assign a child in the base case you make changes to the actual parent and not to the local copy (local copy gets destroyed after the function returns) | Your recursive base case:
```
tree = c;
```
won't update the tree. It just reassigns the **tree** parameter's reference in that call scope. It has no effect outside that particular recursive call (stack frame).
Here's a walk through of execution:
```
Child tree = new Child();
tree.cid = 0;
tree.lc = new Child();
t... |
61,850,588 | Hi so i have table called products, i have some information there like name,netto price,tax etc. I want to add new records named brutto\_price which is automatically calculated as (netto\_price + netto\_price\*tax) or (netto\_price \*1.22 if tax is null) its not allowed to insert null into netto\_price. (tax could be n... | 2020/05/17 | ['https://Stackoverflow.com/questions/61850588', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13560269/'] | You can use
```
{(book.authors || []).map(({firstname, lastname}) => `${lastname} ${firstname}`).join(", ")}.
```
This will give you comma separated names
```
<tbody>
{books.length === 0 ?
<tr align="center">
<td colSpan="6">{this.state.books.length} List is empty.</td>
</tr> :
books.map((book... | One of the ways to do that:
```
(book.authors || []).map(author => author.firstname + ' ' + author.lastname).join(', ')
``` |
288,319 | I realized the solution to this problem while I was creating the documentation to ASK this question...so I am posting the answer if for no other reason than to keep me from wasting time on this in the future | 2008/11/13 | ['https://Stackoverflow.com/questions/288319', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2755/'] | `toggle()` is pretty buggy at times, i've had it do odd things to checkmarks (unchecking them) and other assorted issues. i'd suggest just handling it using a click event, much less minor annoyances. and this way, you don't have to worry about what state `#lowerDiv` is in in the first place:
```
$('#upperDiv').click(f... | If the content to be TOGGLEd is displayed (visible) when the page is rendered the functions would be in the following order, if the content is hidden originally then reverse the functions
```
<html>
<head>
<style>
#upperDiv {width:200px; height:20px; text-align:center; cursor:pointer; }
#lowerDiv {width:200px; heigh... |
288,319 | I realized the solution to this problem while I was creating the documentation to ASK this question...so I am posting the answer if for no other reason than to keep me from wasting time on this in the future | 2008/11/13 | ['https://Stackoverflow.com/questions/288319', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2755/'] | If the content to be TOGGLEd is displayed (visible) when the page is rendered the functions would be in the following order, if the content is hidden originally then reverse the functions
```
<html>
<head>
<style>
#upperDiv {width:200px; height:20px; text-align:center; cursor:pointer; }
#lowerDiv {width:200px; heigh... | I know this is a really old question, but just for people that are looking for a quick fix this worked for me:
a. in the PHP/HTML file:
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/.../jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#pClick").click(function(){ ... |
288,319 | I realized the solution to this problem while I was creating the documentation to ASK this question...so I am posting the answer if for no other reason than to keep me from wasting time on this in the future | 2008/11/13 | ['https://Stackoverflow.com/questions/288319', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2755/'] | `toggle()` is pretty buggy at times, i've had it do odd things to checkmarks (unchecking them) and other assorted issues. i'd suggest just handling it using a click event, much less minor annoyances. and this way, you don't have to worry about what state `#lowerDiv` is in in the first place:
```
$('#upperDiv').click(f... | I know this is a really old question, but just for people that are looking for a quick fix this worked for me:
a. in the PHP/HTML file:
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/.../jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#pClick").click(function(){ ... |
6,312,748 | I have the code:
```
var timer:Timer = new Timer(milliseconds, repititions);
timer.addEventListener(TimerEvent.TIMER, callback);
timer.start();
```
and if a user click I want to call the callback early. Is there was a way to either force the timer to finish immediately, or stop it and send the `TimerEvent.Timer` on ... | 2011/06/10 | ['https://Stackoverflow.com/questions/6312748', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/198034/'] | ```
var evt:TimerEvent = new TimerEvent(TimerEvent.TIMER);
timer.dispatchEvent(evt);
``` | Have button call a function in my example i call it onDoEvent.
onDoEvent will then call the timer event callback using the proper "CLICK" event.
```
import fl.controls.Button
var milliseconds:int = 3000;
var repititions:int = 0;
var timer:Timer = new Timer(milliseconds, repititions);
timer.addEventListener(TimerEv... |
6,312,748 | I have the code:
```
var timer:Timer = new Timer(milliseconds, repititions);
timer.addEventListener(TimerEvent.TIMER, callback);
timer.start();
```
and if a user click I want to call the callback early. Is there was a way to either force the timer to finish immediately, or stop it and send the `TimerEvent.Timer` on ... | 2011/06/10 | ['https://Stackoverflow.com/questions/6312748', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/198034/'] | ```
var evt:TimerEvent = new TimerEvent(TimerEvent.TIMER);
timer.dispatchEvent(evt);
``` | ```
var timer:Timer = new Timer(milliseconds, repititions);
timer.addEventListener(TimerEvent.TIMER, callback);
timer.start();
function callback(e:TimerEvent):void{
//to do what
}
```
to call simpliest way, just call the function like this.
```
callback(null);
``` |
35,298,518 | Hi,
I have a requirement, i need to modify a ClearQuest schema. This modification is
done based on the application name(application\_name field)in the form. For a particular application an additional approval from a group is required. For rest of the application needs to be eliminated.
[![enter image description ... | 2016/02/09 | ['https://Stackoverflow.com/questions/35298518', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3437212/'] | For just bash commands, it's possible to get system commands to work. For example, in the IRkernel:
```
system("echo 'hi'", intern=TRUE)
```
Output:
```
'hi'
```
Or to see the first 5 lines of a file:
```
system("head -5 data/train.csv", intern=TRUE)
```
As IPython magics are available in the IPython kernel (b... | A cosmetic improvement to the output of `system` can be obtained by wrapping the call in `cat` and specify `'\n'` as the separator, which displays the output on separate lines instead of separated by whitespaces which is the default for character vectors. This is very useful for commands like `tree`, since the format o... |
667,040 | I have a server machine (A) which has ssh installed, along with a webserver.
How do I forward the port with the webserver to my local machine (B).
I should be able to browse to `http://localhost:forwardedport`
Is this LOCAL or REMOTE port fowarding? Here's what I've tried.
```
ssh -L 8888:name.dnydns-server.com:88... | 2013/10/29 | ['https://superuser.com/questions/667040', 'https://superuser.com', 'https://superuser.com/users/35728/'] | I guess you first need to get clear on some terms I'll use:
**Client** means the machine where you start ssh. This machine is refered to by "local".
**Server** means the machine you want to connect to with ssh. This machine is refered to by "remote".
**Local port forwarding** with ssh means you connect from your cli... | I am presuming that the server has sshd installed, and listening on the well known default port (22), and that the web server is listening on the well-known default port (80). The assumption is that the server is the server (A) is the 'conduit' through which you want to tunnel to get to the web server. Here's what you ... |
33,134,621 | I want to compile this code:
```
#include <stdalign.h>
#include <stdio.h>
#include <stddef.h>
int main ( int argc , char ** argv )
{
printf ("%zu\n", alignof ( max_align_t ));
return 0;
}
```
But compiler says that:
```
error: ‘max_align_t’ undeclared".
```
`stddef.h` is included and everything must be ... | 2015/10/14 | ['https://Stackoverflow.com/questions/33134621', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5444662/'] | To use a C11 feature you need to tell the compiler to run in C11 compliant mode.
For gcc this can be achieved by specifying the option `-std=c11`. | I use a compiler that is natively based on c99 that has a stddef.h that it uses. On my computer I need to use the -std=c11 option and also a header file that apparently corresponds to c11. |
53,405,895 | I have a table like:
```
id fkey srno remark date
1 A001 1
2 A001 2
3 A002 1
4 A003 1
5 A002 2
```
I want distinct latest record based on max srno like
```
2 A001 2
4 A003 1
5 A002 2
``` | 2018/11/21 | ['https://Stackoverflow.com/questions/53405895', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337261/'] | use window function `row_number()`
```
select * from (
select *,row_number() over(PARTITION by fkey order by srno desc) rn from table1 t1
) t where rn=1
```
you can write it by using cte
```
with cte as
(
select *,row_number() over(PARTITION by fkey order by srno desc) rn from
table_name t1
) select * fro... | You can use correlated subquery
```
select * from tablename where srno in
(select max(srno) from tablename b where a.fkey=b.fkey)
``` |
53,405,895 | I have a table like:
```
id fkey srno remark date
1 A001 1
2 A001 2
3 A002 1
4 A003 1
5 A002 2
```
I want distinct latest record based on max srno like
```
2 A001 2
4 A003 1
5 A002 2
``` | 2018/11/21 | ['https://Stackoverflow.com/questions/53405895', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337261/'] | The best way to do this in Postgres is to use `DISTINCT ON`:
```
SELECT DISTINCT ON (fkey) id, fkey, srno
FROM yourTable
ORDER BY fkey, srno DESC;
```
[](https://i.stack.imgur.com/LkEyJ.png)
[Demo
----](https://dbfiddle.uk/?rdbms=postgres_11&fiddle... | You can use correlated subquery
```
select * from tablename where srno in
(select max(srno) from tablename b where a.fkey=b.fkey)
``` |
53,405,895 | I have a table like:
```
id fkey srno remark date
1 A001 1
2 A001 2
3 A002 1
4 A003 1
5 A002 2
```
I want distinct latest record based on max srno like
```
2 A001 2
4 A003 1
5 A002 2
``` | 2018/11/21 | ['https://Stackoverflow.com/questions/53405895', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337261/'] | The best way to do this in Postgres is to use `DISTINCT ON`:
```
SELECT DISTINCT ON (fkey) id, fkey, srno
FROM yourTable
ORDER BY fkey, srno DESC;
```
[](https://i.stack.imgur.com/LkEyJ.png)
[Demo
----](https://dbfiddle.uk/?rdbms=postgres_11&fiddle... | use window function `row_number()`
```
select * from (
select *,row_number() over(PARTITION by fkey order by srno desc) rn from table1 t1
) t where rn=1
```
you can write it by using cte
```
with cte as
(
select *,row_number() over(PARTITION by fkey order by srno desc) rn from
table_name t1
) select * fro... |
53,405,895 | I have a table like:
```
id fkey srno remark date
1 A001 1
2 A001 2
3 A002 1
4 A003 1
5 A002 2
```
I want distinct latest record based on max srno like
```
2 A001 2
4 A003 1
5 A002 2
``` | 2018/11/21 | ['https://Stackoverflow.com/questions/53405895', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337261/'] | use window function `row_number()`
```
select * from (
select *,row_number() over(PARTITION by fkey order by srno desc) rn from table1 t1
) t where rn=1
```
you can write it by using cte
```
with cte as
(
select *,row_number() over(PARTITION by fkey order by srno desc) rn from
table_name t1
) select * fro... | You may use a subquery with an `IN` operator
```
with tab(id, fkey, srno) as
(
select 1,'A001',1 union all
select 2,'A001',2 union all
select 3,'A002',1 union all
select 4,'A003',1 union all
select 5,'A002',2
)
select *
from tab
where ( fkey, srno ) in
(
select fkey, max(srno)
from tab
gr... |
53,405,895 | I have a table like:
```
id fkey srno remark date
1 A001 1
2 A001 2
3 A002 1
4 A003 1
5 A002 2
```
I want distinct latest record based on max srno like
```
2 A001 2
4 A003 1
5 A002 2
``` | 2018/11/21 | ['https://Stackoverflow.com/questions/53405895', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4337261/'] | The best way to do this in Postgres is to use `DISTINCT ON`:
```
SELECT DISTINCT ON (fkey) id, fkey, srno
FROM yourTable
ORDER BY fkey, srno DESC;
```
[](https://i.stack.imgur.com/LkEyJ.png)
[Demo
----](https://dbfiddle.uk/?rdbms=postgres_11&fiddle... | You may use a subquery with an `IN` operator
```
with tab(id, fkey, srno) as
(
select 1,'A001',1 union all
select 2,'A001',2 union all
select 3,'A002',1 union all
select 4,'A003',1 union all
select 5,'A002',2
)
select *
from tab
where ( fkey, srno ) in
(
select fkey, max(srno)
from tab
gr... |
681,226 | I have PHP application that is completely procedural (No PHP Classes). In my case, is there any formal diagrams I can draw to show how my web application that is equivalent to a UML class diagram for OOP based applications.
Thanks all | 2009/03/25 | ['https://Stackoverflow.com/questions/681226', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/51649/'] | [doxygen](http://www.doxygen.org/) can generate call- and caller graphs automatically - if that suits your needs. | You could make some Hatley-Pirbhai models:
<http://en.wikipedia.org/wiki/Hatley-Pirbhai_modeling> |
681,226 | I have PHP application that is completely procedural (No PHP Classes). In my case, is there any formal diagrams I can draw to show how my web application that is equivalent to a UML class diagram for OOP based applications.
Thanks all | 2009/03/25 | ['https://Stackoverflow.com/questions/681226', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/51649/'] | You could make some Hatley-Pirbhai models:
<http://en.wikipedia.org/wiki/Hatley-Pirbhai_modeling> | It's not because the implementation (or even the design) is procedural, that the business model is.
Though you may not find explicit reference to classes in your code, they may still be there, hidden, scattered through global variables etc, functions manipulating some globals, ...
So in order to describe your app, yo... |
681,226 | I have PHP application that is completely procedural (No PHP Classes). In my case, is there any formal diagrams I can draw to show how my web application that is equivalent to a UML class diagram for OOP based applications.
Thanks all | 2009/03/25 | ['https://Stackoverflow.com/questions/681226', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/51649/'] | [doxygen](http://www.doxygen.org/) can generate call- and caller graphs automatically - if that suits your needs. | It's not because the implementation (or even the design) is procedural, that the business model is.
Though you may not find explicit reference to classes in your code, they may still be there, hidden, scattered through global variables etc, functions manipulating some globals, ...
So in order to describe your app, yo... |
58,267,243 | I have problems when sending email, I make registration and verification by email, when on localhost everything runs smoothly, there are no problems, but when I am hosting, the email function cannot, please help
```
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
... | 2019/10/07 | ['https://Stackoverflow.com/questions/58267243', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11944485/'] | **Tl;dr:**
>
> You'll see this occur in most templates in the Template Gallery. The
> official [Google Documentation](https://developers.google.com/tag-platform/tag-manager/templates/api#createqueue) has nothing to say about it.
> However, in my tests, this small change in structure (nesting your
> pushes in randomly... | For a dataLayer push you can use a custom
HTML template and trigger it via page view then add the below code
```
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'test_push'
});
</script>
``` |
1,179 | The design of SO/SU/SF is very clean and easy to use, I want to have a similar one to host the Q/A service in my local company, is it open source? or does stack overflow service inc. have the Q/A hosting service? | 2010/07/24 | ['https://meta.superuser.com/questions/1179', 'https://meta.superuser.com', 'https://meta.superuser.com/users/19926/'] | I'm sorry to say that no, you can't self host. And it is not open source.
But there are open source clones exist. One of the example is [cnprog](http://cnprog.com/). You can access the source [here](http://code.google.com/p/cnprog/) and [here](http://github.com/cnprog/CNPROG).
After you have the source, you can do a... | Check out [Area 51](http://area51.stackexchange.com/). |
4,641,495 | I want to make a simple script to post a tweet from a Textbox when the user click on the Submit button, but all using Javascript, without any server-side language. How may I do this? | 2011/01/09 | ['https://Stackoverflow.com/questions/4641495', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/126353/'] | What you want to use is Twitter Anywhere, develop by twitter
<http://dev.twitter.com/anywhere>
This handles all OAuth, create the box and post the tweet. | <http://www.saschakimmel.com/2009/05/how-to-create-a-dynamic-tweet-this-button-with-javascript/>
But just change the document.title to the location of your textbox |
3,686,778 | I'm trying to store an hexadecimal value (\xC1) in MySql Database. When I print that with PHP, i get: xC1lcool instead of the right word.
>
> INSERT INTO veiculos VALUES (1, 'Ford', 'Ka RoCam Flex', 25850.00, 1998, 1999, 'Vermelho', 15000, '\xC1lcool;Gasolina;GNV', 'Ar-Condicionado;4 portas;Câmbio automático', 'image... | 2010/09/10 | ['https://Stackoverflow.com/questions/3686778', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/444582/'] | `\x` is not a valid escape sequence. Valid sequences are detailed at <http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html>
Quoting the manual:
>
> For all other escape sequences,
> backslash is ignored. That is, the
> escaped character is interpreted as if
> it was not escaped. For example, “\x”
> is just ... | Use MySQL [`UNHEX()`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_unhex) function with [`CONCAT()`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat). Like this
```
insert into tablename values (CONCAT(UNHEX('C1'), 'other-part-of-string'))
``` |
3,686,778 | I'm trying to store an hexadecimal value (\xC1) in MySql Database. When I print that with PHP, i get: xC1lcool instead of the right word.
>
> INSERT INTO veiculos VALUES (1, 'Ford', 'Ka RoCam Flex', 25850.00, 1998, 1999, 'Vermelho', 15000, '\xC1lcool;Gasolina;GNV', 'Ar-Condicionado;4 portas;Câmbio automático', 'image... | 2010/09/10 | ['https://Stackoverflow.com/questions/3686778', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/444582/'] | `\x` is not a valid escape sequence. Valid sequences are detailed at <http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html>
Quoting the manual:
>
> For all other escape sequences,
> backslash is ignored. That is, the
> escaped character is interpreted as if
> it was not escaped. For example, “\x”
> is just ... | You can store full binary data, such as an image or pdf in a MySQL database. When you insert the value make sure you do a `"insert ... values(".mysql_real_escape_string($value).")";`. It is recommended that you use the blob datatype for that column, but you can use a varchar if you really want to. After that when you s... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | You can find the [full incident report here](https://www.webcitation.org/6Rk7TGDPW?url=http://www.cad.gov.hk/reports/2%20Final%20Report%20-%20CX%20780%202013%2007%20web%20access%20compliant.pdf) and this topic is touched upon briefly, but in short they had little to no time to entertain any other options but a full spe... | Engine #2 wasn't doing its job either
-------------------------------------
Had the situation just been engine #1 stuck at high thrust, with engine 2 normally controllable, than what you describe would be a reasonable response to the situation. However, that was *not* the case with CX780 -- during approach, Engine #2 ... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | You can find the [full incident report here](https://www.webcitation.org/6Rk7TGDPW?url=http://www.cad.gov.hk/reports/2%20Final%20Report%20-%20CX%20780%202013%2007%20web%20access%20compliant.pdf) and this topic is touched upon briefly, but in short they had little to no time to entertain any other options but a full spe... | From the incident report section 1.1.4:
>
> a. At 0519 hrs during the descent to a cleared level of FL230, ECAM
> messages “ENG 1 CTL SYS FAULT” and “ENG 2 STALL” were annunciated
> within a short period of time. According to the Commander, a light
> “pop” sound was heard and some “ozone” and “burning” smell was
>... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | You can find the [full incident report here](https://www.webcitation.org/6Rk7TGDPW?url=http://www.cad.gov.hk/reports/2%20Final%20Report%20-%20CX%20780%202013%2007%20web%20access%20compliant.pdf) and this topic is touched upon briefly, but in short they had little to no time to entertain any other options but a full spe... | Aside from what Unrec. and GdD point out, even if the other engine had been running perfectly...
A frequent problem with twin engine airplanes is **[shutting down](https://en.wikipedia.org/wiki/Kegworth_air_disaster) the [wrong](https://en.wikipedia.org/wiki/TransAsia_Airways_Flight_235) engine**. Nobody ever expects... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | You can find the [full incident report here](https://www.webcitation.org/6Rk7TGDPW?url=http://www.cad.gov.hk/reports/2%20Final%20Report%20-%20CX%20780%202013%2007%20web%20access%20compliant.pdf) and this topic is touched upon briefly, but in short they had little to no time to entertain any other options but a full spe... | I could be wrong but reverse thrust from the running engine helped to stop the plane1 as it was approaching at a great speed way over the recommended landing speed, so shutting the running engine off right at approach would have made the plane to overshoot the runway, making the situation worse.
---
1: Source:
>
> ... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | Engine #2 wasn't doing its job either
-------------------------------------
Had the situation just been engine #1 stuck at high thrust, with engine 2 normally controllable, than what you describe would be a reasonable response to the situation. However, that was *not* the case with CX780 -- during approach, Engine #2 ... | From the incident report section 1.1.4:
>
> a. At 0519 hrs during the descent to a cleared level of FL230, ECAM
> messages “ENG 1 CTL SYS FAULT” and “ENG 2 STALL” were annunciated
> within a short period of time. According to the Commander, a light
> “pop” sound was heard and some “ozone” and “burning” smell was
>... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | Engine #2 wasn't doing its job either
-------------------------------------
Had the situation just been engine #1 stuck at high thrust, with engine 2 normally controllable, than what you describe would be a reasonable response to the situation. However, that was *not* the case with CX780 -- during approach, Engine #2 ... | Aside from what Unrec. and GdD point out, even if the other engine had been running perfectly...
A frequent problem with twin engine airplanes is **[shutting down](https://en.wikipedia.org/wiki/Kegworth_air_disaster) the [wrong](https://en.wikipedia.org/wiki/TransAsia_Airways_Flight_235) engine**. Nobody ever expects... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | Engine #2 wasn't doing its job either
-------------------------------------
Had the situation just been engine #1 stuck at high thrust, with engine 2 normally controllable, than what you describe would be a reasonable response to the situation. However, that was *not* the case with CX780 -- during approach, Engine #2 ... | I could be wrong but reverse thrust from the running engine helped to stop the plane1 as it was approaching at a great speed way over the recommended landing speed, so shutting the running engine off right at approach would have made the plane to overshoot the runway, making the situation worse.
---
1: Source:
>
> ... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | From the incident report section 1.1.4:
>
> a. At 0519 hrs during the descent to a cleared level of FL230, ECAM
> messages “ENG 1 CTL SYS FAULT” and “ENG 2 STALL” were annunciated
> within a short period of time. According to the Commander, a light
> “pop” sound was heard and some “ozone” and “burning” smell was
>... | Aside from what Unrec. and GdD point out, even if the other engine had been running perfectly...
A frequent problem with twin engine airplanes is **[shutting down](https://en.wikipedia.org/wiki/Kegworth_air_disaster) the [wrong](https://en.wikipedia.org/wiki/TransAsia_Airways_Flight_235) engine**. Nobody ever expects... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | From the incident report section 1.1.4:
>
> a. At 0519 hrs during the descent to a cleared level of FL230, ECAM
> messages “ENG 1 CTL SYS FAULT” and “ENG 2 STALL” were annunciated
> within a short period of time. According to the Commander, a light
> “pop” sound was heard and some “ozone” and “burning” smell was
>... | I could be wrong but reverse thrust from the running engine helped to stop the plane1 as it was approaching at a great speed way over the recommended landing speed, so shutting the running engine off right at approach would have made the plane to overshoot the runway, making the situation worse.
---
1: Source:
>
> ... |
59,303 | In the approach phase, engine 1 of [Cathay Pacific flight 780](https://en.wikipedia.org/wiki/Cathay_Pacific_Flight_780) got stuck at about 70% N1 and it forced the crew to do an overspeed landing (230knots).
Why didn't they shut it off by turning the fuel pumps off? Is there a backup mechanism if the fuel valve fails ... | 2019/01/22 | ['https://aviation.stackexchange.com/questions/59303', 'https://aviation.stackexchange.com', 'https://aviation.stackexchange.com/users/36788/'] | Aside from what Unrec. and GdD point out, even if the other engine had been running perfectly...
A frequent problem with twin engine airplanes is **[shutting down](https://en.wikipedia.org/wiki/Kegworth_air_disaster) the [wrong](https://en.wikipedia.org/wiki/TransAsia_Airways_Flight_235) engine**. Nobody ever expects... | I could be wrong but reverse thrust from the running engine helped to stop the plane1 as it was approaching at a great speed way over the recommended landing speed, so shutting the running engine off right at approach would have made the plane to overshoot the runway, making the situation worse.
---
1: Source:
>
> ... |
969,292 | I develop some program and I encountered to this problem:

We know point **P**, **X**, and angle **a**. Range of angle is <0°,360°> between lines **p** and **o**. How I can determine in which side of line **o** is point **X**? Line **p** is always pe... | 2014/10/11 | ['https://math.stackexchange.com/questions/969292', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/183624/'] | You have two vectors: $X-P$ and $\langle \cos\left(\frac{\pi}{2}-\alpha\right), \sin\left(\frac{\pi}{2}-\alpha\right)\rangle$. $X$ lies below the line if and only if $(X-P) \times \langle \cos\left(\frac{\pi}{2}-\alpha\right), \sin\left(\frac{\pi}{2}-\alpha\right)\rangle$ (when both are regarded as vectors in $\mathbb{... | Equation for line $o$:
$$
u(t) = p + t q
$$
for $t \in \mathbb{R}$ with normed direction vector $q = (\sin a, \cos a)^T$ and vector $p = (x, y)^T$. Then
$$
v = x-p
$$
where $x = (a, b)^T$ (vector $x$, not coordinate $x$; coordinate $a$, not angle $a$) and $v$ is the vector from line $o$, at the end point of $p$, to the... |
969,292 | I develop some program and I encountered to this problem:

We know point **P**, **X**, and angle **a**. Range of angle is <0°,360°> between lines **p** and **o**. How I can determine in which side of line **o** is point **X**? Line **p** is always pe... | 2014/10/11 | ['https://math.stackexchange.com/questions/969292', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/183624/'] | Equation for line $o$:
$$
u(t) = p + t q
$$
for $t \in \mathbb{R}$ with normed direction vector $q = (\sin a, \cos a)^T$ and vector $p = (x, y)^T$. Then
$$
v = x-p
$$
where $x = (a, b)^T$ (vector $x$, not coordinate $x$; coordinate $a$, not angle $a$) and $v$ is the vector from line $o$, at the end point of $p$, to the... | Another way (renamed the angle as "A" to avoid confussion with the coordinate "a"): if (a-x)\*tan(A)>b-y then X is below the line. |
969,292 | I develop some program and I encountered to this problem:

We know point **P**, **X**, and angle **a**. Range of angle is <0°,360°> between lines **p** and **o**. How I can determine in which side of line **o** is point **X**? Line **p** is always pe... | 2014/10/11 | ['https://math.stackexchange.com/questions/969292', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/183624/'] | You have two vectors: $X-P$ and $\langle \cos\left(\frac{\pi}{2}-\alpha\right), \sin\left(\frac{\pi}{2}-\alpha\right)\rangle$. $X$ lies below the line if and only if $(X-P) \times \langle \cos\left(\frac{\pi}{2}-\alpha\right), \sin\left(\frac{\pi}{2}-\alpha\right)\rangle$ (when both are regarded as vectors in $\mathbb{... | Another way (renamed the angle as "A" to avoid confussion with the coordinate "a"): if (a-x)\*tan(A)>b-y then X is below the line. |
2,817,849 | Is there any PNG-fix for IE 6 and without modifying current HTML, CSS and image name?
any javascript way.
I can add any thing in `<head>........</head>` but can't modify anythings inside `<body>.....</body>`.
in one shot i want to make transparent all png transparent. | 2010/05/12 | ['https://Stackoverflow.com/questions/2817849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/84201/'] | As I just learned, [this script](http://code.google.com/p/ie7-js/) will make IE behave like a standards compliant browser, including PNG fixes. | This can be fix in 2 way
1. There is a fix file called png-fix.js, just get from net and include it before your `</body>` tag.
2. Better you can change you png file format into png-8 format via the photo-shop tool. |
2,817,849 | Is there any PNG-fix for IE 6 and without modifying current HTML, CSS and image name?
any javascript way.
I can add any thing in `<head>........</head>` but can't modify anythings inside `<body>.....</body>`.
in one shot i want to make transparent all png transparent. | 2010/05/12 | ['https://Stackoverflow.com/questions/2817849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/84201/'] | As I just learned, [this script](http://code.google.com/p/ie7-js/) will make IE behave like a standards compliant browser, including PNG fixes. | My preferred PNGFix is [DD\_belatedPNG](http://www.dillerdesign.com/experiment/DD_belatedPNG/). It is easy to use, example from the page:
```
<!--[if IE 6]>
<script src="DD_belatedPNG.js"></script>
<script>
/* EXAMPLE */
DD_belatedPNG.fix('.png_bg');
/* string argument can be any CSS selector */
/* .png_bg ex... |
2,817,849 | Is there any PNG-fix for IE 6 and without modifying current HTML, CSS and image name?
any javascript way.
I can add any thing in `<head>........</head>` but can't modify anythings inside `<body>.....</body>`.
in one shot i want to make transparent all png transparent. | 2010/05/12 | ['https://Stackoverflow.com/questions/2817849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/84201/'] | OK here's a question: if you can't modify the HTML, CSS or image at all, what the heck *can* you modify? The raw network stream coming from the server? | This can be fix in 2 way
1. There is a fix file called png-fix.js, just get from net and include it before your `</body>` tag.
2. Better you can change you png file format into png-8 format via the photo-shop tool. |
2,817,849 | Is there any PNG-fix for IE 6 and without modifying current HTML, CSS and image name?
any javascript way.
I can add any thing in `<head>........</head>` but can't modify anythings inside `<body>.....</body>`.
in one shot i want to make transparent all png transparent. | 2010/05/12 | ['https://Stackoverflow.com/questions/2817849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/84201/'] | My preferred PNGFix is [DD\_belatedPNG](http://www.dillerdesign.com/experiment/DD_belatedPNG/). It is easy to use, example from the page:
```
<!--[if IE 6]>
<script src="DD_belatedPNG.js"></script>
<script>
/* EXAMPLE */
DD_belatedPNG.fix('.png_bg');
/* string argument can be any CSS selector */
/* .png_bg ex... | This can be fix in 2 way
1. There is a fix file called png-fix.js, just get from net and include it before your `</body>` tag.
2. Better you can change you png file format into png-8 format via the photo-shop tool. |
2,817,849 | Is there any PNG-fix for IE 6 and without modifying current HTML, CSS and image name?
any javascript way.
I can add any thing in `<head>........</head>` but can't modify anythings inside `<body>.....</body>`.
in one shot i want to make transparent all png transparent. | 2010/05/12 | ['https://Stackoverflow.com/questions/2817849', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/84201/'] | OK here's a question: if you can't modify the HTML, CSS or image at all, what the heck *can* you modify? The raw network stream coming from the server? | My preferred PNGFix is [DD\_belatedPNG](http://www.dillerdesign.com/experiment/DD_belatedPNG/). It is easy to use, example from the page:
```
<!--[if IE 6]>
<script src="DD_belatedPNG.js"></script>
<script>
/* EXAMPLE */
DD_belatedPNG.fix('.png_bg');
/* string argument can be any CSS selector */
/* .png_bg ex... |
51,619,280 | According to this [docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.relationaldatabasefacadeextensions.executesqlcommand?view=efcore-2.1) and [this](https://learn.microsoft.com/en-us/ef/core/querying/raw-sql), I should be able to pass an interpolated string to `ExecuteSqlCommandAsync` li... | 2018/07/31 | ['https://Stackoverflow.com/questions/51619280', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5053000/'] | As provided by @IvanStoev, the answer was to remove single quotes around the interpolated parameter. | That webpage you refer to, warns you to not have direct values inserted into SQL, that is to use parameters like so:
```
FromSql("EXECUTE dbo.GetMostPopularBlogsForUser @user", user)
```
So, adjust it to your needs and have something like:
```
FromSql("DELETE from log_entry WHERE logged_on < @logged_on", loggedOn.T... |
39,762,688 | How I can open Short Message Service (SMS) window on Android phode with pretyped message text and recipient number.
In manuals i found only Phone dialer
```
PhoneDialerService.Call(edtTelephoneNumber.Text)
```
which allow make call, but nothing about sending SMS messages. | 2016/09/29 | ['https://Stackoverflow.com/questions/39762688', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6760778/'] | See the class [`SMSManager`](https://d.android.com/reference/android/telephony/SmsManager.html) on Android API.
There is a [`sendTextMessage`](https://d.android.com/reference/android/telephony/SmsManager.html#sendTextMessage(java.lang.String,%20java.lang.String,%20java.lang.String,%20android.app.PendingIntent,%20andro... | The question asks about launching the SMS window, which I've taken to mean launching the built-in SMS-sending app. It wants a target number and message content sent in.
This can be done by asking Android to start an activity using an intent set up to view a carefully crafted SMS-specific URI and containing the require... |
1,911,782 | I came across the following question today:
>
> "In drawing two balls from a box containing 6 red and 4 white balls without replacement, which of the following pairs will be independent?:
>
>
> (a) Red on 1st and red on 2nd draw
> (b) Red on 1st and white on 2nd draw
>
>
>
I approached this problem by writing d... | 2016/09/02 | ['https://math.stackexchange.com/questions/1911782', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | Let $I$ be a fixed interval $[a,b]$. Then you may let $F=\mathbb{Q} \cap I$ (rationals in $I$) and $G=I\setminus \mathbb{Q}$ (irrationals in $I$), which satisfy all the properties you want.
As you point out, there is no 'least next' value, but this is not an issue because your last bullet point doesn't necessitate th... | To summarize what you're asking for: you want a partition of $\mathbb{R}$ into two sets $F$ and $G$, such that there is an element of $F$ between any two elements of $G$ and vice-versa. Certainly this is possible: let $F$ and $G$ be the rationals and the irrationals, respectively. And your zipper-like function is well-... |
1,911,782 | I came across the following question today:
>
> "In drawing two balls from a box containing 6 red and 4 white balls without replacement, which of the following pairs will be independent?:
>
>
> (a) Red on 1st and red on 2nd draw
> (b) Red on 1st and white on 2nd draw
>
>
>
I approached this problem by writing d... | 2016/09/02 | ['https://math.stackexchange.com/questions/1911782', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | Let $I$ be a fixed interval $[a,b]$. Then you may let $F=\mathbb{Q} \cap I$ (rationals in $I$) and $G=I\setminus \mathbb{Q}$ (irrationals in $I$), which satisfy all the properties you want.
As you point out, there is no 'least next' value, but this is not an issue because your last bullet point doesn't necessitate th... | Such a partition does exist. Let $F = I \cap \Bbb Q$ and $G = I \setminus F$. It's clear that $F$ and $G$ have empty intersection, and their union is all of $I$.
And for any two rational numbers, there's an irrational number between them. The other way around too. Since this is all taking place inside an interval $I$,... |
7,579,300 | I have tried several ways to serve my static resources from Plone with XDV:
1. Putting the CSS and images in the Custom folder - files are 404 not found
2. Serving them from Apache and setting the Absolute URL Prefix in the XDV config - works, but any other relatively URL'd links (e.g. PDF files in my content) get pre... | 2011/09/28 | ['https://Stackoverflow.com/questions/7579300', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/535071/'] | You just need to put your css/js in the "static" directory and than use relative path in the index.html. Diazo/XDV will automagically remap relative paths.
Or you can also register a resourceDirectory in the usual way and than link files like so "++resource++myresourcedirid/my.css"
See an example [here](https://githu... | I managed to use static content served by Apache using mod\_rewrite and the following rules in Apache Virtual Host configuration.
```
RewriteRule ^/css - [L]
RewriteRule ^/img - [L]
```
I have also used Giacomo method for specific Plone content style with the `static` directory in my package which is linked in the "... |
52,417,142 | I've got a bug that looks like it's caused by an Event handler being attached a click event:
```
mxpnl.track_links("#pagebody a", "Click.body");
```
I'd like to watch to see how that Element's event handler is added (and when)
I found it in the Chrome Debugger (Dev Tools) > Elements and choose Break on Attribute m... | 2018/09/20 | ['https://Stackoverflow.com/questions/52417142', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4906/'] | Adding an event listener isn't an attribute change (often) - rather, generally it's a call to `addEventListener` or an `on`- assignment. So, listening to attribute changes won't work.
One option would be to monkeypatch `addEventListener` so that `debugger` runs when `addEventListener` is called with the matching argum... | In very simple term if explain then event listeners is just a function which add in an array with reference of string such as "click" and "on" etc..
So when you say.....
```
function myClick1(){
console.log('myclick1 called');
}
document.querySelector('mydiv').addEventListener('click', myClick1);
function ... |
2,493,585 | Can anyone help with extracting text from a page in a pdf?
```
<?php
$pdf = Zend_Pdf::load('example.pdf');
$page = $pdf->page[0];
```
I would assume a page method would exist but I could not find anything to let me extract the contents.
Example: $page->getContents(); $page->toString(); $page->extractText();
...Hel... | 2010/03/22 | ['https://Stackoverflow.com/questions/2493585', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/272645/'] | I agree with Andy that this does not appear to be supported. As an alternative, take a look at [Shaun Farrell's solution to extracting text from a PDF for use with Zend\_Search\_Lucene](http://www.kapustabrothers.com/2008/01/20/indexing-pdf-documents-with-zend_search_lucene/). He uses [XPDF](http://www.foolabs.com/xpdf... | From [the manual](http://framework.zend.com/manual/en/zend.pdf.html) it doesn't appear that this functionality is supported. Also, new text is written using the [drawText() function](http://framework.zend.com/manual/en/zend.pdf.usage.html), which appears to write images, not plain "decodable" text. |
16,766,300 | I am developing an applciation which requires to connect to sql database server. I am planning to connect to database directly without using webservice. Let me know if its possible? | 2013/05/27 | ['https://Stackoverflow.com/questions/16766300', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2361064/'] | you can directly connect to the sqlite database that is in phone. but you can not directly connect to the remote database like mysql , MSSQL and other database. if you really need to use that database you have to use web service(SOAP or REST), Http request or JSON. | You can't access remote database server without web services. If you want, you can access internal database (sqlite) without any web services. I have a doubt whether you are asking that. For that this [video](http://www.youtube.com/watch?v=j-IV87qQ00M) may be helpful for you. |
3,929,368 | I really need help with that question, so I'd appreciate a solution with steps because this problem was given for practice and my exam is in a few days so I'd like to understand the steps to the solution. Thank you. | 2020/11/30 | ['https://math.stackexchange.com/questions/3929368', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | I think what this question is getting at is that, to be a basis of a vector space,
a set of vectors must span the vector space and be linearly independent.
If $\pmatrix{x\\y}$ is any element of $\mathbb R^2$, we can solve $\pmatrix{x\\y}=a\pmatrix{1\\2}+b\pmatrix{1\\3}$
to get $a=3x-y$ and $b=y-2x$,
so $\pmatrix{x\... | **HINT**
To spell out the comment hint a bit more, if $U$ spans $\mathbb{R}^2$, and $\vec{b} \in \mathbb{R}^2$, then there must exist $x,y,z \in \mathbb{R}$ such that
$$
\vec{b}
= x\begin{bmatrix} 1\\2\end{bmatrix}
+ y\begin{bmatrix} 1\\3\end{bmatrix}
+ z\begin{bmatrix} 1\\4\end{bmatrix}
= \begin{bmatrix} 1 & 1 & ... |
3,929,368 | I really need help with that question, so I'd appreciate a solution with steps because this problem was given for practice and my exam is in a few days so I'd like to understand the steps to the solution. Thank you. | 2020/11/30 | ['https://math.stackexchange.com/questions/3929368', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | **HINT**
To spell out the comment hint a bit more, if $U$ spans $\mathbb{R}^2$, and $\vec{b} \in \mathbb{R}^2$, then there must exist $x,y,z \in \mathbb{R}$ such that
$$
\vec{b}
= x\begin{bmatrix} 1\\2\end{bmatrix}
+ y\begin{bmatrix} 1\\3\end{bmatrix}
+ z\begin{bmatrix} 1\\4\end{bmatrix}
= \begin{bmatrix} 1 & 1 & ... | For instance, $(1,3)$ is not a multiple of $(1,2)$, so they are independent and span $\Bbb R^2$.
But any $3$ vectors in a two-dimensional space are dependent, and so can't form a basis.
I have taken as given that $\Bbb R^2$ is two-dimensional, say with basis $e\_1=(1,0)$ and $e\_2=(0,1)$. |
3,929,368 | I really need help with that question, so I'd appreciate a solution with steps because this problem was given for practice and my exam is in a few days so I'd like to understand the steps to the solution. Thank you. | 2020/11/30 | ['https://math.stackexchange.com/questions/3929368', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | I think what this question is getting at is that, to be a basis of a vector space,
a set of vectors must span the vector space and be linearly independent.
If $\pmatrix{x\\y}$ is any element of $\mathbb R^2$, we can solve $\pmatrix{x\\y}=a\pmatrix{1\\2}+b\pmatrix{1\\3}$
to get $a=3x-y$ and $b=y-2x$,
so $\pmatrix{x\... | For instance, $(1,3)$ is not a multiple of $(1,2)$, so they are independent and span $\Bbb R^2$.
But any $3$ vectors in a two-dimensional space are dependent, and so can't form a basis.
I have taken as given that $\Bbb R^2$ is two-dimensional, say with basis $e\_1=(1,0)$ and $e\_2=(0,1)$. |
4,924,600 | I need to get the full path to a file somewhere on the phone (any location) and play it with MediaPlayer.
ive heard of using a file chooser for Android (by launching an intent).
In the test code, I just copied a resource to a another file, got the path and passed it to AudioVideoEntry (as i show later, a very simple... | 2011/02/07 | ['https://Stackoverflow.com/questions/4924600', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/450153/'] | Some points:
1. Do not call `prepare()` twice (once in the constructor and the other explicitly). That could be one of the reasons that the `IllegalStateException` is thrown.
2. Also, is the file that you are trying to play inside the application? If so, why are you trying to create a stream? If the file is already w... | It seems you are calling `prepare()` twice, first in the constructor of `AudioVideoEntry`, and second in the method `prepareMedia()`, that's why it's giving an `IllegalStateException`.
If you read carefully the [documentation](http://developer.android.com/reference/android/media/MediaPlayer.html) you can understand th... |
4,924,600 | I need to get the full path to a file somewhere on the phone (any location) and play it with MediaPlayer.
ive heard of using a file chooser for Android (by launching an intent).
In the test code, I just copied a resource to a another file, got the path and passed it to AudioVideoEntry (as i show later, a very simple... | 2011/02/07 | ['https://Stackoverflow.com/questions/4924600', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/450153/'] | The second call to MediaPlayer.prepare() (already called once in the AudioVideoEntry ctor) in the AudioVideoEntry.prepareMedia() method was easy to spot as other people have noticed.
The harder error to find was the first error.
I used an Ogg file for testing.
First clue was from davidsparks reply (last one) in [and... | It seems you are calling `prepare()` twice, first in the constructor of `AudioVideoEntry`, and second in the method `prepareMedia()`, that's why it's giving an `IllegalStateException`.
If you read carefully the [documentation](http://developer.android.com/reference/android/media/MediaPlayer.html) you can understand th... |
4,924,600 | I need to get the full path to a file somewhere on the phone (any location) and play it with MediaPlayer.
ive heard of using a file chooser for Android (by launching an intent).
In the test code, I just copied a resource to a another file, got the path and passed it to AudioVideoEntry (as i show later, a very simple... | 2011/02/07 | ['https://Stackoverflow.com/questions/4924600', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/450153/'] | The second call to MediaPlayer.prepare() (already called once in the AudioVideoEntry ctor) in the AudioVideoEntry.prepareMedia() method was easy to spot as other people have noticed.
The harder error to find was the first error.
I used an Ogg file for testing.
First clue was from davidsparks reply (last one) in [and... | Some points:
1. Do not call `prepare()` twice (once in the constructor and the other explicitly). That could be one of the reasons that the `IllegalStateException` is thrown.
2. Also, is the file that you are trying to play inside the application? If so, why are you trying to create a stream? If the file is already w... |
26,163,209 | I'm processing a data.frame of products called "`all`" whose first variable `all$V1` is a product family. There are several rows per product family, i.e. `length(levels(all$V1))` < `length(all$V1)`.
I want to traverse the data.frame and process by product family "`p`". I'm new to R, so I haven't fully grasped when I c... | 2014/10/02 | ['https://Stackoverflow.com/questions/26163209', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3790954/'] | Data:
```
all = data.frame(V1=c("a","b","c","d","d","c","c","b","a","a","a","d"))
```
'all' can be split by V1:
```
> ll = split(all, all$V1)
> ll
$a
V1
1 a
9 a
10 a
11 a
$b
V1
2 b
8 b
$c
V1
3 c
6 c
7 c
$d
V1
4 d
5 d
12 d
```
sapply can be used to analyze each component of list 'll'.... | There is unlikely to be much of a performance gain with the below, but it is at least more compact and returns the results of `calculateStuff` as a convenient list:
```
lapply(levels(all$V1), function(i) calculateStuff(all[all$V1 == i, ]) )
```
As @SimonG points out in his comment, depending on exactly what your `ca... |
6,507,359 | [As I have seen here](https://stackoverflow.com/questions/3680429/click-through-a-div-to-underlying-elements/4839672#4839672), a filter can be used to simulate a cross browser version of
```css
pointer-events: none;
```
However, this just doesn't work in IE9, nor does it in the "emulate IE8" version in IE9. A native... | 2011/06/28 | ['https://Stackoverflow.com/questions/6507359', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/775265/'] | You're right - AlphaImageLoader filter has been removed from IE9. This was done so that it doesn't conflict with the standards compliant methods. In this case, `pointer-events: none`, which [now works in IE9](http://msdn.microsoft.com/en-us/library/ff972269%28v=vs.85%29.aspx).
If you're using a conditional comments to... | pointer-events only works in webkit, mozilla browsers in html.
However pointer-events works on svg elements in internet explorer.
There is a good modernizr plugin <https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.min.js> to test the existence of pointer-events... |
26,801,957 | I am trying to create a mini accounts application that captures and stores the first name, last name, student number and grade of students through textboxes and then stores it to a comma delimited text file. The problem is that it re-writes the input every time I hit the save file. Any help would be appreciated. Here i... | 2014/11/07 | ['https://Stackoverflow.com/questions/26801957', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4227012/'] | On report right click and Properties > +More under the Properties > Add this parameters;
**net.sf.jasperreports.export.xls.ignore.graphics = false**
and on Jasper Server :
jasperreports-server-cp-5.0.0/apache-tomcat/webapps/jasperserver/WEB-INF/classes/jasperreports.properties
add this parameter;
**net.sf.... | 1 - You can using a simply URL File Path. Create one image component.
2 - You can active "Markup" for show HTML interpreted.
3 - You can use itext API, to generate PDF using HTML code.
maybe exists another options. |
65,772,928 | I have a meta reducer that should clear the state when logging out.
```
export function clearState(reducer: ActionReducer<any>): ActionReducer<any> {
return (state, action) => {
if (action.type === AuthActionTypes.UNAUTHENTICATED) {
state = undefined;
}
return reducer(state, action);
};
}
export... | 2021/01/18 | ['https://Stackoverflow.com/questions/65772928', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4956266/'] | I figured out a way to test it after digging deep in the ngrx source code
```
const invokeActionReducer = (currentState, action: any) => {
return clearState((state) => state)(currentState, action);
};
it('should set state to initial value when logout action is dispatched', () => {
const currentState = { /* state ... | This might not be all of it but something like this should work:
```
let store: Store<any>;
....
store = TestBed.inject(Store); // TestBed.inject is TestBed.get in older versions of Angular
TestBed.configureTEstingModule({
imports: [StoreModule.forRoot(/* put your reducers here */, { metaReducers })],
});
it('shoul... |
39,487,308 | I want to backup configuration of job, I am using to do this ThinBackup plugin in version 1.7.4 . And in every configuration of the job, there is something like `Promote builds when..`, how to backup this? | 2016/09/14 | ['https://Stackoverflow.com/questions/39487308', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5612084/'] | I ran into same issue and found this is an [open bug](https://issues.jenkins-ci.org/browse/JENKINS-21472). Looks to have a fix but a new version of the plugin hasn't been released.
A workaround which seems to work OK so far, is to separately backup the `config.xml` files under the `JENKINS_HOME/jobs/`. On Linux I ran ... | They are a some options with the ThinBackup plugin:
[](https://i.stack.imgur.com/KlCz9.png)
Did you try to enable the "Backup build archive" option? |
3,604 | Still with software science translations.. Now I'm coming to you with this expression that have always bothered me: "on the fly"
How the hood would you translate that *elegantly* to spanish?
It feels like "sobre la marcha" is way overkill, at least from a structure point of view. Also "al toque", sounds maybe too col... | 2013/04/24 | ['https://spanish.stackexchange.com/questions/3604', 'https://spanish.stackexchange.com', 'https://spanish.stackexchange.com/users/831/'] | I would generally use *sobre la marcha* and I don't see it as overkill.
What does this phrase have to do with Scientific translations? Maybe a few examples would help. | I'm from Latin America and "al toque" doesn't mean exactly "on the fly", the correct translation would be "sobre la marcha".
"Al toque" it's more like a "immediately after". |
3,604 | Still with software science translations.. Now I'm coming to you with this expression that have always bothered me: "on the fly"
How the hood would you translate that *elegantly* to spanish?
It feels like "sobre la marcha" is way overkill, at least from a structure point of view. Also "al toque", sounds maybe too col... | 2013/04/24 | ['https://spanish.stackexchange.com/questions/3604', 'https://spanish.stackexchange.com', 'https://spanish.stackexchange.com/users/831/'] | No, I don’t like very much `sobre la marcha`. I mean, not always, and in “*software science translations*” almost never. I don’t feel it translate the whole idea exactly, with sometimes is: immediately and automatically, without user’s or external elements intervention.
There are many other possibilities.
My favori... | I would generally use *sobre la marcha* and I don't see it as overkill.
What does this phrase have to do with Scientific translations? Maybe a few examples would help. |
3,604 | Still with software science translations.. Now I'm coming to you with this expression that have always bothered me: "on the fly"
How the hood would you translate that *elegantly* to spanish?
It feels like "sobre la marcha" is way overkill, at least from a structure point of view. Also "al toque", sounds maybe too col... | 2013/04/24 | ['https://spanish.stackexchange.com/questions/3604', 'https://spanish.stackexchange.com', 'https://spanish.stackexchange.com/users/831/'] | "Al toque" sounds to me like Latin America spanish... in Spain, al least in Madrid, we don't use that expression.
"On the fly" can be translated in several forms, but "sobre la marcha" I think is the most accurate. Other forms can be "al momento", "instantáneo" or "conforme se vea". Depends from context, but I think "... | I'm from Latin America and "al toque" doesn't mean exactly "on the fly", the correct translation would be "sobre la marcha".
"Al toque" it's more like a "immediately after". |
3,604 | Still with software science translations.. Now I'm coming to you with this expression that have always bothered me: "on the fly"
How the hood would you translate that *elegantly* to spanish?
It feels like "sobre la marcha" is way overkill, at least from a structure point of view. Also "al toque", sounds maybe too col... | 2013/04/24 | ['https://spanish.stackexchange.com/questions/3604', 'https://spanish.stackexchange.com', 'https://spanish.stackexchange.com/users/831/'] | No, I don’t like very much `sobre la marcha`. I mean, not always, and in “*software science translations*” almost never. I don’t feel it translate the whole idea exactly, with sometimes is: immediately and automatically, without user’s or external elements intervention.
There are many other possibilities.
My favori... | "Al toque" sounds to me like Latin America spanish... in Spain, al least in Madrid, we don't use that expression.
"On the fly" can be translated in several forms, but "sobre la marcha" I think is the most accurate. Other forms can be "al momento", "instantáneo" or "conforme se vea". Depends from context, but I think "... |
3,604 | Still with software science translations.. Now I'm coming to you with this expression that have always bothered me: "on the fly"
How the hood would you translate that *elegantly* to spanish?
It feels like "sobre la marcha" is way overkill, at least from a structure point of view. Also "al toque", sounds maybe too col... | 2013/04/24 | ['https://spanish.stackexchange.com/questions/3604', 'https://spanish.stackexchange.com', 'https://spanish.stackexchange.com/users/831/'] | No, I don’t like very much `sobre la marcha`. I mean, not always, and in “*software science translations*” almost never. I don’t feel it translate the whole idea exactly, with sometimes is: immediately and automatically, without user’s or external elements intervention.
There are many other possibilities.
My favori... | I'm from Latin America and "al toque" doesn't mean exactly "on the fly", the correct translation would be "sobre la marcha".
"Al toque" it's more like a "immediately after". |
19,673,842 | I'm a Beginner in android development. I'm using Google Maps API V2 in my Application. I want to show the street name, postcode/zip-code, city automatically of the current location. Currently I'm just displaying the longitude and latitude of the current location but don't know how to get this information as well. Can A... | 2013/10/30 | ['https://Stackoverflow.com/questions/19673842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2933576/'] | As per your question
**`How to fetch all DIVs that have some specific css rules (e.g. their color are red)?`**
```
$.each($('*'), function () {
if ($(this).css('color') == 'rgb(255, 0, 0)') {
alert($(this).text());
}
});
This will get all elements with color Red
```
[**Live Demo**](http://jsfidd... | Try this:
```
$("body").find("div:hidden")
``` |
19,673,842 | I'm a Beginner in android development. I'm using Google Maps API V2 in my Application. I want to show the street name, postcode/zip-code, city automatically of the current location. Currently I'm just displaying the longitude and latitude of the current location but don't know how to get this information as well. Can A... | 2013/10/30 | ['https://Stackoverflow.com/questions/19673842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2933576/'] | As per your question
**`How to fetch all DIVs that have some specific css rules (e.g. their color are red)?`**
```
$.each($('*'), function () {
if ($(this).css('color') == 'rgb(255, 0, 0)') {
alert($(this).text());
}
});
This will get all elements with color Red
```
[**Live Demo**](http://jsfidd... | Try this
```
$("div[style*=display:block]")
``` |
19,673,842 | I'm a Beginner in android development. I'm using Google Maps API V2 in my Application. I want to show the street name, postcode/zip-code, city automatically of the current location. Currently I'm just displaying the longitude and latitude of the current location but don't know how to get this information as well. Can A... | 2013/10/30 | ['https://Stackoverflow.com/questions/19673842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2933576/'] | As per your question
**`How to fetch all DIVs that have some specific css rules (e.g. their color are red)?`**
```
$.each($('*'), function () {
if ($(this).css('color') == 'rgb(255, 0, 0)') {
alert($(this).text());
}
});
This will get all elements with color Red
```
[**Live Demo**](http://jsfidd... | You could try using [attribute selectors](http://www.w3.org/TR/css3-selectors/#attribute-selectors).
```
document.querySelectorAll('[style="display: none"]')
```
but that would require that your `style` attributes are consistently formatted...
If you are looking to get *all* elements that have a certain css propert... |
19,673,842 | I'm a Beginner in android development. I'm using Google Maps API V2 in my Application. I want to show the street name, postcode/zip-code, city automatically of the current location. Currently I'm just displaying the longitude and latitude of the current location but don't know how to get this information as well. Can A... | 2013/10/30 | ['https://Stackoverflow.com/questions/19673842', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2933576/'] | As per your question
**`How to fetch all DIVs that have some specific css rules (e.g. their color are red)?`**
```
$.each($('*'), function () {
if ($(this).css('color') == 'rgb(255, 0, 0)') {
alert($(this).text());
}
});
This will get all elements with color Red
```
[**Live Demo**](http://jsfidd... | You might not be able to depend upon [:hidden](http://api.jquery.com/hidden-selector/) because it selects
* They have a CSS display value of none.
* They are form elements with type="hidden".
* Their width and height are explicitly set to 0.
* An ancestor element is hidden, so the element is not shown on the page.
So... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.