qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | In MVC there are no longer Code-Behind classes. What you want is a Partial.
You'd use it like so:
```
<% Html.RenderPartial("MainMenu.ascx", ViewData["Menu"]); %>
```
If this Menu is going to be in all of your pages you can make your controllers subclass a custom controller class that always fills the Menu data fir... | Your master page is now a View, and Views should be passive. In other words, they shouldn't go look up things themselves.
It would be a much more correct approach (within the context of ASP.NET MVC) to pull the required data from the Model.
Take a look at [this SO question](https://stackoverflow.com/questions/1320516... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | You can still have code behind if you want. In your .master file put:
```
<%@ Master Language="C#" AutoEventWireup="true"
Inherits="Site_Master" CodeFile="Site.Master.cs" %>
```
Then in your .master.cs:
```
public partial class Site_Master : ViewMasterPage
{
protected void Page_Load(object sender, EventArgs e)... | Your master page is now a View, and Views should be passive. In other words, they shouldn't go look up things themselves.
It would be a much more correct approach (within the context of ASP.NET MVC) to pull the required data from the Model.
Take a look at [this SO question](https://stackoverflow.com/questions/1320516... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | Your master page is now a View, and Views should be passive. In other words, they shouldn't go look up things themselves.
It would be a much more correct approach (within the context of ASP.NET MVC) to pull the required data from the Model.
Take a look at [this SO question](https://stackoverflow.com/questions/1320516... | Personally, I prefer using strongly typed views and ViewModels. If your master page requires data, then create a ViewModel for it. Ensure that every page's ViewModel inherits from this base ViewModel. Similarly, create a base controller that every other controller inherits from. Using Action Filters will allow you to e... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | In MVC there are no longer Code-Behind classes. What you want is a Partial.
You'd use it like so:
```
<% Html.RenderPartial("MainMenu.ascx", ViewData["Menu"]); %>
```
If this Menu is going to be in all of your pages you can make your controllers subclass a custom controller class that always fills the Menu data fir... | There is a great tutorial on the [ASP.NET site](http://www.asp.net/learn/mvc/tutorial-13-cs.aspx) that shows how to do exactly this.
Briefly, you pass the data to the master page through the ViewData collection. To get the data into ViewData, create an application level controller. Have the page controllers inherit fr... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | In MVC there are no longer Code-Behind classes. What you want is a Partial.
You'd use it like so:
```
<% Html.RenderPartial("MainMenu.ascx", ViewData["Menu"]); %>
```
If this Menu is going to be in all of your pages you can make your controllers subclass a custom controller class that always fills the Menu data fir... | Personally, I prefer using strongly typed views and ViewModels. If your master page requires data, then create a ViewModel for it. Ensure that every page's ViewModel inherits from this base ViewModel. Similarly, create a base controller that every other controller inherits from. Using Action Filters will allow you to e... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | You can still have code behind if you want. In your .master file put:
```
<%@ Master Language="C#" AutoEventWireup="true"
Inherits="Site_Master" CodeFile="Site.Master.cs" %>
```
Then in your .master.cs:
```
public partial class Site_Master : ViewMasterPage
{
protected void Page_Load(object sender, EventArgs e)... | There is a great tutorial on the [ASP.NET site](http://www.asp.net/learn/mvc/tutorial-13-cs.aspx) that shows how to do exactly this.
Briefly, you pass the data to the master page through the ViewData collection. To get the data into ViewData, create an application level controller. Have the page controllers inherit fr... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | There is a great tutorial on the [ASP.NET site](http://www.asp.net/learn/mvc/tutorial-13-cs.aspx) that shows how to do exactly this.
Briefly, you pass the data to the master page through the ViewData collection. To get the data into ViewData, create an application level controller. Have the page controllers inherit fr... | Personally, I prefer using strongly typed views and ViewModels. If your master page requires data, then create a ViewModel for it. Ensure that every page's ViewModel inherits from this base ViewModel. Similarly, create a base controller that every other controller inherits from. Using Action Filters will allow you to e... |
1,699,836 | I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.
I can... | 2009/11/09 | [
"https://Stackoverflow.com/questions/1699836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44973/"
] | You can still have code behind if you want. In your .master file put:
```
<%@ Master Language="C#" AutoEventWireup="true"
Inherits="Site_Master" CodeFile="Site.Master.cs" %>
```
Then in your .master.cs:
```
public partial class Site_Master : ViewMasterPage
{
protected void Page_Load(object sender, EventArgs e)... | Personally, I prefer using strongly typed views and ViewModels. If your master page requires data, then create a ViewModel for it. Ensure that every page's ViewModel inherits from this base ViewModel. Similarly, create a base controller that every other controller inherits from. Using Action Filters will allow you to e... |
277,955 | I have 10 servers running on Ubuntu 14.04 x64. Each server has a few Nvidia GPUs. I am looking for a monitoring program that would allow me to view the GPU usage on all servers at a glance. | 2016/04/20 | [
"https://unix.stackexchange.com/questions/277955",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/16704/"
] | [munin](http://munin-monitoring.org/) has at least one [plugin](http://munin-monitoring.org/browser/munin-contrib/plugins/gpu/nvidia_gpu_) for monitoring nvidia GPUs (which uses the `nvidia-smi` utility to gather its data).
You could setup a `munin` server (perhaps on one of the GPU servers, or on the head node of you... | As cas [said](https://unix.stackexchange.com/a/278078/16704), I could write my own tool, so here it is (not polished at all, but it works.):
Client side (i.e., the GPU node)
--------------------------------
`gpu_monitoring.sh` (assumes that the IP of the server that serves the monitoring webpage is `128.52.200.39`)
... |
277,955 | I have 10 servers running on Ubuntu 14.04 x64. Each server has a few Nvidia GPUs. I am looking for a monitoring program that would allow me to view the GPU usage on all servers at a glance. | 2016/04/20 | [
"https://unix.stackexchange.com/questions/277955",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/16704/"
] | [munin](http://munin-monitoring.org/) has at least one [plugin](http://munin-monitoring.org/browser/munin-contrib/plugins/gpu/nvidia_gpu_) for monitoring nvidia GPUs (which uses the `nvidia-smi` utility to gather its data).
You could setup a `munin` server (perhaps on one of the GPU servers, or on the head node of you... | Or simply use
<https://github.com/PatWie/cluster-smi>
which acts exactly in the same way as `nvidia-smi` in the terminal but gathers all information of nodes across your cluster, which are running the `cluster-smi-node`. The output will be
```
+---------+------------------------+---------------------+----------+----... |
277,955 | I have 10 servers running on Ubuntu 14.04 x64. Each server has a few Nvidia GPUs. I am looking for a monitoring program that would allow me to view the GPU usage on all servers at a glance. | 2016/04/20 | [
"https://unix.stackexchange.com/questions/277955",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/16704/"
] | You can use the [ganglia](https://en.wikipedia.org/wiki/Ganglia_(software)) monitoring software (free of charge, open source). It has number of [user-contributed Gmond Python DSO metric modules](https://github.com/ganglia/gmond_python_modules), including a GPU Nvidia module ([`/ganglia/gmond_python_modules/gpu/nvidia/`... | As cas [said](https://unix.stackexchange.com/a/278078/16704), I could write my own tool, so here it is (not polished at all, but it works.):
Client side (i.e., the GPU node)
--------------------------------
`gpu_monitoring.sh` (assumes that the IP of the server that serves the monitoring webpage is `128.52.200.39`)
... |
277,955 | I have 10 servers running on Ubuntu 14.04 x64. Each server has a few Nvidia GPUs. I am looking for a monitoring program that would allow me to view the GPU usage on all servers at a glance. | 2016/04/20 | [
"https://unix.stackexchange.com/questions/277955",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/16704/"
] | You can use the [ganglia](https://en.wikipedia.org/wiki/Ganglia_(software)) monitoring software (free of charge, open source). It has number of [user-contributed Gmond Python DSO metric modules](https://github.com/ganglia/gmond_python_modules), including a GPU Nvidia module ([`/ganglia/gmond_python_modules/gpu/nvidia/`... | Or simply use
<https://github.com/PatWie/cluster-smi>
which acts exactly in the same way as `nvidia-smi` in the terminal but gathers all information of nodes across your cluster, which are running the `cluster-smi-node`. The output will be
```
+---------+------------------------+---------------------+----------+----... |
28,185,048 | I've read several guides on how to use GTK+ for a GUI in C programs and I came across [this tutorial](https://wiki.gnome.org/Projects/GTK+/OSX/Building) for getting GTK+ on my system. Here's everything I ran, line by line:
```
chmod +x gtk-osx-build-setup.sh
./gtk-osx-build-setup.sh
cd ~/.local/bin
./jhbuild build pyt... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28185048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1541563/"
] | My recommendation is to extract the meaningful portions of each handler into methods that can be called independently and can have useful return values. This is particularly important for your second button's handler, since the handler for button1 also depends on it.
Upon extracting the code, you can transform the ex... | I think, you want something like this
```
private void button1_click(object sender, EventArgs e)
{
//Do first stuffs
button2_click(sender, e);
//Reading the tag value of sender object that is assigned in that case
if (!(bool)(sender as Button).Tag)
return;
//Do second stuffs
}
private vo... |
28,185,048 | I've read several guides on how to use GTK+ for a GUI in C programs and I came across [this tutorial](https://wiki.gnome.org/Projects/GTK+/OSX/Building) for getting GTK+ on my system. Here's everything I ran, line by line:
```
chmod +x gtk-osx-build-setup.sh
./gtk-osx-build-setup.sh
cd ~/.local/bin
./jhbuild build pyt... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28185048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1541563/"
] | My recommendation is to extract the meaningful portions of each handler into methods that can be called independently and can have useful return values. This is particularly important for your second button's handler, since the handler for button1 also depends on it.
Upon extracting the code, you can transform the ex... | You can use [CancelEventArgs Class](https://msdn.microsoft.com/en-us/library/system.componentmodel.canceleventargs%28v=vs.110%29.aspx) like this:
```
private void button1_click(object sender, EventArgs e)
{
//Do first stuffs
var e1 = new CancelEventArgs();
button2_click(sender, e1);
if(e1.Cancel)
... |
33,818 | I recently bought a Sandisk Cruzer USB drive. Part of the drive (6.66 MB) is formatted with CDFS and shows as a CD drive.
Why do they do this ? Is it to protect the software on that part of the disk to trick the OS (Vista) into not overwriting or amending, because it thinks this is a read-only CD ?
Is the 6.66 MB sig... | 2009/09/01 | [
"https://superuser.com/questions/33818",
"https://superuser.com",
"https://superuser.com/users/7891/"
] | This is part of the U3 software that comes on it. It is garbage and I always remove it, the link for the removal tool is here:<http://u3.com/support/default.aspx#CQ3>
Keep in mind, this will format your drive. | Most likely the reason they did this was to prevent overwriting their software from the flash drive.
If desired, you should be able to change the partition scheme to fully utilize the drive. The easiest way to do this is to boot into [a Linux LiveCD](http://www.ubuntu.com/) and use [gParted](http://www.wikihow.com/Us... |
33,818 | I recently bought a Sandisk Cruzer USB drive. Part of the drive (6.66 MB) is formatted with CDFS and shows as a CD drive.
Why do they do this ? Is it to protect the software on that part of the disk to trick the OS (Vista) into not overwriting or amending, because it thinks this is a read-only CD ?
Is the 6.66 MB sig... | 2009/09/01 | [
"https://superuser.com/questions/33818",
"https://superuser.com",
"https://superuser.com/users/7891/"
] | This is part of the U3 software that comes on it. It is garbage and I always remove it, the link for the removal tool is here:<http://u3.com/support/default.aspx#CQ3>
Keep in mind, this will format your drive. | Does the pseudo-CD have an autorun.inf file on it?
This is sometimes done to take advantage of the CD autorun feature. When one of these devices is plugged into a computer that has autorun enabled, a program on the drive will start automatically. This is typically a small pop-up menu that allows the user to run, insta... |
59,994,928 | We are using the excellent Tabulator JS library. We poll our server at intervals to refresh the data in our table. We are trying to achieve the following behaviour when this happens.
1. Update the existing data in the table
2. Add any new rows that "Match" the current filters
3. Remove any rows that have changed and d... | 2020/01/30 | [
"https://Stackoverflow.com/questions/59994928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2141347/"
] | The latest version of Tabulator, 4.9, adds a [refreshFilter](http://tabulator.info/docs/4.9/filter#manage) function. This should accomplish most of your request.
My own testing also show that the sorters are also refreshed by this function.
`table.refreshFilter();` | You can either call manually [Redraw](http://tabulator.info/docs/4.5/layout#redraw)
```
table.redraw(true); //trigger full rerender including all data and rows
```
or just use [reactive data](http://tabulator.info/docs/4.5/reactivity#reactive-data)
```
reactiveData:true, //enable reactive data
data:tableData, //ass... |
59,994,928 | We are using the excellent Tabulator JS library. We poll our server at intervals to refresh the data in our table. We are trying to achieve the following behaviour when this happens.
1. Update the existing data in the table
2. Add any new rows that "Match" the current filters
3. Remove any rows that have changed and d... | 2020/01/30 | [
"https://Stackoverflow.com/questions/59994928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2141347/"
] | The latest version of Tabulator, 4.9, adds a [refreshFilter](http://tabulator.info/docs/4.9/filter#manage) function. This should accomplish most of your request.
My own testing also show that the sorters are also refreshed by this function.
`table.refreshFilter();` | After much searching and looking through Tabulator 4.5 docs it seems that the table can not update existing data, re-apply filters, remove dead rows (those not in the new data from the server) from one of the update, replace methods. From what I can understand this can be achieved by the code I have written below, whic... |
59,994,928 | We are using the excellent Tabulator JS library. We poll our server at intervals to refresh the data in our table. We are trying to achieve the following behaviour when this happens.
1. Update the existing data in the table
2. Add any new rows that "Match" the current filters
3. Remove any rows that have changed and d... | 2020/01/30 | [
"https://Stackoverflow.com/questions/59994928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2141347/"
] | The latest version of Tabulator, 4.9, adds a [refreshFilter](http://tabulator.info/docs/4.9/filter#manage) function. This should accomplish most of your request.
My own testing also show that the sorters are also refreshed by this function.
`table.refreshFilter();` | if I understand your OP, this is what you were looking for ?
```
var selected,visible;
var t = new Tabulator("#tabulator", {
data:[
{id:1,title:'One'},{id:2,title:'Two'},{id:3,title:'Three'},{id:4,title:'Four'},{id:5,title:'Five'},
{id:11,title:'Eleven'},{id:12,title:'Twelve'},{id:13,title:'Thirtee... |
7,037,273 | I looking for way to animate text with jQuery.
I want to display 'logging in...' message where 3 dots should be hidden on page load and after every lets say 300ms 1 dot to become visible. Which all together should create animation.
Is there any jQuery function created to do exact that or I will have to right my own?
... | 2011/08/12 | [
"https://Stackoverflow.com/questions/7037273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616643/"
] | This can be done rather nicely with a jQuery plugin. This makes it re-usable and configurable.
Something like this is simple enough. It has 3 defaults, which can be overriden
* **text** defaulted to "Loading"
* **numDots** the number of dots to count up to before recycling back to zero, defaults to 3
* **delay** the ... | <http://api.jquery.com/fadeOut/>
<http://api.jquery.com/fadeIn/>
Use with :
```
$(document).ready( function() {
//fadeIn your text, fake function for example
FadeInMyText();
setTimeout(function() {
// fadeOut your text, fake function for example
FadeOutM... |
7,037,273 | I looking for way to animate text with jQuery.
I want to display 'logging in...' message where 3 dots should be hidden on page load and after every lets say 300ms 1 dot to become visible. Which all together should create animation.
Is there any jQuery function created to do exact that or I will have to right my own?
... | 2011/08/12 | [
"https://Stackoverflow.com/questions/7037273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616643/"
] | This can be done rather nicely with a jQuery plugin. This makes it re-usable and configurable.
Something like this is simple enough. It has 3 defaults, which can be overriden
* **text** defaulted to "Loading"
* **numDots** the number of dots to count up to before recycling back to zero, defaults to 3
* **delay** the ... | In jQuery there is the delay(milliseconds, callback) function. You could use the callback function to orchestrate the delay. However for your purposes the [javascript window setTimeout](https://developer.mozilla.org/en/window.setTimeout) would probably be more appropriate as you can run window.clearTimeout as soon as y... |
7,037,273 | I looking for way to animate text with jQuery.
I want to display 'logging in...' message where 3 dots should be hidden on page load and after every lets say 300ms 1 dot to become visible. Which all together should create animation.
Is there any jQuery function created to do exact that or I will have to right my own?
... | 2011/08/12 | [
"https://Stackoverflow.com/questions/7037273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616643/"
] | This can be done rather nicely with a jQuery plugin. This makes it re-usable and configurable.
Something like this is simple enough. It has 3 defaults, which can be overriden
* **text** defaulted to "Loading"
* **numDots** the number of dots to count up to before recycling back to zero, defaults to 3
* **delay** the ... | ```
<script type="text/javascript" language="javascript">
$(function(){launchAnimation('#animate');});
function launchAnimation(container){
var cont = $(container);
var i=0;
setInterval(function(){
++i;
if (i<4){
var dot=jQuery("<span class='dot'>.</span>").appendTo(cont);
... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Sibling marriage, and later, "near kin" marriage, was the only initial option; the limited selection repeated with Noah's 3 sons and their wives following the great flood. Just 340 year later Abram, was 10 when his half-sister Sarai was born. During this time period sibling and "near kin" marriage was less common, but ... | Abraham married his wife before his calling from God and before the 10 commandments. Every wrong action after the 10 commandments is a sin. |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | During Abraham's time the law hadn't been written against a man taking his father's daughter as his wife. After the law was written in:
>
> **[Deuteronomy 27:22](http://www.biblegateway.com/passage/?search=Deuteronomy%2027:22&version=NKJV)** (NKJV)
>
> 22 ‘Cursed *is* the one who lies with his sister, the daughter... | In Genesis 11:31 the KJV reads "And Terah took Abram his son, and Lot the son of Haran his son's son, and Sarai his daughter in law, his son Abram's wife; and they went forth with them from Ur of the Chaldees, to go into the land of Canaan; and they came unto Haran, and dwelt there."
Why would it say "Sarai his daught... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Abraham just lacked faith at that time and was telling lies. He did not trust God to protect him, so he used his wife and her beauty instead – that's why God kept revealing and exposing him where ever he went. | Abraham married his wife before his calling from God and before the 10 commandments. Every wrong action after the 10 commandments is a sin. |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Like my answer [here](https://christianity.stackexchange.com/questions/5049/did-adam-and-eves-progeny-commit-incest), you need to keep the chronology right. There is no levitical law at the time of Abraham.
Thus, even if he did marry his sister, remember that he was breaking no covenantal restriction on doing so. As I... | During Abraham's time the law hadn't been written against a man taking his father's daughter as his wife. After the law was written in:
>
> **[Deuteronomy 27:22](http://www.biblegateway.com/passage/?search=Deuteronomy%2027:22&version=NKJV)** (NKJV)
>
> 22 ‘Cursed *is* the one who lies with his sister, the daughter... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Marrying a close relative was not forbidden at that time. The old question of "Where did Cain get his wife?" is answered by saying that he married a sister of his. It was not immoral at that time, since there was no law forbidding it.
Leviticus is where we find such laws, which was written over 400 years after the tim... | In Ancient times, the word for "sister" also means "cousin" in Semitic languages. Aramaic word "Khtha" can mean sister or cousin. I believe the intended meaning here was Cousin.
Genesis 11:26-27 (NIV) - "After Terah had lived 70 years, he became the father of **Abram, Nahor and Haran**. This is the account of Terah’s... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | During Abraham's time the law hadn't been written against a man taking his father's daughter as his wife. After the law was written in:
>
> **[Deuteronomy 27:22](http://www.biblegateway.com/passage/?search=Deuteronomy%2027:22&version=NKJV)** (NKJV)
>
> 22 ‘Cursed *is* the one who lies with his sister, the daughter... | "If Sarai (later Sarah) was the daughter of Terah, then Sarai would have been listed along with Abram, Nahor, and Haran.
So we can confirm that the intended meaning was cousin."
Hmm, but in Genesis 20 Abraham says ...
Abraham replied, “I said to myself, ‘There is surely no fear of God in this place, and they will ki... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Like my answer [here](https://christianity.stackexchange.com/questions/5049/did-adam-and-eves-progeny-commit-incest), you need to keep the chronology right. There is no levitical law at the time of Abraham.
Thus, even if he did marry his sister, remember that he was breaking no covenantal restriction on doing so. As I... | "If Sarai (later Sarah) was the daughter of Terah, then Sarai would have been listed along with Abram, Nahor, and Haran.
So we can confirm that the intended meaning was cousin."
Hmm, but in Genesis 20 Abraham says ...
Abraham replied, “I said to myself, ‘There is surely no fear of God in this place, and they will ki... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Marrying a close relative was not forbidden at that time. The old question of "Where did Cain get his wife?" is answered by saying that he married a sister of his. It was not immoral at that time, since there was no law forbidding it.
Leviticus is where we find such laws, which was written over 400 years after the tim... | In Genesis 11:31 the KJV reads "And Terah took Abram his son, and Lot the son of Haran his son's son, and Sarai his daughter in law, his son Abram's wife; and they went forth with them from Ur of the Chaldees, to go into the land of Canaan; and they came unto Haran, and dwelt there."
Why would it say "Sarai his daught... |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | During Abraham's time the law hadn't been written against a man taking his father's daughter as his wife. After the law was written in:
>
> **[Deuteronomy 27:22](http://www.biblegateway.com/passage/?search=Deuteronomy%2027:22&version=NKJV)** (NKJV)
>
> 22 ‘Cursed *is* the one who lies with his sister, the daughter... | Abraham married his wife before his calling from God and before the 10 commandments. Every wrong action after the 10 commandments is a sin. |
5,389 | In the comments to [this answer](https://christianity.stackexchange.com/a/5258/85) to [the question of why Abraham lied to Pharaoh about his relationship with Sarah](https://christianity.stackexchange.com/questions/3524/why-did-abraham-lie-to-pharaoh-about-sarah-being-his-sister-in-gen-12/5258#5258), the following ques... | 2012/01/13 | [
"https://christianity.stackexchange.com/questions/5389",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/85/"
] | Marrying a close relative was not forbidden at that time. The old question of "Where did Cain get his wife?" is answered by saying that he married a sister of his. It was not immoral at that time, since there was no law forbidding it.
Leviticus is where we find such laws, which was written over 400 years after the tim... | "If Sarai (later Sarah) was the daughter of Terah, then Sarai would have been listed along with Abram, Nahor, and Haran.
So we can confirm that the intended meaning was cousin."
Hmm, but in Genesis 20 Abraham says ...
Abraham replied, “I said to myself, ‘There is surely no fear of God in this place, and they will ki... |
719,342 | I have no idea how to solve these two, any help?
$\mathtt{i)}$ $$\frac{1}{2\pi i}\int\_{a-i\infty}^{a+i\infty}\frac{e^{tz}}{\sqrt{z+1}}dz$$ $$ a,t\gt0$$
$\mathtt{ii)}$
$$ \sum\_{n=1}^\infty \frac{\coth (n\pi)}{n^3}=\frac{7\pi^3}{180}$$ | 2014/03/20 | [
"https://math.stackexchange.com/questions/719342",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/135386/"
] | I'll do (i). Consider the contour integral
$$\oint\_C dz \frac{e^{t z}}{\sqrt{z+1}}$$
where $C$ is the contour consisting of the line $\Re{z}=a$, $\Im{z} \in [-R,R]$; a circular arc of radius $R$ from $a+i R$ to $R e^{i \pi}$; a line from $R e^{i \pi}$ to $((1+\epsilon) e^{i \pi}$; a circle arc about $z=-1$ of radius... | For the second problem, let $ \displaystyle f(z) = \frac{\pi\cot (\pi z) \coth(\pi z)}{z^{3}}$ and integrate around a square ($C\_{N}$) with vertices at $\pm (N+\frac{1}{2}) \pm (N+\frac{1}{2})$ where $N$ is a positive integer.
Both $\cot (\pi z)$ and $\coth(\pi z)$ are uniformly bounded on the contour.
So $ \display... |
15,007,104 | I have a script I'm writing that makes a connection to a SOAP service. After the connection is made, I need to pass in a the username/pass with every command I send. The problem I have is that when I use read-host to do this, my password is shown in cleartext and remains in the shell:
```
PS C:\Users\Egr> Read-Host "E... | 2013/02/21 | [
"https://Stackoverflow.com/questions/15007104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/776890/"
] | $Password is a Securestring, and this will return the plain text password.
```
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password))
``` | You can save the password(input) as a variable and pass it to your service. If the code is run in a script or as a function, the variable containing the password will be deleted after it's done(they are stored in a temp. local scope). If you run the commands in the console(or dot-source the script like `. .\myscript.ps... |
15,007,104 | I have a script I'm writing that makes a connection to a SOAP service. After the connection is made, I need to pass in a the username/pass with every command I send. The problem I have is that when I use read-host to do this, my password is shown in cleartext and remains in the shell:
```
PS C:\Users\Egr> Read-Host "E... | 2013/02/21 | [
"https://Stackoverflow.com/questions/15007104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/776890/"
] | $Password is a Securestring, and this will return the plain text password.
```
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password))
``` | There is a way to do this in PowerShell versions 6.x+:
```
$password = read-host -maskinput "Enter password"
```
, thanks to jborean93 for pointing this out to me. |
15,007,104 | I have a script I'm writing that makes a connection to a SOAP service. After the connection is made, I need to pass in a the username/pass with every command I send. The problem I have is that when I use read-host to do this, my password is shown in cleartext and remains in the shell:
```
PS C:\Users\Egr> Read-Host "E... | 2013/02/21 | [
"https://Stackoverflow.com/questions/15007104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/776890/"
] | You can save the password(input) as a variable and pass it to your service. If the code is run in a script or as a function, the variable containing the password will be deleted after it's done(they are stored in a temp. local scope). If you run the commands in the console(or dot-source the script like `. .\myscript.ps... | There is a way to do this in PowerShell versions 6.x+:
```
$password = read-host -maskinput "Enter password"
```
, thanks to jborean93 for pointing this out to me. |
39,713,134 | I have a circle, consisting of 12 arc segments and I want to allow the user to see the transition from the start pattern to the end pattern. (there will be many start and end patterns).
I have included the transition property in the css file, so that is not the issue.
Here is my code so far:
```
function playAnimati... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39713134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4162438/"
] | Give your Elements a `transition-delay` value. Of course a different one for each, like this
```
#LED1 {
transition-delay: 0.1s;
}
#LED2 {
transition-delay: 0.2s;
}
...
#LED2 {
transition-delay: 1.2s;
}
```
That should do it. You should be able to set the `transition-duration` directly in the **CSS** ... | 1. Check the transition properties you need to define
```
transition-property*
transition-duration*
transition-timing-function
transition-delay
```
transition-delay could help you to concatenate transitions if you set it using a js loop.
2. Check your function is getting and setting the right values (a quick check ... |
4,299,089 | I'm working on a journaling system in C# at our local church, but I've run into trouble with the database connection when storing birth dates. According to [MSDN](http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx?appId=Dev10IDEF1&l=EN-US&k=k%28SYSTEM.DATETIME%29;k%28TargetFrameworkMoniker-%22.NETFRA... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4299089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523204/"
] | You are going to have to roll your own class to handle BC dates in .NET, and store them in the database either as strings or as separate fields for year, month day (depending on what accuracy is required) if you require searching and sorting to be performed on the database side (which I assume you would).
SQL Server's... | Simple answer - store the day, month and year as separate numeric fields. The day and month can be combined into a day-of-the-year value, but you need to watch out for leap years.
Alternative answer - there are standard ways to convert a date into a day-number and back...
<http://en.wikipedia.org/wiki/Julian_day>
If... |
4,299,089 | I'm working on a journaling system in C# at our local church, but I've run into trouble with the database connection when storing birth dates. According to [MSDN](http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx?appId=Dev10IDEF1&l=EN-US&k=k%28SYSTEM.DATETIME%29;k%28TargetFrameworkMoniker-%22.NETFRA... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4299089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523204/"
] | If you are free to decide on type of calendar then I would recommend you to go-ahead with the Gregorian calendar, which has the
>
> ability to recognize two eras: B.C.
> and A.D.
>
>
>
<http://msdn.microsoft.com/en-us/library/system.globalization.gregoriancalendar.aspx> | Simple answer - store the day, month and year as separate numeric fields. The day and month can be combined into a day-of-the-year value, but you need to watch out for leap years.
Alternative answer - there are standard ways to convert a date into a day-number and back...
<http://en.wikipedia.org/wiki/Julian_day>
If... |
4,299,089 | I'm working on a journaling system in C# at our local church, but I've run into trouble with the database connection when storing birth dates. According to [MSDN](http://msdn.microsoft.com/en-us/library/system.datetime.minvalue.aspx?appId=Dev10IDEF1&l=EN-US&k=k%28SYSTEM.DATETIME%29;k%28TargetFrameworkMoniker-%22.NETFRA... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4299089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523204/"
] | <http://msdn.microsoft.com/en-us/library/system.globalization.gregoriancalendar.getera(v=VS.100).aspx> | Simple answer - store the day, month and year as separate numeric fields. The day and month can be combined into a day-of-the-year value, but you need to watch out for leap years.
Alternative answer - there are standard ways to convert a date into a day-number and back...
<http://en.wikipedia.org/wiki/Julian_day>
If... |
19,814,890 | well this is my problem..
```
<html>
<body>
<marquee id="introtext" scrollamount="150" behavior="slide" direction="left">
<p>
this is the sliding text.
</p>
</marquee>
</body>
</html>
```
What chrome does is just weard.
it repeats the "marquee" action after 4 seconds.
what can i do... | 2013/11/06 | [
"https://Stackoverflow.com/questions/19814890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2960837/"
] | try loop="0" :
```
<marquee id="introtext" scrollamount="150" behavior="slide" direction="left" loop="0">
``` | >
> what can i do to prevent this? or just fully disable this marquee but
> still keep this id , because this is used for other css effects?
>
>
>
From `<marquee id="introtext" scrollamount="150" behavior="slide" direction="left">`
To `<div id="introtext">`
If you want just to remain with ID of block. But that ... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Instance variables are shared by all methods in the class. When one method changes the data, another method can be affected by it. It means that you can't understand any one method on its own since it is affected by the code in the other methods in the class. The order in which methods are called can affect the outcome... | It's not a yes/no question. It basically depends on the situation and your needs. Declaring the variable in the smallest scope as possible is considered the best practice. However there may be some cases (like in this one) where, depending on the task, it's better to declare it inside/outside the methods. If you declar... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Instance variables are shared by all methods in the class. When one method changes the data, another method can be affected by it. It means that you can't understand any one method on its own since it is affected by the code in the other methods in the class. The order in which methods are called can affect the outcome... | Instance properties represent the state of a specific instance of that Class. It might make more sense to think about a concrete example. If the class is Engine, one of the properties that might represent the state of the Engine might be
```
private boolean running;
```
... so given an instance of Engine, you could ... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Instance variables are shared by all methods in the class. When one method changes the data, another method can be affected by it. It means that you can't understand any one method on its own since it is affected by the code in the other methods in the class. The order in which methods are called can affect the outcome... | Your class name should have been `Foo`.
The two versions you have are not the same, and it should depend on your use case.
The first version returns the same `AClass` object when different callers call `returnAClassSetted()` method using the same `Foo` object. If one of them changes the state of the returned `AClass... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Instance variables are shared by all methods in the class. When one method changes the data, another method can be affected by it. It means that you can't understand any one method on its own since it is affected by the code in the other methods in the class. The order in which methods are called can affect the outcome... | In Instance variables values given are default values means null so if it's an object reference, 0 if it's and int.
Local variables usually don't get default values, and therefore need to be explicitly initialized and the compiler generates an error if you fail to do so.
Further,
Local variables are only visible in ... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your class name should have been `Foo`.
The two versions you have are not the same, and it should depend on your use case.
The first version returns the same `AClass` object when different callers call `returnAClassSetted()` method using the same `Foo` object. If one of them changes the state of the returned `AClass... | It's not a yes/no question. It basically depends on the situation and your needs. Declaring the variable in the smallest scope as possible is considered the best practice. However there may be some cases (like in this one) where, depending on the task, it's better to declare it inside/outside the methods. If you declar... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your class name should have been `Foo`.
The two versions you have are not the same, and it should depend on your use case.
The first version returns the same `AClass` object when different callers call `returnAClassSetted()` method using the same `Foo` object. If one of them changes the state of the returned `AClass... | Instance properties represent the state of a specific instance of that Class. It might make more sense to think about a concrete example. If the class is Engine, one of the properties that might represent the state of the Engine might be
```
private boolean running;
```
... so given an instance of Engine, you could ... |
31,972,045 | Is there a reason to prefer using shared instance variable in class vs. local variable and have methods return the instance to it? Or is either one a bad practice?
```
import package.AClass;
public class foo {
private AClass aVar = new AClass();
// ... Constructor
public AClass returnAClassSetted() {
... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31972045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your class name should have been `Foo`.
The two versions you have are not the same, and it should depend on your use case.
The first version returns the same `AClass` object when different callers call `returnAClassSetted()` method using the same `Foo` object. If one of them changes the state of the returned `AClass... | In Instance variables values given are default values means null so if it's an object reference, 0 if it's and int.
Local variables usually don't get default values, and therefore need to be explicitly initialized and the compiler generates an error if you fail to do so.
Further,
Local variables are only visible in ... |
494,571 | I am currently studying for the GRE Physics subject test by working through published past tests. My question is about problem 44 from the test GR8677:
>
> [](https://i.stack.imgur.com/DzNMT.png)
>
>
> $44.$ A uniform s... | 2019/07/31 | [
"https://physics.stackexchange.com/questions/494571",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/237071/"
] | The GRE question seems to be erroneous. You see, if one specifies that the collision is elastic then they cannot also specify what would be the speed of the ball (the mass $m$) after the collision. That over-constraints the problem. That is the reason you are finding inconsistencies in your two ways to approach the pro... | What you've done is to find the condition under which an elastic collision can end with the incoming particle at rest. Conservation of momentum with that condition gives $MV=mv$, and conservation of angular momentum fixes $\omega$. If you require energy conservation as well, you find an inconsistency unless $\sqrt{M/m-... |
494,571 | I am currently studying for the GRE Physics subject test by working through published past tests. My question is about problem 44 from the test GR8677:
>
> [](https://i.stack.imgur.com/DzNMT.png)
>
>
> $44.$ A uniform s... | 2019/07/31 | [
"https://physics.stackexchange.com/questions/494571",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/237071/"
] | The GRE question seems to be erroneous. You see, if one specifies that the collision is elastic then they cannot also specify what would be the speed of the ball (the mass $m$) after the collision. That over-constraints the problem. That is the reason you are finding inconsistencies in your two ways to approach the pro... | I think they just want you to ignore irrelevant information. Linear momentum is conserved, so we get
$$V=\frac mMv$$
They threw in the extra information about an elastic collision I guess to throw students off. Unfortunately it leads to an actual contradictory situation. |
494,571 | I am currently studying for the GRE Physics subject test by working through published past tests. My question is about problem 44 from the test GR8677:
>
> [](https://i.stack.imgur.com/DzNMT.png)
>
>
> $44.$ A uniform s... | 2019/07/31 | [
"https://physics.stackexchange.com/questions/494571",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/237071/"
] | What you've done is to find the condition under which an elastic collision can end with the incoming particle at rest. Conservation of momentum with that condition gives $MV=mv$, and conservation of angular momentum fixes $\omega$. If you require energy conservation as well, you find an inconsistency unless $\sqrt{M/m-... | I think they just want you to ignore irrelevant information. Linear momentum is conserved, so we get
$$V=\frac mMv$$
They threw in the extra information about an elastic collision I guess to throw students off. Unfortunately it leads to an actual contradictory situation. |
59,344,426 | The input can only include two chemical elements: `C` and `H`
The program must control.
How can I provide that?
```
if (formul.Contains('C') == true && formul.Contains('H') == true)
return true;
```
When my input is `HCA` it is still true. I want it only includes `C` and `H`. | 2019/12/15 | [
"https://Stackoverflow.com/questions/59344426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12278081/"
] | ```cs
using System.Linq; \\put this on top
return formul.All(c => c == 'C' || c == 'H');
```
This will return `true` if all characters of `formul` string are either 'C' or 'H' | Chemical formulas (as far as I know) can contain also numbers, so you have to take that into account as well, here is my idea of solving problem:
```
return ! formula.Any(ch => char.IsLetter(ch) && ch != 'C' && ch != 'H');
```
It checks wheter any letter in a formula is different from `C` or `H`. If there's letter o... |
59,344,426 | The input can only include two chemical elements: `C` and `H`
The program must control.
How can I provide that?
```
if (formul.Contains('C') == true && formul.Contains('H') == true)
return true;
```
When my input is `HCA` it is still true. I want it only includes `C` and `H`. | 2019/12/15 | [
"https://Stackoverflow.com/questions/59344426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12278081/"
] | ```cs
using System.Linq; \\put this on top
return formul.All(c => c == 'C' || c == 'H');
```
This will return `true` if all characters of `formul` string are either 'C' or 'H' | Using LINQ as suggested by @Piotr is fine for something this simple, but in general it is preferable to use Regular Expressions (regexes) for text pattern matching, like this:
```
Regex.IsMatch(input, @"^[CH]+$");
```
This will return `true` if and only if `input` comprises a string of one or more characters, each b... |
59,344,426 | The input can only include two chemical elements: `C` and `H`
The program must control.
How can I provide that?
```
if (formul.Contains('C') == true && formul.Contains('H') == true)
return true;
```
When my input is `HCA` it is still true. I want it only includes `C` and `H`. | 2019/12/15 | [
"https://Stackoverflow.com/questions/59344426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12278081/"
] | Using LINQ as suggested by @Piotr is fine for something this simple, but in general it is preferable to use Regular Expressions (regexes) for text pattern matching, like this:
```
Regex.IsMatch(input, @"^[CH]+$");
```
This will return `true` if and only if `input` comprises a string of one or more characters, each b... | Chemical formulas (as far as I know) can contain also numbers, so you have to take that into account as well, here is my idea of solving problem:
```
return ! formula.Any(ch => char.IsLetter(ch) && ch != 'C' && ch != 'H');
```
It checks wheter any letter in a formula is different from `C` or `H`. If there's letter o... |
12,091 | Concerning "[Uranium-series dating](https://en.wikipedia.org/wiki/Uranium%E2%80%93thorium_dating)", also known as "Uranium-thorium dating".
Uranium is present in deposits, "typically at levels of between a few parts per billion and few parts per million by weight", according to the wikipedia article on the subject.
... | 2017/08/15 | [
"https://earthscience.stackexchange.com/questions/12091",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/10777/"
] | The chemistry of lead is very different from that of uranium and thorium. There are key kinds of rock that could not possibly have been formed with even the smallest amount of primordial lead. The lithophilic nature of uranium and thorium means that those same kinds of rock could easily have readily accepted primordial... | **Lead and uranium have completely different electro-chemical properties**. So as David mentioned it does not matter how much uranium the sample had (as long as it is enough to measure) what matters is whether it contained any lead when it formed. Uranium and lead do not form the same kinds of bonds with other elements... |
12,091 | Concerning "[Uranium-series dating](https://en.wikipedia.org/wiki/Uranium%E2%80%93thorium_dating)", also known as "Uranium-thorium dating".
Uranium is present in deposits, "typically at levels of between a few parts per billion and few parts per million by weight", according to the wikipedia article on the subject.
... | 2017/08/15 | [
"https://earthscience.stackexchange.com/questions/12091",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/10777/"
] | The field of nuclear physics has established the [radioactive decay](https://en.wikipedia.org/wiki/Radioactive_decay) series for radioactive elements (see [here](https://www.boundless.com/physics/textbooks/boundless-physics-textbook/nuclear-physics-and-radioactivity-30/radioactivity-190/radioactive-decay-series-introdu... | **Lead and uranium have completely different electro-chemical properties**. So as David mentioned it does not matter how much uranium the sample had (as long as it is enough to measure) what matters is whether it contained any lead when it formed. Uranium and lead do not form the same kinds of bonds with other elements... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | Put all of your "state" data in one place and use a [pickle](http://docs.python.org/library/pickle.html).
>
> The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a... | If you want to save everything, including the entire namespace and the line of code currently executing to be restarted at any time, there is not a standard library module to do that.
As another poster said, the pickle module can save pretty much everything into a file and then load it again, but you would have to spe... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | Put all of your "state" data in one place and use a [pickle](http://docs.python.org/library/pickle.html).
>
> The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a... | If you ok with OOP, consider creating a method for each class that output a serialised version ( using pickle ) to file. Then add a second method to load in the instance the data, and if the pickled file is there you call the load method instead of the processing one.
I use this approach for ML and it really seed up m... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | Put all of your "state" data in one place and use a [pickle](http://docs.python.org/library/pickle.html).
>
> The pickle module implements a fundamental, but powerful algorithm for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a... | In the traditional programming approach the obvious way to save a state of variables or objects after some point of execution is serialization.
So if you want to execute the program after some heavy already computed state we need to start only from the deserialization part.
These steps will be mostly needed mostly ... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | If you want to save everything, including the entire namespace and the line of code currently executing to be restarted at any time, there is not a standard library module to do that.
As another poster said, the pickle module can save pretty much everything into a file and then load it again, but you would have to spe... | If you ok with OOP, consider creating a method for each class that output a serialised version ( using pickle ) to file. Then add a second method to load in the instance the data, and if the pickled file is there you call the load method instead of the processing one.
I use this approach for ML and it really seed up m... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | If you want to save everything, including the entire namespace and the line of code currently executing to be restarted at any time, there is not a standard library module to do that.
As another poster said, the pickle module can save pretty much everything into a file and then load it again, but you would have to spe... | In the traditional programming approach the obvious way to save a state of variables or objects after some point of execution is serialization.
So if you want to execute the program after some heavy already computed state we need to start only from the deserialization part.
These steps will be mostly needed mostly ... |
5,568,904 | I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting? | 2011/04/06 | [
"https://Stackoverflow.com/questions/5568904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619962/"
] | If you ok with OOP, consider creating a method for each class that output a serialised version ( using pickle ) to file. Then add a second method to load in the instance the data, and if the pickled file is there you call the load method instead of the processing one.
I use this approach for ML and it really seed up m... | In the traditional programming approach the obvious way to save a state of variables or objects after some point of execution is serialization.
So if you want to execute the program after some heavy already computed state we need to start only from the deserialization part.
These steps will be mostly needed mostly ... |
54,186,894 | We are using .NET Core 2.1 and Entity Framework Core 2.1.1
I have the following setup in Azure West Europe
* Azure SQL Database
-- Premium P2 250 DTU
-- Public endpoint, no VNET peering
-- "Allow access to Azure Services" = ON
* Azure Functions
-- Consumption Plan
-- Timeout 10 Minutes
* Azure Blob storage
-- hot ti... | 2019/01/14 | [
"https://Stackoverflow.com/questions/54186894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10871024/"
] | I've found this good documentation around sql database transient errors:
* [Working with SQL Database connection issues and transient errors](https://learn.microsoft.com/en-us/azure/sql-database/sql-database-connectivity-issues)
From the documentation:
>
> A transient error has an underlying cause that soon resolve... | Remove and recreate database user and make sure to fill Login Name box just below the User Name. This will fix same issue on older SQL versions too. |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | In Theravada Buddhism, when we talk about conditions and conditioning there are 24 conditions found in the [Patthana](http://sanskritdocuments.org/articles/Notes_on_PATTHANA_DHAMMA.pdf)
The Patthana Dhamma are packed into 24 Paccaya or 24 conditions.
They are:
1.Root condition ( Hetu Paccayo )
2.Object condition ( A... | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | The practice of the eightfold noble path leads to the *experience* of nibbāna, just like the act of adverting the mind to the eye door leads to seeing light. Light, the object of seeing, is saṅkhata (conditioned), but nibbāna, the object of supermundane consciousness, is asaṅkhata (unconditioned). So nibbāna isn't the ... | I see two ambiguities here which might be the responsible for the confusion.
>
> with the six sense bases as condition, contact;
>
>
> -- SN 12:1
>
>
>
The above is one link of conditioned arising chain, which explain how many things are conditioned. Would it be correct to, according to the above, conclude that... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | No, the practices are causes of the unconditional result of Nibbana. Things in the past or future do not even exist to ultimate reality. We can't understand this without practicing virtue and witnessing what really is in the present moment(mindfulness or Vipassana) moment by moment | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | The practice of the eightfold noble path leads to the *experience* of nibbāna, just like the act of adverting the mind to the eye door leads to seeing light. Light, the object of seeing, is saṅkhata (conditioned), but nibbāna, the object of supermundane consciousness, is asaṅkhata (unconditioned). So nibbāna isn't the ... | In the material world alls phenomena arises and passes based on conditionality (as opposed to totally random). In Nibbana there is no arising and passing away of phenomena.
It is true that realising Nibbana is the result of practising the path to realise it, hence if you have realised Nibbana then this is because you ... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | The practice of the eightfold noble path leads to the *experience* of nibbāna, just like the act of adverting the mind to the eye door leads to seeing light. Light, the object of seeing, is saṅkhata (conditioned), but nibbāna, the object of supermundane consciousness, is asaṅkhata (unconditioned). So nibbāna isn't the ... | When it says that "Anicca vata sankhara" ( Impermanent are all conditioned things). "Uppadavaya dhammino" ( Of the nature to rise and fall).
It is saying that things arise dependent on conditions, things "exist" because of the conditions that support them. So we are talking about characteristic nature of things or its ... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | The practice of the eightfold noble path leads to the *experience* of nibbāna, just like the act of adverting the mind to the eye door leads to seeing light. Light, the object of seeing, is saṅkhata (conditioned), but nibbāna, the object of supermundane consciousness, is asaṅkhata (unconditioned). So nibbāna isn't the ... | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | In the material world alls phenomena arises and passes based on conditionality (as opposed to totally random). In Nibbana there is no arising and passing away of phenomena.
It is true that realising Nibbana is the result of practising the path to realise it, hence if you have realised Nibbana then this is because you ... | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | When it says that "Anicca vata sankhara" ( Impermanent are all conditioned things). "Uppadavaya dhammino" ( Of the nature to rise and fall).
It is saying that things arise dependent on conditions, things "exist" because of the conditions that support them. So we are talking about characteristic nature of things or its ... | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | The practice of the eightfold noble path leads to the *experience* of nibbāna, just like the act of adverting the mind to the eye door leads to seeing light. Light, the object of seeing, is saṅkhata (conditioned), but nibbāna, the object of supermundane consciousness, is asaṅkhata (unconditioned). So nibbāna isn't the ... | Nibbana as stated in the [Patthana](http://wisdomlib.org/buddhism/book/patthana-dhamma/d/doc1829.html) with my summary below:
* `[]` square brackets indicate my extra notes
* `*` asterisk indicates I've changed to the English rendering according to Nyanamoli as it appeals to me to be a closer rendering, otherwise it i... |
9,073 | It is often said that Nibbana is unconditioned. But isn't Nibbana to be attained through practice of the Noble Eightfold Path (abandoning desire, meditation, realizing paticcasamuppada etc)? Aren't those practices conditions for Nibbana? What am I missing here :) ? | 2015/05/18 | [
"https://buddhism.stackexchange.com/questions/9073",
"https://buddhism.stackexchange.com",
"https://buddhism.stackexchange.com/users/125/"
] | Nibbana as stated in the [Patthana](http://wisdomlib.org/buddhism/book/patthana-dhamma/d/doc1829.html) with my summary below:
* `[]` square brackets indicate my extra notes
* `*` asterisk indicates I've changed to the English rendering according to Nyanamoli as it appeals to me to be a closer rendering, otherwise it i... | I do not have sufficent knowledge to answer the question in a satisfactory way.
So i will instead point you to some great ressources regarding your question.
The first one is a book called [*"On the Nature of Nibbana"*](http://www.saraniya.com/books/mahasi-sayadaw/pdf/mahasi_sayadaw-1964_on_the_nature_of_nibbana.pdf)... |
132,551 | I have a Ubuntu 9.10 server. I have installed apache2 and php5 using the apt-get commands.
How does one install php extensions? Are there commands like apt-get to get them? Or should I manually look for the files on the php website and set them up in the php.ini?
More specifically, I need mcrypt, curl and gd.
Thanks | 2010/04/15 | [
"https://serverfault.com/questions/132551",
"https://serverfault.com",
"https://serverfault.com/users/24213/"
] | All you need to do is:
```
sudo apt-get install php5-mcrypt php5-curl php5-gd
```
If you need to check what is installed php-wise you can:
```
dpkg --list | grep php
```
EDIT: Removed sudo in the command above as it's not needed with dpkg --list. | Additionally, you can review the available PHP extensions on your Debian/Ubuntu system by:
```
apt-cache search php|egrep ^php5-
``` |
7,924,782 | I'm searching for following issue i have.
The class file names of our project are named logon.class.php
But the interface file for that class is named logon.interface.php
My issue i have is that when the autoload method runs I should be able to detect if it is a class call or an interface call.
```
<?php
function __... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7924782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/896201/"
] | You can use [ReflectionClass::isInterface](http://au.php.net/manual/en/reflectionclass.isinterface.php) to determine if the class is an interface.
```
$reflection = new ReflectionClass($name);
if ($reflection->isInterface()){
//Is an interface
}else{
//Not an interface
}
```
In your case, you would probably hav... | You should have some naming conventions for your classes and interfaces e.g. your class name is `logon` and interface name `logon_interface`, then you can easily differentiate between the two. For example, explode `$name` by underscore and check if last element is `interface`. |
7,924,782 | I'm searching for following issue i have.
The class file names of our project are named logon.class.php
But the interface file for that class is named logon.interface.php
My issue i have is that when the autoload method runs I should be able to detect if it is a class call or an interface call.
```
<?php
function __... | 2011/10/28 | [
"https://Stackoverflow.com/questions/7924782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/896201/"
] | You can use [ReflectionClass::isInterface](http://au.php.net/manual/en/reflectionclass.isinterface.php) to determine if the class is an interface.
```
$reflection = new ReflectionClass($name);
if ($reflection->isInterface()){
//Is an interface
}else{
//Not an interface
}
```
In your case, you would probably hav... | To avoid class name clashes you can use namespaces. Check The PSR-0 specifications.
Also check this [post](https://stackoverflow.com/questions/928928/determining-what-classes-are-defined-in-a-php-class-file/11114724#11114724). If you read the contents of the file before including it, you can tokenize it and figure if ... |
27,863,830 | Is there a way using `CSS3` or `javascript` to highlight a table row containing 2 elements where each table element is highlighted a different background color upon hovering over that row?
So for example you have a table row with two values like
```
1.45 | 2.56
```
and the table element containing `1.45` would hav... | 2015/01/09 | [
"https://Stackoverflow.com/questions/27863830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3922295/"
] | Use [`:nth-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-ch) selector, like this:
```css
td {
padding: 15px;
}
tr:hover td {
background-color: red;
color: white;
cursor:pointer;
}
tr:hover td:nth-child(1) {
background-color: blue;
}
```
```html
<table>
<tr>
<td>2.00</td>
... | you can use `:nth-of-type()` like so:
```
tr td:nth-of-type(1):hover{
background: red;
}
tr td:nth-of-type(2):hover{
background: blue;
}
```
[**EXAMPLE 1**](http://jsfiddle.net/wetLy72h/1/)
And by targeting the `td` as a descendant of `tr` you can assure that it works on multiple rows:
[**EXAMPLE 2**](http... |
27,863,830 | Is there a way using `CSS3` or `javascript` to highlight a table row containing 2 elements where each table element is highlighted a different background color upon hovering over that row?
So for example you have a table row with two values like
```
1.45 | 2.56
```
and the table element containing `1.45` would hav... | 2015/01/09 | [
"https://Stackoverflow.com/questions/27863830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3922295/"
] | Use [`:nth-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-ch) selector, like this:
```css
td {
padding: 15px;
}
tr:hover td {
background-color: red;
color: white;
cursor:pointer;
}
tr:hover td:nth-child(1) {
background-color: blue;
}
```
```html
<table>
<tr>
<td>2.00</td>
... | :nth-child(even){background-color: #ffd800;}
or
:nth-child(odd) |
1,317,256 | I'm trying to learn BNF and attempting to assemble some Z80 ASM code. Since I'm new to both fields, my question is, am I even on the right track? I am trying to write the format of Z80 ASM as EBNF so that I can then figure out where to go from there to create machine code from the source. At the moment I have the follo... | 2009/08/22 | [
"https://Stackoverflow.com/questions/1317256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2385364/"
] | Old-school assemblers were typically hand-coded in assembler and used adhoc parsing techniques to process assembly source lines to produce actual assembler code.
When assembler syntax is simple (e.g. always OPCODE REG, OPERAND) this worked well enough.
Modern machines have messy, nasty instruction sets with lots of in... | BNF is more generally used for structured, nested languages like Pascal, C++, or really anything derived from the Algol family (which includes modern languages like C#). If I were implementing an assembler, I might use some simple regular expressions to pattern-match the opcode and operands. It's been a while since I'v... |
1,317,256 | I'm trying to learn BNF and attempting to assemble some Z80 ASM code. Since I'm new to both fields, my question is, am I even on the right track? I am trying to write the format of Z80 ASM as EBNF so that I can then figure out where to go from there to create machine code from the source. At the moment I have the follo... | 2009/08/22 | [
"https://Stackoverflow.com/questions/1317256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2385364/"
] | Old-school assemblers were typically hand-coded in assembler and used adhoc parsing techniques to process assembly source lines to produce actual assembler code.
When assembler syntax is simple (e.g. always OPCODE REG, OPERAND) this worked well enough.
Modern machines have messy, nasty instruction sets with lots of in... | I don't think you need overthink it. There's no point making a parser that takes apart “LD A,A” into a load operation, destination and source register, when you can just string match the whole thing (modulo case and whitespace) into one opcode directly.
There aren't that many opcodes, and they aren't arranged in such ... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | It is possible, but the solution inverts the problem a little. Here's a sample written up as a golang test.
```
package redirects
import (
"github.com/codegangsta/martini-contrib/auth"
"github.com/go-martini/martini"
"net/http"
"net/http/httptest"
"testing"
)
func TestBasicAuthRedirect(t *testing... | To make request with Basic Auth that does not follow redirect use [RoundTrip](http://golang.org/pkg/net/http/#Transport.RoundTrip) function that accepts \*[Request](http://golang.org/pkg/net/http/#Request)
This code
```
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
)
func main() {
var ... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | Another option, using the client itself, without the RoundTrip:
```go
// create a custom error to know if a redirect happened
var RedirectAttemptedError = errors.New("redirect")
client := &http.Client{}
// return the error, so client won't attempt redirects
client.CheckRedirect = func(req *http.Request, via []*http.R... | It is possible, but the solution inverts the problem a little. Here's a sample written up as a golang test.
```
package redirects
import (
"github.com/codegangsta/martini-contrib/auth"
"github.com/go-martini/martini"
"net/http"
"net/http/httptest"
"testing"
)
func TestBasicAuthRedirect(t *testing... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | There's a much simpler solution right now:
```
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
```
This way, the `http` package automatically knows: "Ah, I shouldn't follow any redirects", but does not throw any error. Fr... | It is possible, but the solution inverts the problem a little. Here's a sample written up as a golang test.
```
package redirects
import (
"github.com/codegangsta/martini-contrib/auth"
"github.com/go-martini/martini"
"net/http"
"net/http/httptest"
"testing"
)
func TestBasicAuthRedirect(t *testing... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | It is possible, but the solution inverts the problem a little. Here's a sample written up as a golang test.
```
package redirects
import (
"github.com/codegangsta/martini-contrib/auth"
"github.com/go-martini/martini"
"net/http"
"net/http/httptest"
"testing"
)
func TestBasicAuthRedirect(t *testing... | As an addition of top rated answer,
You can control the particle size
```
func myCheckRedirect(req *http.Request, via []*http.Request, times int) error {
err := fmt.Errorf("redirect policy: stopped after %d times", times)
if len(via) >= times {
return err
}
return nil
}
...
client := &ht... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | Another option, using the client itself, without the RoundTrip:
```go
// create a custom error to know if a redirect happened
var RedirectAttemptedError = errors.New("redirect")
client := &http.Client{}
// return the error, so client won't attempt redirects
client.CheckRedirect = func(req *http.Request, via []*http.R... | To make request with Basic Auth that does not follow redirect use [RoundTrip](http://golang.org/pkg/net/http/#Transport.RoundTrip) function that accepts \*[Request](http://golang.org/pkg/net/http/#Request)
This code
```
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
)
func main() {
var ... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | There's a much simpler solution right now:
```
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
```
This way, the `http` package automatically knows: "Ah, I shouldn't follow any redirects", but does not throw any error. Fr... | To make request with Basic Auth that does not follow redirect use [RoundTrip](http://golang.org/pkg/net/http/#Transport.RoundTrip) function that accepts \*[Request](http://golang.org/pkg/net/http/#Request)
This code
```
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
)
func main() {
var ... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | To make request with Basic Auth that does not follow redirect use [RoundTrip](http://golang.org/pkg/net/http/#Transport.RoundTrip) function that accepts \*[Request](http://golang.org/pkg/net/http/#Request)
This code
```
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
)
func main() {
var ... | As an addition of top rated answer,
You can control the particle size
```
func myCheckRedirect(req *http.Request, via []*http.Request, times int) error {
err := fmt.Errorf("redirect policy: stopped after %d times", times)
if len(via) >= times {
return err
}
return nil
}
...
client := &ht... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | There's a much simpler solution right now:
```
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
```
This way, the `http` package automatically knows: "Ah, I shouldn't follow any redirects", but does not throw any error. Fr... | Another option, using the client itself, without the RoundTrip:
```go
// create a custom error to know if a redirect happened
var RedirectAttemptedError = errors.New("redirect")
client := &http.Client{}
// return the error, so client won't attempt redirects
client.CheckRedirect = func(req *http.Request, via []*http.R... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | Another option, using the client itself, without the RoundTrip:
```go
// create a custom error to know if a redirect happened
var RedirectAttemptedError = errors.New("redirect")
client := &http.Client{}
// return the error, so client won't attempt redirects
client.CheckRedirect = func(req *http.Request, via []*http.R... | As an addition of top rated answer,
You can control the particle size
```
func myCheckRedirect(req *http.Request, via []*http.Request, times int) error {
err := fmt.Errorf("redirect policy: stopped after %d times", times)
if len(via) >= times {
return err
}
return nil
}
...
client := &ht... |
23,297,520 | I'm currently writing some software in Go that interacts with a REST API. The REST API endpoint I'm trying to query returns an HTTP 302 redirect along with an HTTP Location header, pointing to a resource URI.
I'm trying to use my Go script to grab the HTTP Location header for later processing.
Here's what I'm current... | 2014/04/25 | [
"https://Stackoverflow.com/questions/23297520",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194175/"
] | There's a much simpler solution right now:
```
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
```
This way, the `http` package automatically knows: "Ah, I shouldn't follow any redirects", but does not throw any error. Fr... | As an addition of top rated answer,
You can control the particle size
```
func myCheckRedirect(req *http.Request, via []*http.Request, times int) error {
err := fmt.Errorf("redirect policy: stopped after %d times", times)
if len(via) >= times {
return err
}
return nil
}
...
client := &ht... |
33,511,462 | I have to write a code that counts the number of odd numbers, even numbers, and zeros in a multi-digit long variable, here is what I have so far:
```
#include <iostream>
using namespace std;
int lab14(long num, int &even, int &odd, int &zero){
while (num > 0){
long w = num;
w = num%10;
... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33511462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5505001/"
] | As I mentioned in my [comment](https://stackoverflow.com/questions/33511461/how-do-i-dereference-this-hash-in-perl#comment54806600_33511461), you're flattening a list when you create `%hash`. The fat comma (`=>`) is a synonym for the comma that causes barewords on the left to be interpreted as strings, but it doesn't m... | The code is fine, but your test hash is not what you think it is.
You cannot construct a hash like that. The lists in there got flattened out. You need to use array-refs instead:
```
my %hash = ( "a" => [1,2,3], "b" => [3,4,5]);
```
Since you are going to take a reference to that hash anyway, you might as well star... |
33,511,462 | I have to write a code that counts the number of odd numbers, even numbers, and zeros in a multi-digit long variable, here is what I have so far:
```
#include <iostream>
using namespace std;
int lab14(long num, int &even, int &odd, int &zero){
while (num > 0){
long w = num;
w = num%10;
... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33511462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5505001/"
] | The code is fine, but your test hash is not what you think it is.
You cannot construct a hash like that. The lists in there got flattened out. You need to use array-refs instead:
```
my %hash = ( "a" => [1,2,3], "b" => [3,4,5]);
```
Since you are going to take a reference to that hash anyway, you might as well star... | There are two issues here:
* The way Dumper is used to print the hash without passing reference wherein it resolves to print all the elements as $VAR1, $VAR2, etc.
Dumper(\%hash)
* The way the hash is initialized. Since the value is a list, it should be initialized as
my %hash = ( "a" => [1,2,3], "b" => [3,4,5]);
A... |
33,511,462 | I have to write a code that counts the number of odd numbers, even numbers, and zeros in a multi-digit long variable, here is what I have so far:
```
#include <iostream>
using namespace std;
int lab14(long num, int &even, int &odd, int &zero){
while (num > 0){
long w = num;
w = num%10;
... | 2015/11/04 | [
"https://Stackoverflow.com/questions/33511462",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5505001/"
] | As I mentioned in my [comment](https://stackoverflow.com/questions/33511461/how-do-i-dereference-this-hash-in-perl#comment54806600_33511461), you're flattening a list when you create `%hash`. The fat comma (`=>`) is a synonym for the comma that causes barewords on the left to be interpreted as strings, but it doesn't m... | There are two issues here:
* The way Dumper is used to print the hash without passing reference wherein it resolves to print all the elements as $VAR1, $VAR2, etc.
Dumper(\%hash)
* The way the hash is initialized. Since the value is a list, it should be initialized as
my %hash = ( "a" => [1,2,3], "b" => [3,4,5]);
A... |
56,412,227 | My angular 7 app is running using `ng serve` on port 4200. I have a node server running inside of a docker container, located at localhost:8081.
I have verified that the server is up, and accessible, using postman. The url was `localhost:8081/login`. I was able to receive the data I expected when the POST request was ... | 2019/06/02 | [
"https://Stackoverflow.com/questions/56412227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5237611/"
] | As mentioned by @Austaras, an `Observable` must have at least one active subscription in order to execute it.
You must subscribe to the `login()` method of `AuthenticationService` in the `LoginComponent`
```
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
i... | You must subscribe your login service method when you use its in `login.component.ts`.
For example:
```
login() : void {
this.authenticationService.login(this.loginForm.controls.email.value, this.loginForm.controls.password.value).subscribe();
}
``` |
65,379,890 | I have a database with four tables and I want my PHP to execute the query dynamically for one of these tables, based on the user's input.
```
$company = $_POST['company'];
$model = $_POST['model'];
$servername = "localhost";
$username = "user";
$password = "pass";
$database = "ref";
if ($company == "ford") {
$tabl... | 2020/12/20 | [
"https://Stackoverflow.com/questions/65379890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14857827/"
] | The problem has already been pointed out (in your if-statements, you have `=` when it should be `==` and `==` where it should be `=`) so I just wanted to show a, in my opinion, cleaner way of doing the same thing.
I would be to use an array for this. It's not only easier to read the relationships, but it also makes it... | All comparison operations should be using "==" instead of "=". On the other hand,all assignment should be using "=" instead of "=="
Hence, please change
```
if ($company == "ford") {
$table = "ref_ford";
} else if ($company = "hyundai") {
$table == "ref_hyundai";
} else if ($company = "renault") {
$table == "re... |
14,468,001 | Output I'm getting:
* The base array
* 7290 5184 6174 8003 7427 2245 6522 6669 8939 4814 The
* Sorted array
* -33686019 2245 4814 5184 6174 6522 6669 7290 7427 8003
* Press any key to continue . . .
I have no idea where this, -33686019, number is coming from. I've posted all of the code because I really don't know wh... | 2013/01/22 | [
"https://Stackoverflow.com/questions/14468001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1715979/"
] | The following bit is not correct:
```
for( int i = 0; i < size; i++ )
{
if( theArray[i+1] < theArray[i] )
```
It is accessing one beyond the boundary of the array. The `for` loop should probably be:
```
for( int i = 0; i < size - 1; i++ )
``` | Look at this:
```
for( int i = 0; i < size; i++ )
{
if( theArray[i+1] < theArray[i] )
```
theArray[i+1] is undefined on the last iteration of the loop.
Change the loop's continuation expression from `i < size` to `i < (size-1)` |
701,086 | I am running a 10.04LTE server where I do want to upgrade openssl for apache.
Therefore I downloaded openssl 1.0.2c and apache 2.2.29 and compiled both. The server is starting, but is using the old ssl version:
```
curl --head http://localhost
HTTP/1.1 200 OK
Date: Mon, 22 Jun 2015 06:00:06 GMT
Server: Apache/2.2.29... | 2015/06/23 | [
"https://serverfault.com/questions/701086",
"https://serverfault.com",
"https://serverfault.com/users/84332/"
] | The problem is that your Apache installation is unable to link the shared libraries of your new OpenSSL installation. Run the command `ldd /usr/local/apache/modules/mod_ssl.so` (with the apporpriate path to your mod\_ssl.so). You'll see that mod\_ssl.so is not linking to the libraries in `/usr/local/ssl/lib`
You have ... | Download the 1.0.2k zip file from this site.
<https://indy.fulgan.com/SSL/>
Extract the files.
Stop the Apache service.
Make a backup of these 3 files in C:\xampp\apache\bin
ssleay32.dll
libeay32.dll
openssl.exe
Copy the same 3 files from the extract files location to C:\xampp\apache\bin
Start the Apache service. |
10,864,333 | Here's a strange one. We have a Google App Engine (GAE) app and a custom domain <http://www.tradeos.com> CNAME'd to ghs.google.com. In China we regularly get no response whatsoever from the server for 20 minutes or so then it works fine for a a while, sometimes for a few hours.
Other non-Chinese sites like CNN seem t... | 2012/06/02 | [
"https://Stackoverflow.com/questions/10864333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1176505/"
] | Read portions of bytes to byte array and store them in new files when buffer is full or it is end of file.
For example (code is not perfect, but it should help understanding the process)
```
class FileSplit {
public static void splitFile(File f) throws IOException {
int partCounter = 1;//I like to name pa... | Read & write streams as raw `byte[]`. Avoid the text streams and readers.
In your last question your were apparently breaking up the files according to 'line'. To replicate that behavior, simply used a fixed size of `byte[]` to read. Note carefully the warnings in comments to your last question, to check how many byt... |
35,015,850 | Given that I have a `Supervisor` actor which is injected with a `child` actor how do I send the child a PoisonPill message and test this using TestKit?
Here is my Superivisor.
```
class Supervisor(child: ActorRef) extends Actor {
...
child ! "hello"
child ! PoisonPill
}
```
here is my test code
```
val prob... | 2016/01/26 | [
"https://Stackoverflow.com/questions/35015850",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/532383/"
] | I think this [Testing Actor Systems](http://doc.akka.io/docs/akka/current/scala/testing.html) should answer your question:
**Watching Other Actors from Probes**
A TestProbe can register itself for DeathWatch of any other actor:
```
val probe = TestProbe()
probe watch target
target ! PoisonPill
probe.expectTerminated... | In a test case, which extends the testkit, you can use the following code:
```
"receives ShutDown" must {
"sends PosionPill to other actor" in {
val other = TestProbe("Other")
val testee = TestActorRef(new Testee(actor.ref))
testee ! Testee.ShutDown
watch(other.ref)
expectTerminated(other.ref)
... |
2,573,501 | * Given a triangle $\mathrm{A}\left(2,0\right),\ \mathrm{B}\left(1,3\right),\
\mathrm{C}\left(5,2\right)\ \mbox{with}\ \rho\left(x,y\right) = x$; I need to find it's centre of mass ?.
* I know I need to integrate the density formula over the region, but I don't understand how to get the limits for the integrals to calc... | 2017/12/19 | [
"https://math.stackexchange.com/questions/2573501",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/392788/"
] | Denote by $\;AB,AC,BC\;$ the respective lines on which the sides $\;AB,AC,BC\;$ lie, thus:
$$\begin{cases}AB:\;y=-3x+6\\{}\\AC:\;y=\cfrac23x-\cfrac43\\{}\\BC:\;y=-\cfrac14x+\cfrac{13}4\end{cases}$$
You should try to do a diagram, and then you need for the mass you need the integrals
$$M=\int\_1^2\int\_{-3x+6}^{-\fra... | Yes find lines equation is a way to set the correct integral.
Firstly make a graph of the points and then find the equations you need. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.