qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
11,761,639 | I am trying to call the `$_SESSION` `username` variable so that It will show in a URL like
```
/users/USERNAME/
```
I know there's a way to do this, but I must be doing it wrong because here's the error I get: Parse error: syntax error,
```
unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or
T_VARIABLE o... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11761639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1476205/"
] | You have a parse error.
```
"users/"
```
not
```
"users/'
``` | You're not closing your string before concatenation.
```
move_uploaded_file( $_FILES['md']['tmp_name'], "users/" . $_SESSION['username'] . $_FILES['md']['name'] );
``` |
11,761,639 | I am trying to call the `$_SESSION` `username` variable so that It will show in a URL like
```
/users/USERNAME/
```
I know there's a way to do this, but I must be doing it wrong because here's the error I get: Parse error: syntax error,
```
unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or
T_VARIABLE o... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11761639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1476205/"
] | You have a parse error.
```
"users/"
```
not
```
"users/'
``` | you have a bug in code, try this
```
move_uploaded_file( $_FILES['md']['tmp_name'],"users/".$_SESSION['username'].$_FILES['md']['name'] );
```
or
```
move_uploaded_file( $_FILES['md']['tmp_name'],"users/".$_SESSION['username']."/".$_FILES['md']['name'] );
``` |
17,194,884 | I have a model Address and one module Addressable injecting a \*belongs\_to :address\* relation for AR classes which include this module Addressable.
I want to test that class that include this module have this relation.
class Address:
```
class Address < ActiveRecord::Base
attr_accessible :street, :zip
end
```
... | 2013/06/19 | [
"https://Stackoverflow.com/questions/17194884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/818094/"
] | You need to redirect both stdout + stderr of your called scripts into your logfile.
```
./your_other_script.sh 2&>1 >> /var/log/mylogfile.txt
``` | You get output to the terminal, because of `tee`. So you can:
```
start_logging ${LOGFILE}
{
Funtion1
Funtion2
} 2>&1 | tee -a ${LOGFILE} >/dev/null
^^^^^^^^^^ - redirect the output from a tee to /dev/null
```
or simply remove the `tee` and all logs redirect only into the file
```
start_l... |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | **For the google searchers**
Very hardly I managed to destroy the `Datatable`, Empty it's all previous data before loading new data and re-initializing Datatable by doing like this,
```
if ($.fn.DataTable.isDataTable("#myTbl")) {
("#myTbl").DataTable().destroy();
}
$('#myTbl tbody > tr').remove();
...
// Load... | ```
$('#feedback-datatable').dataTable().fnDestroy();
```
this should destroy dataTable, then you will have to reinitialize dataTable. |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | **For the google searchers**
Very hardly I managed to destroy the `Datatable`, Empty it's all previous data before loading new data and re-initializing Datatable by doing like this,
```
if ($.fn.DataTable.isDataTable("#myTbl")) {
("#myTbl").DataTable().destroy();
}
$('#myTbl tbody > tr').remove();
...
// Load... | From [DataTable](https://datatables.net/reference/api/destroy())
```
var table = $('#myTable').DataTable();
$('#tableDestroy').on( 'click', function () {
table.destroy();
});
```
Reload a full table description from the server, including columns:
```
var table = $('#myTable').DataTable();
$('#submit').on( 'click', ... |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | For DataTables 1.10, the calls are:
```
// Destroy dataTable
$('#feedback-datatable').DataTable.destroy();
// Remove DOM elements
$('#feedback-datatable').empty();
``` | ```
$('#feedback-datatable').dataTable().fnDestroy();
```
this should destroy dataTable, then you will have to reinitialize dataTable. |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | To completely delete and remove the datatable object with its DOM elements you need to :
```
//Delete the datable object first
if(oTable != null)oTable.fnDestroy();
//Remove all the DOM elements
$('#feedback-datatable').empty();
``` | ```
$('#feedback-datatable').dataTable().fnDestroy();
```
this should destroy dataTable, then you will have to reinitialize dataTable. |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | To completely delete and remove the datatable object with its DOM elements you need to :
```
//Delete the datable object first
if(oTable != null)oTable.fnDestroy();
//Remove all the DOM elements
$('#feedback-datatable').empty();
``` | Just add this parameter to your declaration:
```
"bDestroy" : true,
```
Then whenever you want to "recreate" the table it won't drop an error
P.S. You can create a function to get the required parameters and then reinitialize the table with different options at runtime.
For example I use this one in my programs, ... |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | To completely delete and remove the datatable object with its DOM elements you need to :
```
//Delete the datable object first
if(oTable != null)oTable.fnDestroy();
//Remove all the DOM elements
$('#feedback-datatable').empty();
``` | On DataTables 1.10 and above you can use `"destroy": true`
Read more details [here](https://datatables.net/reference/api/destroy()) |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | For DataTables 1.10, the calls are:
```
// Destroy dataTable
$('#feedback-datatable').DataTable.destroy();
// Remove DOM elements
$('#feedback-datatable').empty();
``` | **For the google searchers**
Very hardly I managed to destroy the `Datatable`, Empty it's all previous data before loading new data and re-initializing Datatable by doing like this,
```
if ($.fn.DataTable.isDataTable("#myTbl")) {
("#myTbl").DataTable().destroy();
}
$('#myTbl tbody > tr').remove();
...
// Load... |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | For DataTables 1.10, the calls are:
```
// Destroy dataTable
$('#feedback-datatable').DataTable.destroy();
// Remove DOM elements
$('#feedback-datatable').empty();
``` | On DataTables 1.10 and above you can use `"destroy": true`
Read more details [here](https://datatables.net/reference/api/destroy()) |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | Just add this parameter to your declaration:
```
"bDestroy" : true,
```
Then whenever you want to "recreate" the table it won't drop an error
P.S. You can create a function to get the required parameters and then reinitialize the table with different options at runtime.
For example I use this one in my programs, ... | **For the google searchers**
Very hardly I managed to destroy the `Datatable`, Empty it's all previous data before loading new data and re-initializing Datatable by doing like this,
```
if ($.fn.DataTable.isDataTable("#myTbl")) {
("#myTbl").DataTable().destroy();
}
$('#myTbl tbody > tr').remove();
...
// Load... |
15,172,873 | I'm using [datatables](http://www.datatables.net/) and using [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) to select a range for which data will be shown in Datatables.
It is working fine.
The problem is when I select a new range in daterangepicker, it provides me with a callba... | 2013/03/02 | [
"https://Stackoverflow.com/questions/15172873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1230252/"
] | To completely delete and remove the datatable object with its DOM elements you need to :
```
//Delete the datable object first
if(oTable != null)oTable.fnDestroy();
//Remove all the DOM elements
$('#feedback-datatable').empty();
``` | For DataTables 1.10, the calls are:
```
// Destroy dataTable
$('#feedback-datatable').DataTable.destroy();
// Remove DOM elements
$('#feedback-datatable').empty();
``` |
6,752,978 | I need to see what page an Android App is calling from my device. Are there any Apps like Fiddler or Wireshark to see what´s happening behind? | 2011/07/19 | [
"https://Stackoverflow.com/questions/6752978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151174/"
] | I normally use a laptop with Wireshark instead of trying to capture on the device:
[Working link from web archive](https://web.archive.org/web/20110312083510/http://droidhacks.com:80/2009/06/monitoring-network-traffic-using-os-x/ "Archived Link")
[~~http://droidhacks.com/2009/06/monitoring-network-traffic-using-os-... | If your Android device supports a proxy (apparently there are apps for that), you can just use Fiddler. See <http://blogs.msdn.com/b/fiddler/archive/2011/01/09/debugging-windows-phone-7-device-traffic-with-fiddler.aspx> for equivalent instructions for Windows Phone 7. |
6,752,978 | I need to see what page an Android App is calling from my device. Are there any Apps like Fiddler or Wireshark to see what´s happening behind? | 2011/07/19 | [
"https://Stackoverflow.com/questions/6752978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151174/"
] | I normally use a laptop with Wireshark instead of trying to capture on the device:
[Working link from web archive](https://web.archive.org/web/20110312083510/http://droidhacks.com:80/2009/06/monitoring-network-traffic-using-os-x/ "Archived Link")
[~~http://droidhacks.com/2009/06/monitoring-network-traffic-using-os-... | You can find how to configure Android emulator and Fiddler to watch http requests and responses here: <http://vkosinets.com/blog/2011/08/16/debug-http-requests-from-android-emulator> |
6,752,978 | I need to see what page an Android App is calling from my device. Are there any Apps like Fiddler or Wireshark to see what´s happening behind? | 2011/07/19 | [
"https://Stackoverflow.com/questions/6752978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151174/"
] | If your Android device supports a proxy (apparently there are apps for that), you can just use Fiddler. See <http://blogs.msdn.com/b/fiddler/archive/2011/01/09/debugging-windows-phone-7-device-traffic-with-fiddler.aspx> for equivalent instructions for Windows Phone 7. | You can find how to configure Android emulator and Fiddler to watch http requests and responses here: <http://vkosinets.com/blog/2011/08/16/debug-http-requests-from-android-emulator> |
51,668,293 | I have to extract a specific part from an url origin. But I can't seem to figure out a good and fail proof way to do this
For example, this is my url:
<http://site.domain.com>
I need to know what "domain" is used. How do I get this part from the url 100% of the time?
My first thought was to split it between the "." ... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51668293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4063617/"
] | Without the "@" you would be binding values to the component.
With the "@" you indicate that the variable (in this example heroState) is an animaton-state and not a value-bind, it will trigger animations you declare. | I guess the @ is some kind of escape character in angular in html templates. Here it indicates that it is not a bounded value but rather an animation state. |
51,668,293 | I have to extract a specific part from an url origin. But I can't seem to figure out a good and fail proof way to do this
For example, this is my url:
<http://site.domain.com>
I need to know what "domain" is used. How do I get this part from the url 100% of the time?
My first thought was to split it between the "." ... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51668293",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4063617/"
] | That is used for triggering **`animations`**, which would load the **`specific styles`** from the styling file when you need it,
In the above when the variable **`heroState`** is **`inactive`** it will load the particular style with the animation
```
animations: [
trigger('heroState', [
state('inactive', style(... | I guess the @ is some kind of escape character in angular in html templates. Here it indicates that it is not a bounded value but rather an animation state. |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Protestants believe that Jesus wants them to pray "*in Jesus' name*" and they would cite the following verses to warrant their belief:
>
> **John 14:13-14 ESV** Whatever you ask in my name, this I will do, that the Father may be glorified in the Son. If you ask me anything in my name, I will do it.
>
>
> **John 14:... | In protestant theology, it is only through Jesus' atoning sacrifice that we may enter into the presence of a holy God who is utterly incompatible with sin. We, as sinners, are allowed to pray only because Jesus died for our sins. So to say "in Jesus name" actually means "I know that I can only enter your presence becau... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Lutherans do pray:
>
> Pastor: In the name of the Father and of the Son and of the Holy Ghost
>
>
> Congregation: Amen
>
>
>
during a typical service
just as it says in the online hymnal here: <http://www.lutheran-hymnal.com/online/page5.html>
Or see [an older 1912 source](http://www.projectwittenberg.org/ete... | In protestant theology, it is only through Jesus' atoning sacrifice that we may enter into the presence of a holy God who is utterly incompatible with sin. We, as sinners, are allowed to pray only because Jesus died for our sins. So to say "in Jesus name" actually means "I know that I can only enter your presence becau... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Although it may be that most Protestants are unaware of the actual reason and do it for silly reasons such as are cited in the other answers ("Protestants just like to say Jesus a lot, etc.") the original reason is obviously John 16:23
>
> And in that day ye shall ask me nothing. Verily, verily, I say unto you, ***Wh... | Well, as a protestant (Baptist to be specific, although I consider myself a Christian first, and the particular denomination is just a formality) we pray in Jesus' name because
>
> **1 Timothy 2:5-6 NIV** For there is one God and one mediator between God and mankind, the man Christ Jesus, who gave himself as a ranso... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Lutherans do pray:
>
> Pastor: In the name of the Father and of the Son and of the Holy Ghost
>
>
> Congregation: Amen
>
>
>
during a typical service
just as it says in the online hymnal here: <http://www.lutheran-hymnal.com/online/page5.html>
Or see [an older 1912 source](http://www.projectwittenberg.org/ete... | Well, as a protestant (Baptist to be specific, although I consider myself a Christian first, and the particular denomination is just a formality) we pray in Jesus' name because
>
> **1 Timothy 2:5-6 NIV** For there is one God and one mediator between God and mankind, the man Christ Jesus, who gave himself as a ranso... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | First, it is valuable in this answer to distinguish between the pious practice of individuals, and small groups of believers, on the one hand, and the official formularies of the larger group, on the other. It may be that among Roman Catholics, there are those who use the full Trinitarian formula to begin and end an in... | Although it may be that most Protestants are unaware of the actual reason and do it for silly reasons such as are cited in the other answers ("Protestants just like to say Jesus a lot, etc.") the original reason is obviously John 16:23
>
> And in that day ye shall ask me nothing. Verily, verily, I say unto you, ***Wh... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Although it may be that most Protestants are unaware of the actual reason and do it for silly reasons such as are cited in the other answers ("Protestants just like to say Jesus a lot, etc.") the original reason is obviously John 16:23
>
> And in that day ye shall ask me nothing. Verily, verily, I say unto you, ***Wh... | In protestant theology, it is only through Jesus' atoning sacrifice that we may enter into the presence of a holy God who is utterly incompatible with sin. We, as sinners, are allowed to pray only because Jesus died for our sins. So to say "in Jesus name" actually means "I know that I can only enter your presence becau... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | First, it is valuable in this answer to distinguish between the pious practice of individuals, and small groups of believers, on the one hand, and the official formularies of the larger group, on the other. It may be that among Roman Catholics, there are those who use the full Trinitarian formula to begin and end an in... | In protestant theology, it is only through Jesus' atoning sacrifice that we may enter into the presence of a holy God who is utterly incompatible with sin. We, as sinners, are allowed to pray only because Jesus died for our sins. So to say "in Jesus name" actually means "I know that I can only enter your presence becau... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Although it may be that most Protestants are unaware of the actual reason and do it for silly reasons such as are cited in the other answers ("Protestants just like to say Jesus a lot, etc.") the original reason is obviously John 16:23
>
> And in that day ye shall ask me nothing. Verily, verily, I say unto you, ***Wh... | I grew up being raised Catholic, not Roman Catholic... Simply Catholic. When Catholics say "In the name of The Father, The Son, and The Holy Spirit (or "Holy Ghost"), Amen", it's a reference to the Holy Trinity.
The Father IS God himself. The Son IS Jesus, who was the embodiment of God. The Holy Spirit (or Holy Ghost,... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Protestants do not see that Christ ever instructed his followers to *pray* (only to *baptize*) "in the name of the Father, and of the Son, and of the Holy Spirit". On the other hand, Christians are repeatedly called to invoke the name of the Lord:
>
> To the church of God in Corinth, to those sanctified in Christ Jes... | Lutherans do pray:
>
> Pastor: In the name of the Father and of the Son and of the Holy Ghost
>
>
> Congregation: Amen
>
>
>
during a typical service
just as it says in the online hymnal here: <http://www.lutheran-hymnal.com/online/page5.html>
Or see [an older 1912 source](http://www.projectwittenberg.org/ete... |
34,070 | Why do Protestants oftentimes seem to say: "In Jesus' name. Amen.", whereas Catholics generally begin and end prayers saying: "In the name of the Father, and of the Son, and of the Holy Spirit. Amen."?
Do Protestants object to praying "In the name of the Father, and of the Son, and of the Holy Spirit.", or, conversely... | 2014/10/27 | [
"https://christianity.stackexchange.com/questions/34070",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/1787/"
] | Protestants do not see that Christ ever instructed his followers to *pray* (only to *baptize*) "in the name of the Father, and of the Son, and of the Holy Spirit". On the other hand, Christians are repeatedly called to invoke the name of the Lord:
>
> To the church of God in Corinth, to those sanctified in Christ Jes... | Well, as a protestant (Baptist to be specific, although I consider myself a Christian first, and the particular denomination is just a formality) we pray in Jesus' name because
>
> **1 Timothy 2:5-6 NIV** For there is one God and one mediator between God and mankind, the man Christ Jesus, who gave himself as a ranso... |
28,828,212 | I have two classes of users: "users" and "shops". I want the admin to be a "user" and be able to delete shops, and am running in to trouble.
I was able to get the delete button to show up in `shops/index.html.erb` if the logged in user was an admin (shown below), but when I try to delete a shop object I get the error ... | 2015/03/03 | [
"https://Stackoverflow.com/questions/28828212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805144/"
] | ```
^(?=.*[a-zA-Z0-9])[A-Za-z0-9@#]{0,8}$
```
Try this.See [demo.](https://regex101.com/r/wU7sQ0/52)
The `lookahead` will make sure there is atleast `one` character. | Use the below regex in `matches` method.
```
"(?=.*?[A-Za-z0-9])[A-Za-z0-9@#]{1,8}"
```
`(?=.*?[A-Za-z0-9])` asserts that the string must contain atleast one letter or digit , so there must be a single character present in the match. That's why i defined `[A-Za-z0-9@#]{1,8}` instead of `[A-Za-z0-9@#]{0,8}`
```
Stri... |
28,828,212 | I have two classes of users: "users" and "shops". I want the admin to be a "user" and be able to delete shops, and am running in to trouble.
I was able to get the delete button to show up in `shops/index.html.erb` if the logged in user was an admin (shown below), but when I try to delete a shop object I get the error ... | 2015/03/03 | [
"https://Stackoverflow.com/questions/28828212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805144/"
] | ```
^(?=.*[a-zA-Z0-9])[A-Za-z0-9@#]{0,8}$
```
Try this.See [demo.](https://regex101.com/r/wU7sQ0/52)
The `lookahead` will make sure there is atleast `one` character. | You can use:
```
^(?=.*?[A-Za-z0-9])[@#A-Za-z0-9]{1,8}$
``` |
28,828,212 | I have two classes of users: "users" and "shops". I want the admin to be a "user" and be able to delete shops, and am running in to trouble.
I was able to get the delete button to show up in `shops/index.html.erb` if the logged in user was an admin (shown below), but when I try to delete a shop object I get the error ... | 2015/03/03 | [
"https://Stackoverflow.com/questions/28828212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805144/"
] | ```
^(?=.*[a-zA-Z0-9])[A-Za-z0-9@#]{0,8}$
```
Try this.See [demo.](https://regex101.com/r/wU7sQ0/52)
The `lookahead` will make sure there is atleast `one` character. | You can try regex like this :
```
public static void main(String[] args) {
String s = "aaaaaaa";
System.out.println(s.matches("(?=.*[A-Za-z0-9])[A-Za-z0-9@#]{1,7}"));
}
```
O/P :
true |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | For these who are using create-react-app with customize-cra you can use the Method 2 solution from @smac89 with addWebpackPlugin, this works for me.
react-scripts: 5.0.0
webpack: 5.64.4
```js
// config-overrides.js
const webpack = require('webpack');
const { override, addWebpackPlugin } = require('customize-cra');
m... | I had the same problem in reactJs and I fixed it with these steps:
Add to package.json:
1. "scripts": {
"preinstall": "npx npm-force-resolutions"
}
2. "resolutions": {
"react-error-overlay": "6.0.9"
} |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | The issue was solved by updating react-scripts to 5.0.0 | Facing the same issue today (14th feb 22) using Docker containers for a ReactJS app and I solved it downgrading the react-scripts version to 4.0.3 and also installing react-error-overlay on version 6.0.9.
So the steps were:
1. Remove the **package-lock.json** file
2. Into the **package.json** file
1. Replace the depe... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | Upgrading from react-scripts 4.0.3 to 5.0.0 Did not work for me.
The only thing that finally worked is the above proposed solution
using yarn
```
"devDependencies": {
"react-error-overlay": "6.0.9"
},
"resolutions": {
"react-error-overlay": "6.0.9"
}
```
then yarn install
for npm i ... | in yarn.lock or package-lock.json file to find string
```
"react-error-overlay@npm:^6.0.9":
version: 6.0.10 <-- here problem
etc...
```
and replace to
```
react-error-overlay@^6.0.9:
version "6.0.9"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c3... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | Facing the same issue today (14th feb 22) using Docker containers for a ReactJS app and I solved it downgrading the react-scripts version to 4.0.3 and also installing react-error-overlay on version 6.0.9.
So the steps were:
1. Remove the **package-lock.json** file
2. Into the **package.json** file
1. Replace the depe... | Thanks, this works for me, as Kaleb was saying
>
> if using Webpack, run npm install -D dotenv-webpack and if using
> typescript npm install -D @types/dotenv-webpack.
> Then in your Webpack config, add import Dotenv from "dotenv-webpack";
> And
>
>
>
```
plugins: [
...
new Dotenv(),
],
``` |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | I tried updating **react-scripts to 5.0.0, but that didn't work.**
Solution: -
-----------
* If you are using `npm`: -
`npm i -D react-error-overlay@6.0.9`
* If you are using `yarn`: -
`yarn add -D react-error-overlay@6.0.9` | The only solution that worked for me was a modification of what @smac89 wrote for craco.
First add process as a dependency.
```
yarn add process or npm i process
```
Then add these lines to your craco.config.js.
```
const webpack = require('webpack');
module.exports = {
webpack: {
...
plugins: {
... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | A lot of answers suggest overriding the `react-error-overlay` to `6.0.9`, but this didn't work for me (on February 11th, 2022). I was using `react-scripts 5.0.0` and `react-error-overlay 6.0.10` before trying out the overlay override.
Instead of going through the hastle of defining the webpack configuration in my CRA ... | If you are using npm > v8.3 you can use `overrides` like so in your `package.json`.
```
"overrides": {
"react-error-overlay": "6.0.9"
}
```
For more information about overrides, go [here](https://stackoverflow.com/questions/15806152/how-do-i-override-nested-npm-dependency-versions).
The issue is a breaking ... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | Add this code in package.json
```
"devDependencies": {
"react-error-overlay": "6.0.9"
}
```
After that run `npm install` command.
It worked for me after 2 days of scrolling on the internet. | Facing the same issue today (14th feb 22) using Docker containers for a ReactJS app and I solved it downgrading the react-scripts version to 4.0.3 and also installing react-error-overlay on version 6.0.9.
So the steps were:
1. Remove the **package-lock.json** file
2. Into the **package.json** file
1. Replace the depe... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | For those still having issues with this: If using Webpack, run `npm install -D dotenv-webpack` and if using typescript `npm install -D @types/dotenv-webpack`.
Then in your Webpack config, add `import Dotenv from "dotenv-webpack";`
And
```
...
plugins: [
...
new Dotenv(),
],
...
```
See <https://github.com... | in yarn.lock or package-lock.json file to find string
```
"react-error-overlay@npm:^6.0.9":
version: 6.0.10 <-- here problem
etc...
```
and replace to
```
react-error-overlay@^6.0.9:
version "6.0.9"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c3... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | The issue was solved by updating react-scripts to 5.0.0 | For these who are using create-react-app with customize-cra you can use the Method 2 solution from @smac89 with addWebpackPlugin, this works for me.
react-scripts: 5.0.0
webpack: 5.64.4
```js
// config-overrides.js
const webpack = require('webpack');
const { override, addWebpackPlugin } = require('customize-cra');
m... |
70,368,785 | I am trying to create a paragraph with contenteditable enabled, where you will enter the value.
Later on, by pressing on the button "Submit" I want that it triggers function if, else which will take the number that the user wrote in the content editable. After checking the if-else function I want that result to be disp... | 2021/12/15 | [
"https://Stackoverflow.com/questions/70368785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17686019/"
] | For these who are using create-react-app with customize-cra you can use the Method 2 solution from @smac89 with addWebpackPlugin, this works for me.
react-scripts: 5.0.0
webpack: 5.64.4
```js
// config-overrides.js
const webpack = require('webpack');
const { override, addWebpackPlugin } = require('customize-cra');
m... | Note: This is a response to those who sees the `process is not defined` issue related to `index.html`, not the OP.
---
This might be due to that you are trying to use `process.env` directly in the `index.html` without using `<% %>`
Correct usage looks like this in `index.html`:
```
<% if (process.env.NODE_ENV !== '... |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Either maintain a list of nodes visited to date and compare each node to the list as you come to it (slow, but requires no infrastructure), or "color" each node, and check if the next node is "colored" already (requires you to have a "color" flag installed in each node).
Or use [1800 INFORMATIONS's suggestion](https:/... | Traverse, and when you hit a node you've already visited, that's where the cycle comes back. |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There is a very nice algorithm that uses constant space, O(n) runtime and only two pointers. You traverse the list from the head with the first pointer, and at double speed with the second pointer. At each step compare the pointers, if they are ever equal, you have found the loop. | Traverse, and when you hit a node you've already visited, that's where the cycle comes back. |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | * Find a node inside the cycle (see 1800 INFORMATION's answer for details). Let's call this node C
* Find the length of the cycle by advancing a pointer from C until it reaches C again. The length of the cycle is the number of steps it took. Let's call this length L
* Create a pointer that is L steps forward from the s... | Traverse, and when you hit a node you've already visited, that's where the cycle comes back. |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think yairchu's answer using 1800's find method is the best solution - one of those solutions that made me smile to read it ;-)
But I will go ahead and post what I was thinking about, which only uses 4 extra pointers and a boolean.
Let's call the nodes a->b->c->...
If you start at a and go through the list flippin... | Traverse, and when you hit a node you've already visited, that's where the cycle comes back. |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | * Find a node inside the cycle (see 1800 INFORMATION's answer for details). Let's call this node C
* Find the length of the cycle by advancing a pointer from C until it reaches C again. The length of the cycle is the number of steps it took. Let's call this length L
* Create a pointer that is L steps forward from the s... | Either maintain a list of nodes visited to date and compare each node to the list as you come to it (slow, but requires no infrastructure), or "color" each node, and check if the next node is "colored" already (requires you to have a "color" flag installed in each node).
Or use [1800 INFORMATIONS's suggestion](https:/... |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Either maintain a list of nodes visited to date and compare each node to the list as you come to it (slow, but requires no infrastructure), or "color" each node, and check if the next node is "colored" already (requires you to have a "color" flag installed in each node).
Or use [1800 INFORMATIONS's suggestion](https:/... | I think yairchu's answer using 1800's find method is the best solution - one of those solutions that made me smile to read it ;-)
But I will go ahead and post what I was thinking about, which only uses 4 extra pointers and a boolean.
Let's call the nodes a->b->c->...
If you start at a and go through the list flippin... |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | * Find a node inside the cycle (see 1800 INFORMATION's answer for details). Let's call this node C
* Find the length of the cycle by advancing a pointer from C until it reaches C again. The length of the cycle is the number of steps it took. Let's call this length L
* Create a pointer that is L steps forward from the s... | There is a very nice algorithm that uses constant space, O(n) runtime and only two pointers. You traverse the list from the head with the first pointer, and at double speed with the second pointer. At each step compare the pointers, if they are ever equal, you have found the loop. |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There is a very nice algorithm that uses constant space, O(n) runtime and only two pointers. You traverse the list from the head with the first pointer, and at double speed with the second pointer. At each step compare the pointers, if they are ever equal, you have found the loop. | I think yairchu's answer using 1800's find method is the best solution - one of those solutions that made me smile to read it ;-)
But I will go ahead and post what I was thinking about, which only uses 4 extra pointers and a boolean.
Let's call the nodes a->b->c->...
If you start at a and go through the list flippin... |
1,285,560 | I am not sure how would I find the start of the cycle without using O(N) memory and flags | 2009/08/16 | [
"https://Stackoverflow.com/questions/1285560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | * Find a node inside the cycle (see 1800 INFORMATION's answer for details). Let's call this node C
* Find the length of the cycle by advancing a pointer from C until it reaches C again. The length of the cycle is the number of steps it took. Let's call this length L
* Create a pointer that is L steps forward from the s... | I think yairchu's answer using 1800's find method is the best solution - one of those solutions that made me smile to read it ;-)
But I will go ahead and post what I was thinking about, which only uses 4 extra pointers and a boolean.
Let's call the nodes a->b->c->...
If you start at a and go through the list flippin... |
29,513,631 | I would like to add a selectionFieldList to my Form, but unfortunetlly I could not fill with values from DB beacuse I got compile error.
I have form definition like this:
```
flowerForm = renderDivs $ FormFlower
<$> areq textField "Flower" Nothing
<*> areq (selectFieldList findAllAsTuple) "Category" Nothing
```
And... | 2015/04/08 | [
"https://Stackoverflow.com/questions/29513631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274220/"
] | Type of `findAllAsTuple` is `HandlerT site IO [(Text, Text)]`.
You can check it in GHCI by removing your (wrong) type signature.
Function `selectFieldList` should getting data from static list without any IO.
Best way is using function `selectField`. You should look to it's type:
`selectField ::(Eq a, RenderMessage... | Finally I found the solution.
My function should look like this :
```
findAllAsTuple :: HandlerT App IO (OptionList Text)
findAllAsTuple =do
items <- runDB $ selectList [] [Asc CategoryName]
optionsPairs $ map (\c -> (categoryName $ entityVal c,categoryName $ entityVal c)) items
```
D... |
35,322,943 | How do I get the position of selected text from the 1st character in the string. When I do
```
ind = textwidget.index("self.first")
```
I only get index as line.column. What I would like to have is the number of characters from the start of the first character. The motivation for doing this way is that I do not ha... | 2016/02/10 | [
"https://Stackoverflow.com/questions/35322943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1076215/"
] | The text widget has a method named `count` which will give you the count of the number of characters between two positions. This method is available with python3, but not with python2. However, there's a simple fix for python2.
For python3, to get the count of characters between the start of the widget and the first s... | I presume by 'first character' you mean the first character in the text, at index '1.0', since otherwise the index column would be your answer. If so, then you will have to sum the number of characters in previous lines and add the column from the index.
```
import tkinter as tk
root = tk.Tk()
t = tk.Text(root)
t.inse... |
2,022,772 | I have checked the solution ($x=26$).
Solving modulo $5$ gives
$$1978^{20}\equiv 1978^{2\cdot 10}\equiv 1\pmod{5}$$
Solving modulo $25$ also gives
$$1978^{20}\equiv 1\pmod{5}$$
How to evaluate the remainder $x$? | 2016/11/20 | [
"https://math.stackexchange.com/questions/2022772",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222321/"
] | As $(ab)\mod c = (a \mod c) (b \mod c)\mod c$ you can say
$$1978^{20}\mod 125$$ $$\equiv (1978\mod 125 )^{20} \mod 125$$ $$\equiv 103^{20} \mod 125 $$ $$\equiv (-22)^{20} \mod 125$$
And as the exponent is even
$$\equiv 22^{20} \mod 125$$
Then you just calculate and take modulo after each calculation. Whenever you h... | Alternative solution:
$1978^1\equiv103\pmod{125}\implies$
$1978^2\equiv103^2\equiv109\pmod{125}\implies$
$1978^4\equiv109^2\equiv6\pmod{125}\implies$
$1978^8\equiv6^2\equiv36\pmod{125}\implies$
$1978^{16}\equiv36^2\equiv46\pmod{125}$
---
$1978^{20}=1978^{4+16}=1978^4\cdot1978^{16}\equiv6\cdot46\equiv26\pmod{125}... |
2,022,772 | I have checked the solution ($x=26$).
Solving modulo $5$ gives
$$1978^{20}\equiv 1978^{2\cdot 10}\equiv 1\pmod{5}$$
Solving modulo $25$ also gives
$$1978^{20}\equiv 1\pmod{5}$$
How to evaluate the remainder $x$? | 2016/11/20 | [
"https://math.stackexchange.com/questions/2022772",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222321/"
] | ${\rm mod}\ \ \ 25\!:\ \ \ 1978^{\large 4}\equiv 3^{\large 4}\equiv 6,\ $ so $\ 1978^{\large 4} = 6+25j$
${\rm mod}\ 125\!:\ (1978^{\large 4})^{\large 5} \equiv (6+25j)^{\large 5} \equiv 6^{\large 5} + 125(\cdots)\equiv 6^{\large 5}\equiv 26\ $ by the Binomial Theorem | Alternative solution:
$1978^1\equiv103\pmod{125}\implies$
$1978^2\equiv103^2\equiv109\pmod{125}\implies$
$1978^4\equiv109^2\equiv6\pmod{125}\implies$
$1978^8\equiv6^2\equiv36\pmod{125}\implies$
$1978^{16}\equiv36^2\equiv46\pmod{125}$
---
$1978^{20}=1978^{4+16}=1978^4\cdot1978^{16}\equiv6\cdot46\equiv26\pmod{125}... |
2,022,772 | I have checked the solution ($x=26$).
Solving modulo $5$ gives
$$1978^{20}\equiv 1978^{2\cdot 10}\equiv 1\pmod{5}$$
Solving modulo $25$ also gives
$$1978^{20}\equiv 1\pmod{5}$$
How to evaluate the remainder $x$? | 2016/11/20 | [
"https://math.stackexchange.com/questions/2022772",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222321/"
] | As $(ab)\mod c = (a \mod c) (b \mod c)\mod c$ you can say
$$1978^{20}\mod 125$$ $$\equiv (1978\mod 125 )^{20} \mod 125$$ $$\equiv 103^{20} \mod 125 $$ $$\equiv (-22)^{20} \mod 125$$
And as the exponent is even
$$\equiv 22^{20} \mod 125$$
Then you just calculate and take modulo after each calculation. Whenever you h... | Note that, modulo $125$, $11^2=121\equiv-4$ and $2^7=128\equiv3$.
Therefore, $1978^{20}\equiv(-22)^{20}\equiv 2^{20}11^{20}\equiv 2^{20}(-4)^{10}\equiv 2^{40}\equiv2^{35}2^5\equiv3^52^5\equiv6^5\equiv26$. |
2,022,772 | I have checked the solution ($x=26$).
Solving modulo $5$ gives
$$1978^{20}\equiv 1978^{2\cdot 10}\equiv 1\pmod{5}$$
Solving modulo $25$ also gives
$$1978^{20}\equiv 1\pmod{5}$$
How to evaluate the remainder $x$? | 2016/11/20 | [
"https://math.stackexchange.com/questions/2022772",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/222321/"
] | ${\rm mod}\ \ \ 25\!:\ \ \ 1978^{\large 4}\equiv 3^{\large 4}\equiv 6,\ $ so $\ 1978^{\large 4} = 6+25j$
${\rm mod}\ 125\!:\ (1978^{\large 4})^{\large 5} \equiv (6+25j)^{\large 5} \equiv 6^{\large 5} + 125(\cdots)\equiv 6^{\large 5}\equiv 26\ $ by the Binomial Theorem | Note that, modulo $125$, $11^2=121\equiv-4$ and $2^7=128\equiv3$.
Therefore, $1978^{20}\equiv(-22)^{20}\equiv 2^{20}11^{20}\equiv 2^{20}(-4)^{10}\equiv 2^{40}\equiv2^{35}2^5\equiv3^52^5\equiv6^5\equiv26$. |
1,809,381 | It is often hard to find the origin of a NaN, since it can happen at any step of a computation and propagate itself.
So is it possible to make a C++ program halt when a computation returns NaN or inf? The best in my opinion would be to have a crash with a nice error message:
```
Foo: NaN encoutered at Foo.c:624
```
... | 2009/11/27 | [
"https://Stackoverflow.com/questions/1809381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164171/"
] | Yes! Set (perhaps more or less portably) your IEEE 754-compliant processor to generate an interrupt when a NaN or infinite is encountered.
I googled and found [these slides](http://grouper.ieee.org/groups/754/meeting-materials/2001-07-18-c99.pdf), which are a start. The slide on page 5 summarizes all the information y... | I'm no C expert, but I expect the answer is no.
1. This would require every float calculation to have this check. A huge performance impact.
2. NaN and Inf aren't evil. They may be legitimately used in some library your app uses, and break it. |
1,809,381 | It is often hard to find the origin of a NaN, since it can happen at any step of a computation and propagate itself.
So is it possible to make a C++ program halt when a computation returns NaN or inf? The best in my opinion would be to have a crash with a nice error message:
```
Foo: NaN encoutered at Foo.c:624
```
... | 2009/11/27 | [
"https://Stackoverflow.com/questions/1809381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164171/"
] | You can't do it in a completely portable way, but many platforms provide C APIs that allow you to access the floating point status control register(s).
Specifically, you want to unmask the overflow and invalid floating-point exceptions, which will cause the processor to signal an exception when arithmetic in your prog... | I'm no C expert, but I expect the answer is no.
1. This would require every float calculation to have this check. A huge performance impact.
2. NaN and Inf aren't evil. They may be legitimately used in some library your app uses, and break it. |
1,809,381 | It is often hard to find the origin of a NaN, since it can happen at any step of a computation and propagate itself.
So is it possible to make a C++ program halt when a computation returns NaN or inf? The best in my opinion would be to have a crash with a nice error message:
```
Foo: NaN encoutered at Foo.c:624
```
... | 2009/11/27 | [
"https://Stackoverflow.com/questions/1809381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164171/"
] | You can't do it in a completely portable way, but many platforms provide C APIs that allow you to access the floating point status control register(s).
Specifically, you want to unmask the overflow and invalid floating-point exceptions, which will cause the processor to signal an exception when arithmetic in your prog... | Yes! Set (perhaps more or less portably) your IEEE 754-compliant processor to generate an interrupt when a NaN or infinite is encountered.
I googled and found [these slides](http://grouper.ieee.org/groups/754/meeting-materials/2001-07-18-c99.pdf), which are a start. The slide on page 5 summarizes all the information y... |
70,382,201 | HiHi,
*disclaimer: I have no experience with coding*
I have a code which takes values from cells (B2:C2) from multiple worksheets in a folder on my desktop and pasts it into the master workbook. This works great, however, I don't want the copied cells pasted consecutively down cells (F3:G3)- they need to be pasted into... | 2021/12/16 | [
"https://Stackoverflow.com/questions/70382201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17694332/"
] | Use a Regular Expression to extract the SN and Ch. numbers from the filename. Use Find to located the SN on the summary sheet then scan the merged rows for the Ch number.
```vb
Sub MergeAllWorkbooks()
' Modify this folder path to point to the files you want to use.
Const FolderPath = "C:\Users\Me\Desktop\Extr... | From your explanation it is not clear if you are able to match the source worksheets with a specific Ch. If you can, I'd advise to define a Ch variable soon after the For each sh loop, then you need to initiate another loop in the master workbook on column D for each row until you get the row number of the Ch variable.... |
12,900,816 | I cannot get Perl and Ruby to agree on CBC AES:
**Perl**
```
use Crypt::CBC;
use MIME::Base64::Perl;
my $cipher = Crypt::CBC->new(
-key => 'd2cb415e067c7b13',
-iv => 'e36dc751d0433f05', #random 16chars!!!!!! shold NOT repeat between requests
-cipher => 'OpenSSL::AES', ... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12900816",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/22992/"
] | Newlines are not significant in Base64. You got exactly the same result from both languages.
While there should be absolutely no reason to do so, you could make the Perl version return the same string as the Ruby version as follows:
```
$base64 = encode_base64($encypted, '');
$base64 =~ s/\G.{60}\K/\n/sg;
``` | The `encode_base64` function takes a second parameter, called "eol" (end of line) which, by default, is '\n'.
>
> The returned encoded string is broken into lines of no more than 76
> characters each and it will end with $eol unless it is empty
>
>
>
Try:
```
$base64 = encode_base64($encypted, '');
```
instea... |
64,686,203 | I am having problems to implement notifications using firebase. The click event does not work. I am using the HTTP 1 version sending the bearer token.
```
{
"message": {
"token": "8888****usertoken****8888",
"notification": {
"title": "Background Message Title",
"body": "Background message body"
... | 2020/11/04 | [
"https://Stackoverflow.com/questions/64686203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14506769/"
] | I was having the same issue. I added a `notificationclick` event handler. You can use the `data` param in the notification event to open a new tab or focus an already opened one.
The code you already have is fine, now adding the listener looks like this:
```
// messaging.onBackgroundMessage(...);
function handleClic... | Notifications are working using [legacy API](https://firebase.google.com/docs/cloud-messaging/http-server-ref) but unfortunately clicking the notification still does nothing. This is my code for sending the notification.
```
var notification = {
'title': title,
'body': body,
'icon': 'hourglass.png',
'click_act... |
64,686,203 | I am having problems to implement notifications using firebase. The click event does not work. I am using the HTTP 1 version sending the bearer token.
```
{
"message": {
"token": "8888****usertoken****8888",
"notification": {
"title": "Background Message Title",
"body": "Background message body"
... | 2020/11/04 | [
"https://Stackoverflow.com/questions/64686203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14506769/"
] | Turns out I was passing an entire URL to webpush.fcm\_options.link = "https://google.com", all I had to do was to pass only the relative path like webpush.fcm\_options.link = "/mypage".
So the request to send would be like this:
```
{
"message": {
"token": "8888****usertoken****8888",
"notification": {
... | Notifications are working using [legacy API](https://firebase.google.com/docs/cloud-messaging/http-server-ref) but unfortunately clicking the notification still does nothing. This is my code for sending the notification.
```
var notification = {
'title': title,
'body': body,
'icon': 'hourglass.png',
'click_act... |
2,311,726 | I'm working on a project that have several webapps (WARs) built with Maven and deployed in a Java EE.
These WARs share several common business JARS (like one containing domain objects which are loaded from hibernate) and other framework JARs like Spring and Hibernate.
They use Spring MVC, and the Application Context... | 2010/02/22 | [
"https://Stackoverflow.com/questions/2311726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169397/"
] | Create a field somewhere, say `string filename`. Set it to `null` initially.
When a document is opened, store the file name in a `filename`.
When a document is saved through Save As, also store this file name in `filename`.
When Save is invoked, check the value of `filename`. If it is `null`, invoke Save As instead.... | The way this usually works is to keep track of the file name the user either opened or saved as.
Then, when they use the Save function, simply save to the file name that was previously specified. If no file has been specified, then show the Save As. |
2,311,726 | I'm working on a project that have several webapps (WARs) built with Maven and deployed in a Java EE.
These WARs share several common business JARS (like one containing domain objects which are loaded from hibernate) and other framework JARs like Spring and Hibernate.
They use Spring MVC, and the Application Context... | 2010/02/22 | [
"https://Stackoverflow.com/questions/2311726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169397/"
] | The way this usually works is to keep track of the file name the user either opened or saved as.
Then, when they use the Save function, simply save to the file name that was previously specified. If no file has been specified, then show the Save As. | Isn't "Save" simply the following (in pseudocode)?
```
Save() =
WriteTo(oldfilename)
SaveAs() =
stream = OpenDialog()
oldfilename = stream.filename
Save()
``` |
2,311,726 | I'm working on a project that have several webapps (WARs) built with Maven and deployed in a Java EE.
These WARs share several common business JARS (like one containing domain objects which are loaded from hibernate) and other framework JARs like Spring and Hibernate.
They use Spring MVC, and the Application Context... | 2010/02/22 | [
"https://Stackoverflow.com/questions/2311726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169397/"
] | Create a field somewhere, say `string filename`. Set it to `null` initially.
When a document is opened, store the file name in a `filename`.
When a document is saved through Save As, also store this file name in `filename`.
When Save is invoked, check the value of `filename`. If it is `null`, invoke Save As instead.... | Isn't "Save" simply the following (in pseudocode)?
```
Save() =
WriteTo(oldfilename)
SaveAs() =
stream = OpenDialog()
oldfilename = stream.filename
Save()
``` |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | This worked for me-
```
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm set strict-ssl=false
``` | My issue came down to a silly mistake on my part. As I had quickly one day dropped my proxies into a windows \*.bat file (http\_proxy, https\_proxy, and ftp\_proxy), I forgot to escape the special characters for the url-encoded domain\user (%5C) and password having the question mark '?' (%3F). That is to say, once you ... |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | This works for me in Windows:
```
npm config set proxy http://domain%5Cuser:pass@host:port
```
If you are not in any domain, use:
```
npm config set proxy http://user:pass@host:port
```
If your password contains special characters such as `"`,`@`,`:` and so on, replace them by their URL encoded values. For exampl... | This worked for me-
```
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm set strict-ssl=false
``` |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | This works for me in Windows:
```
npm config set proxy http://domain%5Cuser:pass@host:port
```
If you are not in any domain, use:
```
npm config set proxy http://user:pass@host:port
```
If your password contains special characters such as `"`,`@`,`:` and so on, replace them by their URL encoded values. For exampl... | I tried all of these options, but my proxy wasn't having any of it for some reason. Then, born out of desparation/despair, I randomly tried `curl` in my Git Bash shell, and it worked.
Unsetting all of the proxy options using
```
npm config rm proxy
npm config rm https-proxy
```
And then running `npm install` in my... |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | I solved this problem this way:
1. I run this command:
```none
npm config set strict-ssl false
```
2. Then set npm to run with http, instead of https:
```none
npm config set registry "http://registry.npmjs.org/"
```
3. Then I install packages using this syntax:
```none
npm --proxy http://username:password@cachead... | Go TO Environment Variables and Either Remove or set it to empty
**HTTP\_PROXY and HTTPS\_PROXY**
it will resolve proxy issue for corporate env too |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | I solved this problem this way:
1. I run this command:
```none
npm config set strict-ssl false
```
2. Then set npm to run with http, instead of https:
```none
npm config set registry "http://registry.npmjs.org/"
```
3. Then I install packages using this syntax:
```none
npm --proxy http://username:password@cachead... | This worked for me-
```
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm set strict-ssl=false
``` |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | This worked for me.
Set the http and https proxy.
* npm config set proxy <http://proxy.company.com:8080>
* npm config set https-proxy <http://proxy.company.com:8080> | A lot of applications (e.g. npm) can use proxy setting from user environment variables.
You can just add to your environment following variables **HTTP\_PROXY** and **HTTPS\_PROXY** that will have the same value for each one
<http://user:password@proxyAddress:proxyPort>
For example if you have Windows you can add p... |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | Setup `npm` proxy
For `HTTP`:
```none
npm config set proxy http://proxy_host:port
```
For `HTTPS`:
use the https proxy address if there is one
```
npm config set https-proxy https://proxy.company.com:8080
```
else reuse the http proxy address
```
npm config set https-proxy http://proxy.company.com:8080
```
*... | ```
npm config set proxy <http://...>:<port_number>
npm config set registry http://registry.npmjs.org/
```
This solved my problem. |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | When in doubt, try all these commands, as I do:
```none
npm config set registry http://registry.npmjs.org/
npm config set proxy http://myusername:mypassword@proxy.us.somecompany:8080
npm config set https-proxy http://myusername:mypassword@proxy.us.somecompany:8080
npm config set strict-ssl false
set HTTPS_PROXY=http:/... | In my case, I forgot to set the "http://" in my config files (can be found in C: \Users \ [USERNAME] \ .npmrc) proxy adresses. So instead of having
```
proxy=http://[IPADDRESS]:[PORTNUMBER]
https-proxy=http://[IPADDRESS]:[PORTNUMBER]
```
I had
```
proxy=[IPADDRESS]:[PORTNUMBER]
https-proxy=[IPADDRESS]:[PORTNUMBER]
... |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | This worked for me.
Set the http and https proxy.
* npm config set proxy <http://proxy.company.com:8080>
* npm config set https-proxy <http://proxy.company.com:8080> | when I give without http/http prefix in the proxy settings npm failed even when the proxy host and port were right values. It worked only after adding the protocol prefix. |
7,559,648 | Read about a proxy variable in a `.npmrc` file but it does not work. Trying to avoid manually downloading all require packages and installing. | 2011/09/26 | [
"https://Stackoverflow.com/questions/7559648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/762638/"
] | In my case, I forgot to set the "http://" in my config files (can be found in C: \Users \ [USERNAME] \ .npmrc) proxy adresses. So instead of having
```
proxy=http://[IPADDRESS]:[PORTNUMBER]
https-proxy=http://[IPADDRESS]:[PORTNUMBER]
```
I had
```
proxy=[IPADDRESS]:[PORTNUMBER]
https-proxy=[IPADDRESS]:[PORTNUMBER]
... | There has been many answers above for this question, but none of those worked for me. All of them mentioned to add `http://` prefix. So I added it too. All failed.
It finally works after I accidentally removed `http://` prefix. Final config is like this:
```
npm config set registry http://registry.npmjs.org/
npm conf... |
10,236,767 | In my app I need to allow users to do calculations such as add/subtract/divide values from rows in different tables. Is there a safer way to do this than using eval()? Is it better to take a string as an input and write my own functions to parse the string to do calculations? | 2012/04/19 | [
"https://Stackoverflow.com/questions/10236767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745666/"
] | just filter out the non digits and non operands
```
var1 = "4+4;haha i'm a nasty command"
var1.gsub!(/[^\d|\+-\/\*]/,"")
p eval(var1) => 8
``` | Yes. Same reason as why you should not use user input for SQL querys directly to avoid sql injection: In this case you should not do it to avoid code injection.ii |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | Use `zip()` to iterate over two lists simultaneously and `split` and `join` to the required format:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for x, y in zip(name_info, XY_coorinfo):
print(','.join(x.split('.')... | ```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for i,j in zip(name_info,XY_coorinfo):
io = (i[:i.index('.')],i[i.index('.')+1:]) if '.' in i else ('',i)
print(*io,*j.split(':'),sep=',')
"""
output
0... |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | Another approach to produce exactly your output:
```
name_info_split = [e.split('.') if (len(e.split('.')) == 2) else ['', e] for e in name_info]
XY_coorinfo_split = [e.split(':') for e in XY_coorinfo]
for i in range(len(name_info_split)):
print("{},{},{},{}".format(name_info_split[i][0], name_info_split[i][1], XY... | ```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for i,j in zip(name_info,XY_coorinfo):
io = (i[:i.index('.')],i[i.index('.')+1:]) if '.' in i else ('',i)
print(*io,*j.split(':'),sep=',')
"""
output
0... |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | A simple way to do this might be:
```
# split up the first list into elements
n = []
for i in name_info:
n.append(i.split('.'))
# split up the second list into elements
m = []
for j in XY_coordinfo:
m.append(j.split(':'))
# now create your final list
x = []
for k in range(len(n)) # here we assume they are the sa... | ```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for i,j in zip(name_info,XY_coorinfo):
io = (i[:i.index('.')],i[i.index('.')+1:]) if '.' in i else ('',i)
print(*io,*j.split(':'),sep=',')
"""
output
0... |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | Another approach to produce exactly your output:
```
name_info_split = [e.split('.') if (len(e.split('.')) == 2) else ['', e] for e in name_info]
XY_coorinfo_split = [e.split(':') for e in XY_coorinfo]
for i in range(len(name_info_split)):
print("{},{},{},{}".format(name_info_split[i][0], name_info_split[i][1], XY... | Use `zip()` to iterate over two lists simultaneously and `split` and `join` to the required format:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for x, y in zip(name_info, XY_coorinfo):
print(','.join(x.split('.')... |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | Use `zip()` to iterate over two lists simultaneously and `split` and `join` to the required format:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
for x, y in zip(name_info, XY_coorinfo):
print(','.join(x.split('.')... | A simple way to do this might be:
```
# split up the first list into elements
n = []
for i in name_info:
n.append(i.split('.'))
# split up the second list into elements
m = []
for j in XY_coordinfo:
m.append(j.split(':'))
# now create your final list
x = []
for k in range(len(n)) # here we assume they are the sa... |
56,137,419 | I have 2 lists:
```
name_info = ['0.abc','450.xyz','7.garfunkl','Coma','Cancer']
XY_coorinfo = ['1234:5678', '2345:6543','3245:1234', '4587:2346', '6785:23987']
```
Output I want :
```
0,abc,1234,5678
450,xyz,2345,6543
7,garfunkl,3245,1234
,Coma,4587,2346
,Cancer,6785,23987
```
I think I need list manipulation... | 2019/05/14 | [
"https://Stackoverflow.com/questions/56137419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1062968/"
] | Another approach to produce exactly your output:
```
name_info_split = [e.split('.') if (len(e.split('.')) == 2) else ['', e] for e in name_info]
XY_coorinfo_split = [e.split(':') for e in XY_coorinfo]
for i in range(len(name_info_split)):
print("{},{},{},{}".format(name_info_split[i][0], name_info_split[i][1], XY... | A simple way to do this might be:
```
# split up the first list into elements
n = []
for i in name_info:
n.append(i.split('.'))
# split up the second list into elements
m = []
for j in XY_coordinfo:
m.append(j.split(':'))
# now create your final list
x = []
for k in range(len(n)) # here we assume they are the sa... |
57,955,646 | How can I write numbers in a cell inside Bootstrap table in accounting format?
For example: one million should be shown as 1,000,000 and not 1000000 (notice commas ',' between digits).
Please note that data data is getting filled by Django app.
Example:
```
<tbody>
{% for row in tbl_list %}
<tr id="port_... | 2019/09/16 | [
"https://Stackoverflow.com/questions/57955646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7707677/"
] | <https://developers.facebook.com/docs/sharing/webmasters/#images> says,
>
> og:image:type - MIME type of the image. **One of image/jpeg, image/gif or image/png**
>
>
>
Now `og:image:type` does not need to be explicitly specified; but since the restriction to those MIME / file types is mentioned for that property,... | >
> Twitter and Facebook now supports WebP in og:meta.
>
>
>
It is not in the OpenGraph specifications - but only in the Twitter version of it `twitter:image`. Since Facebook uses `og:image`, there is probably no support for `WebP` yet.
>
> Hi, a comment without a source is not helping the community. – djibe Mar... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | >
> My question is: would my connection be significantly faster if I moved
> the modem and used a short, high-quality phone cable between the modem
> and the wall?
>
>
>
It's not easy to answer. Yes, probably. Note that your question uses the words "*significantly faster*". This is what I cannot tell you. This c... | Considering you have several hundred metres (or maybe several Km) of phone wiring + joints & cabinets between your socket and the local exchange/CO, a few more metres is not generally going to make a significant difference.
That said, some extension leads and reels use very poor quality cable that can really mess up ... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | >
> My question is: would my connection be significantly faster if I moved
> the modem and used a short, high-quality phone cable between the modem
> and the wall?
>
>
>
It's not easy to answer. Yes, probably. Note that your question uses the words "*significantly faster*". This is what I cannot tell you. This c... | This depends greatly on your DSL speed. ADSL and ADSL2+ are very sensitive to distance. While increasing your distance may not affect your speed per say, it can affect the modem's ability to sync properly with the DSLAM and can cause a lower sync rate, line, CV or HEC errors (either causing slower speeds or a bouncing ... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | >
> My question is: would my connection be significantly faster if I moved
> the modem and used a short, high-quality phone cable between the modem
> and the wall?
>
>
>
It's not easy to answer. Yes, probably. Note that your question uses the words "*significantly faster*". This is what I cannot tell you. This c... | I just had very slow ADSL2+ internet speed after moving my modem using a 5m telephone cable.
I did what some 'experts' suggested and used 2 different brand new top quality cables, but the speed was at least 5 times slower.
I ended up using a 1m telephone cable to the modem and got a longer Ethernet cable and it is no... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | Considering you have several hundred metres (or maybe several Km) of phone wiring + joints & cabinets between your socket and the local exchange/CO, a few more metres is not generally going to make a significant difference.
That said, some extension leads and reels use very poor quality cable that can really mess up ... | This depends greatly on your DSL speed. ADSL and ADSL2+ are very sensitive to distance. While increasing your distance may not affect your speed per say, it can affect the modem's ability to sync properly with the DSLAM and can cause a lower sync rate, line, CV or HEC errors (either causing slower speeds or a bouncing ... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | Considering you have several hundred metres (or maybe several Km) of phone wiring + joints & cabinets between your socket and the local exchange/CO, a few more metres is not generally going to make a significant difference.
That said, some extension leads and reels use very poor quality cable that can really mess up ... | I just had very slow ADSL2+ internet speed after moving my modem using a 5m telephone cable.
I did what some 'experts' suggested and used 2 different brand new top quality cables, but the speed was at least 5 times slower.
I ended up using a 1m telephone cable to the modem and got a longer Ethernet cable and it is no... |
312,276 | I have an inconveniently-placed phone jack in my office, so I am running a 10m phone cable from the wall jack to the modem, which is on my desk.
Consequently, I have a very short ethernet cable between the modem and the computer. I know that **within reason, the length of the ethernet cable does not make a difference*... | 2011/07/19 | [
"https://superuser.com/questions/312276",
"https://superuser.com",
"https://superuser.com/users/16581/"
] | I just had very slow ADSL2+ internet speed after moving my modem using a 5m telephone cable.
I did what some 'experts' suggested and used 2 different brand new top quality cables, but the speed was at least 5 times slower.
I ended up using a 1m telephone cable to the modem and got a longer Ethernet cable and it is no... | This depends greatly on your DSL speed. ADSL and ADSL2+ are very sensitive to distance. While increasing your distance may not affect your speed per say, it can affect the modem's ability to sync properly with the DSLAM and can cause a lower sync rate, line, CV or HEC errors (either causing slower speeds or a bouncing ... |
19,253,088 | Update:
-------
For anyone who happens upon this question: This issue seems to have been resolved in a subsequent update to Bootstrap. You can now download a custom Bootstrap 3 build, specifying the number of desired columns with the `@grid-columns` setting.
<http://getbootstrap.com/customize/>
Original Question:
--... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19253088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2638654/"
] | The customizer for Twitter's Bootstrap 3.0.0 don't have a option the set the number of grid columns. It will be planned for the next release 3.0.1, see: <https://github.com/twbs/bootstrap/issues/10985>
Also when you download the latest version from github.com/twbs/bootstrap/archive/master.zip and compile your own vers... | You can also check out <http://tmaiaroto.github.io/gridline/>
... I write more details about why you would want to use it in my blog post, <http://www.shift8creative.com/posts/view/flexible-twitter-bootstrap-grid> in case you were curious.
To put it short and sweet...You don't want to alter Twitter Bootstrap because... |
19,253,088 | Update:
-------
For anyone who happens upon this question: This issue seems to have been resolved in a subsequent update to Bootstrap. You can now download a custom Bootstrap 3 build, specifying the number of desired columns with the `@grid-columns` setting.
<http://getbootstrap.com/customize/>
Original Question:
--... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19253088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2638654/"
] | The customizer for Twitter's Bootstrap 3.0.0 don't have a option the set the number of grid columns. It will be planned for the next release 3.0.1, see: <https://github.com/twbs/bootstrap/issues/10985>
Also when you download the latest version from github.com/twbs/bootstrap/archive/master.zip and compile your own vers... | Late but I built out a solution to this using LESS that doesn't require modification of Bootstrap.
<https://github.com/drew-r/bootstrap-n-column> |
19,253,088 | Update:
-------
For anyone who happens upon this question: This issue seems to have been resolved in a subsequent update to Bootstrap. You can now download a custom Bootstrap 3 build, specifying the number of desired columns with the `@grid-columns` setting.
<http://getbootstrap.com/customize/>
Original Question:
--... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19253088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2638654/"
] | The customizer for Twitter's Bootstrap 3.0.0 don't have a option the set the number of grid columns. It will be planned for the next release 3.0.1, see: <https://github.com/twbs/bootstrap/issues/10985>
Also when you download the latest version from github.com/twbs/bootstrap/archive/master.zip and compile your own vers... | This will set 24 columns if you're compiling the bootstrap LESS yourself. Remember that the `@grid-gutter-width` has to be in `px`, `em` units won't work.
`@grid-gutter-width: 14px;`
`@grid-columns: 24;` |
19,253,088 | Update:
-------
For anyone who happens upon this question: This issue seems to have been resolved in a subsequent update to Bootstrap. You can now download a custom Bootstrap 3 build, specifying the number of desired columns with the `@grid-columns` setting.
<http://getbootstrap.com/customize/>
Original Question:
--... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19253088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2638654/"
] | This will set 24 columns if you're compiling the bootstrap LESS yourself. Remember that the `@grid-gutter-width` has to be in `px`, `em` units won't work.
`@grid-gutter-width: 14px;`
`@grid-columns: 24;` | You can also check out <http://tmaiaroto.github.io/gridline/>
... I write more details about why you would want to use it in my blog post, <http://www.shift8creative.com/posts/view/flexible-twitter-bootstrap-grid> in case you were curious.
To put it short and sweet...You don't want to alter Twitter Bootstrap because... |
19,253,088 | Update:
-------
For anyone who happens upon this question: This issue seems to have been resolved in a subsequent update to Bootstrap. You can now download a custom Bootstrap 3 build, specifying the number of desired columns with the `@grid-columns` setting.
<http://getbootstrap.com/customize/>
Original Question:
--... | 2013/10/08 | [
"https://Stackoverflow.com/questions/19253088",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2638654/"
] | This will set 24 columns if you're compiling the bootstrap LESS yourself. Remember that the `@grid-gutter-width` has to be in `px`, `em` units won't work.
`@grid-gutter-width: 14px;`
`@grid-columns: 24;` | Late but I built out a solution to this using LESS that doesn't require modification of Bootstrap.
<https://github.com/drew-r/bootstrap-n-column> |
52,880,735 | aws ssm start-session returns url and token to open WebSocket Connection. <https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax>
Tried a client to open WebSocket connection:
<https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocke... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52880735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1112512/"
] | Few errors.
This would always insert 0 at rand[i] because you are casting Math.random() to int which will always become zero.
```
rand[i] = (int)(Math.random());
```
Change it to sth like this. I have written 10 but you can write any number to define the range.
```
rand[i] = (int)(Math.random()*10);
```
This... | You can try Java 8's Stream, which turns the whole logic to one line `return Arrays.stream(a).filter(n -> n!= 0).toArray();` |
52,880,735 | aws ssm start-session returns url and token to open WebSocket Connection. <https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax>
Tried a client to open WebSocket connection:
<https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocke... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52880735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1112512/"
] | Few errors.
This would always insert 0 at rand[i] because you are casting Math.random() to int which will always become zero.
```
rand[i] = (int)(Math.random());
```
Change it to sth like this. I have written 10 but you can write any number to define the range.
```
rand[i] = (int)(Math.random()*10);
```
This... | The compile time error is due to the fact that, in the main method you have created the array named `rand` and passing the array named `a`. from the main method call `System.out.print(array(rand))` |
52,880,735 | aws ssm start-session returns url and token to open WebSocket Connection. <https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax>
Tried a client to open WebSocket connection:
<https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocke... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52880735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1112512/"
] | Few errors.
This would always insert 0 at rand[i] because you are casting Math.random() to int which will always become zero.
```
rand[i] = (int)(Math.random());
```
Change it to sth like this. I have written 10 but you can write any number to define the range.
```
rand[i] = (int)(Math.random()*10);
```
This... | Little fixed your code:
```
import java.util.Random; // Import Random
public class DeleteZero {
public static int[] array(int[] a) {
int k = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] !=0)
k++;
}
int[] b = new int[k];
int t = 0;
for... |
52,880,735 | aws ssm start-session returns url and token to open WebSocket Connection. <https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax>
Tried a client to open WebSocket connection:
<https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocke... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52880735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1112512/"
] | The compile time error is due to the fact that, in the main method you have created the array named `rand` and passing the array named `a`. from the main method call `System.out.print(array(rand))` | You can try Java 8's Stream, which turns the whole logic to one line `return Arrays.stream(a).filter(n -> n!= 0).toArray();` |
52,880,735 | aws ssm start-session returns url and token to open WebSocket Connection. <https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_StartSession.html#API_StartSession_ResponseSyntax>
Tried a client to open WebSocket connection:
<https://hashrocket.com/blog/posts/development-of-a-simple-command-line-websocke... | 2018/10/18 | [
"https://Stackoverflow.com/questions/52880735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1112512/"
] | The compile time error is due to the fact that, in the main method you have created the array named `rand` and passing the array named `a`. from the main method call `System.out.print(array(rand))` | Little fixed your code:
```
import java.util.Random; // Import Random
public class DeleteZero {
public static int[] array(int[] a) {
int k = 0;
for (int i = 0; i < a.length; i++) {
if (a[i] !=0)
k++;
}
int[] b = new int[k];
int t = 0;
for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.