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
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
There's a few different possibilities, depending on how much isolation you want. The easiest is to simply trust the code. It looks like that is out of the question for you, or you wouldn't be asking this. The next step up is to run the code on a separate user account, as [Vigneshwaren suggested](https://superuser.com...
I have worked on a similar system a few years ago. What I did was to use ptrace to limit the system calls (see code [here](https://code.google.com/p/orzoj/source/browse?repo=server-judge#git/orzoj/judge/lib/orzoj-limiter/linux)), and optionally change user id or chroot. If the programs are simple, involving only pure a...
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
There's a few different possibilities, depending on how much isolation you want. The easiest is to simply trust the code. It looks like that is out of the question for you, or you wouldn't be asking this. The next step up is to run the code on a separate user account, as [Vigneshwaren suggested](https://superuser.com...
`I have to mark C code` Then you have full access to the source code, Look though it - its doubtful they will be able to pass off anything malicious in the code without you noticing. If your unsure run it though a VM, but in most cases you will know what is being run
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
There are actually multiple types of virtual machines, which is kinda being missed in the other answers. You can have what's known as container virtualisation - something like Linux vServer or OpenVZ. They share the host kernel, running what are known as 'containers' (with their own environments) rather than virtualisi...
`I have to mark C code` Then you have full access to the source code, Look though it - its doubtful they will be able to pass off anything malicious in the code without you noticing. If your unsure run it though a VM, but in most cases you will know what is being run
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
There are actually multiple types of virtual machines, which is kinda being missed in the other answers. You can have what's known as container virtualisation - something like Linux vServer or OpenVZ. They share the host kernel, running what are known as 'containers' (with their own environments) rather than virtualisi...
1. Run the code as `nobody`, which should give you minimal privileges. Depending on how hair-raising the configuration is, this may not be safe 2. Run in a `chroot` jail. Depending on the code this may change the behaviour, and jails can often be broken out of. [They are *not* a security feature.](http://securityblog.r...
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
1. Run the code as `nobody`, which should give you minimal privileges. Depending on how hair-raising the configuration is, this may not be safe 2. Run in a `chroot` jail. Depending on the code this may change the behaviour, and jails can often be broken out of. [They are *not* a security feature.](http://securityblog.r...
I have worked on a similar system a few years ago. What I did was to use ptrace to limit the system calls (see code [here](https://code.google.com/p/orzoj/source/browse?repo=server-judge#git/orzoj/judge/lib/orzoj-limiter/linux)), and optionally change user id or chroot. If the programs are simple, involving only pure a...
690,553
I have to mark C code and part of that involves running and timing their submissions. The problem is that their code then runs as me and they can in principle do whatever they like using my permission settings. For example, they could copy my ssh private key. I could set up a virtual machine and run their code within ...
2013/12/19
[ "https://superuser.com/questions/690553", "https://superuser.com", "https://superuser.com/users/221632/" ]
There are actually multiple types of virtual machines, which is kinda being missed in the other answers. You can have what's known as container virtualisation - something like Linux vServer or OpenVZ. They share the host kernel, running what are known as 'containers' (with their own environments) rather than virtualisi...
I have worked on a similar system a few years ago. What I did was to use ptrace to limit the system calls (see code [here](https://code.google.com/p/orzoj/source/browse?repo=server-judge#git/orzoj/judge/lib/orzoj-limiter/linux)), and optionally change user id or chroot. If the programs are simple, involving only pure a...
46,077,109
I have a SELECT statement requesting the age of he individual when a test was made: ``` SELECT DATEDIFF(dd,BIRTH_DATE,TEST_DATE)/365.25 [Age at Result] FROM TABLE WHERE ID = '100' ``` The result comes out like `2.056125`. I saw on another [post](https://stackoverflow.com/questions/9524094/tsql-datediff-to-retur...
2017/09/06
[ "https://Stackoverflow.com/questions/46077109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8484321/" ]
You can cast to a decimal with the precision you want: ``` SELECT CAST(DATEDIFF(day, BIRTH_DATE, TEST_DATE)/365.25 as DECIMAL(10, 2)) as [Age at Result] FROM TABLE WHERE ID = 100; ``` Note: I removed the single quotes around "100". Only use single quotes if it the `id` is a string.
I would use the following - ``` DECLARE @TestDate DATETIME = GETDATE() DECLARE @BirthDate DATETIME = '1995-06-06 08:00:00.000' SELECT CAST(DATEDIFF(dd,@BirthDate,@TestDate)/365.25 AS DECIMAL(10, 2)) [Age at Result] ```
1,316,223
My CPU cooler is too big so i cant get my motherboard out to clean it it's like 7 years old and I need to get the dust out. I have tried to take it out without taking off the motherboard but it doesn't fit.
2018/04/22
[ "https://superuser.com/questions/1316223", "https://superuser.com", "https://superuser.com/users/897689/" ]
**That is a bad idea! Continue reading...** You need physical contact to move heat efficiently from the **CPU** heatspreader to the heatsink. The role of **thermal paste** is to "fill in the gaps" and allow for better transfer of heat from the heatspreader to the heatsink. **What will happen if I don't put a thermal ...
Yes, you should replace the compound if you remove the heatsink. Thermal paste is generally either a near-fluid or putty like compound when applied. Over time it "sets" into a solid due to heat and forms an effective seal between the CPU case and heatsink. When you remove the heatsink you break that seal and create g...
1,316,223
My CPU cooler is too big so i cant get my motherboard out to clean it it's like 7 years old and I need to get the dust out. I have tried to take it out without taking off the motherboard but it doesn't fit.
2018/04/22
[ "https://superuser.com/questions/1316223", "https://superuser.com", "https://superuser.com/users/897689/" ]
**That is a bad idea! Continue reading...** You need physical contact to move heat efficiently from the **CPU** heatspreader to the heatsink. The role of **thermal paste** is to "fill in the gaps" and allow for better transfer of heat from the heatspreader to the heatsink. **What will happen if I don't put a thermal ...
Why remove the heatsink? Purchase an air duster (compressed air, or a blower designed for the same role) to blow the dust out of your case. Less work involved, and no need to worry about damaging your system\* \*don't blow the fans - preferably hold them in place while cleaning. This prevents them from spinning up an...
1,316,223
My CPU cooler is too big so i cant get my motherboard out to clean it it's like 7 years old and I need to get the dust out. I have tried to take it out without taking off the motherboard but it doesn't fit.
2018/04/22
[ "https://superuser.com/questions/1316223", "https://superuser.com", "https://superuser.com/users/897689/" ]
Yes, you should replace the compound if you remove the heatsink. Thermal paste is generally either a near-fluid or putty like compound when applied. Over time it "sets" into a solid due to heat and forms an effective seal between the CPU case and heatsink. When you remove the heatsink you break that seal and create g...
Why remove the heatsink? Purchase an air duster (compressed air, or a blower designed for the same role) to blow the dust out of your case. Less work involved, and no need to worry about damaging your system\* \*don't blow the fans - preferably hold them in place while cleaning. This prevents them from spinning up an...
13,696,621
So, I am done with a project, now the main issue I am facing is the **Memory Leakage** in the application *(“leak” meaning you keep a reference to an activity, thus preventing the GC from collecting it)* Some of the cases I found, where the memory leakage occurs are: Context Leakage --------------- It occurs because...
2012/12/04
[ "https://Stackoverflow.com/questions/13696621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1626878/" ]
I know this is an old post, but recently Square released a library called [LeakCanary](https://github.com/square/leakcanary) which is by *far* the most elegant solution for finding memory leaks.
you can use tools like traceview or memory analyzer to check for memory leaks <http://developer.android.com/tools/help/traceview.html> <http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html> Here are some articles i found helpful <http://android-developers.blogspot.com/2009/01/avoiding-me...
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
[Look at this tutorial + example](http://www.developer.com/java/other/article.php/10936_3587361_3/Java-Applet-for-Signing-with-a-Smart-Card.htm). And [related](http://www.nakov.com/documents-signing/). (I have used these examples and they work fine). An important point is that you can't get anything out of the smart c...
There is a Java Card emulator bundled with the [Java Card Development Kit](http://www.oracle.com/technetwork/java/javacard/downloads/index.html). If you plan on using a real card at some stage, get version 2.2.1 or 2.2.2 as I would not expect any version 3 cards for a while. You will still need an applet to put on the ...
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
[Look at this tutorial + example](http://www.developer.com/java/other/article.php/10936_3587361_3/Java-Applet-for-Signing-with-a-Smart-Card.htm). And [related](http://www.nakov.com/documents-signing/). (I have used these examples and they work fine). An important point is that you can't get anything out of the smart c...
You can get a virtual smartcard (and a virtual reader) here: <http://sourceforge.net/projects/vsmartcard/>
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
[Look at this tutorial + example](http://www.developer.com/java/other/article.php/10936_3587361_3/Java-Applet-for-Signing-with-a-Smart-Card.htm). And [related](http://www.nakov.com/documents-signing/). (I have used these examples and they work fine). An important point is that you can't get anything out of the smart c...
If you need to emulate JavaCard try to use jCardSim: <http://jcardsim.org>. It also supports access via javax.smartcardio API and apdu-scripts.
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
[Look at this tutorial + example](http://www.developer.com/java/other/article.php/10936_3587361_3/Java-Applet-for-Signing-with-a-Smart-Card.htm). And [related](http://www.nakov.com/documents-signing/). (I have used these examples and they work fine). An important point is that you can't get anything out of the smart c...
Javacard use Java only a subset of the Java development You'd better not use Java development environment Because there are some special effects is not support You can download the plugin or a dedicated development IDE, you can download it from here www.javacos.com related development environment.
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
There is a Java Card emulator bundled with the [Java Card Development Kit](http://www.oracle.com/technetwork/java/javacard/downloads/index.html). If you plan on using a real card at some stage, get version 2.2.1 or 2.2.2 as I would not expect any version 3 cards for a while. You will still need an applet to put on the ...
You can get a virtual smartcard (and a virtual reader) here: <http://sourceforge.net/projects/vsmartcard/>
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
There is a Java Card emulator bundled with the [Java Card Development Kit](http://www.oracle.com/technetwork/java/javacard/downloads/index.html). If you plan on using a real card at some stage, get version 2.2.1 or 2.2.2 as I would not expect any version 3 cards for a while. You will still need an applet to put on the ...
If you need to emulate JavaCard try to use jCardSim: <http://jcardsim.org>. It also supports access via javax.smartcardio API and apdu-scripts.
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
There is a Java Card emulator bundled with the [Java Card Development Kit](http://www.oracle.com/technetwork/java/javacard/downloads/index.html). If you plan on using a real card at some stage, get version 2.2.1 or 2.2.2 as I would not expect any version 3 cards for a while. You will still need an applet to put on the ...
Javacard use Java only a subset of the Java development You'd better not use Java development environment Because there are some special effects is not support You can download the plugin or a dedicated development IDE, you can download it from here www.javacos.com related development environment.
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
You can get a virtual smartcard (and a virtual reader) here: <http://sourceforge.net/projects/vsmartcard/>
If you need to emulate JavaCard try to use jCardSim: <http://jcardsim.org>. It also supports access via javax.smartcardio API and apdu-scripts.
2,819,203
I'm trying to learn about how does Java access smart cards, due to a project analysis. I wonder if there is any kind of virtual smart card which I could use to make some tests with Java? By the way, I've read about Java Card, and looks like it is used to run Java in cards, not to smart card data access using Java, rig...
2010/05/12
[ "https://Stackoverflow.com/questions/2819203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287316/" ]
Javacard use Java only a subset of the Java development You'd better not use Java development environment Because there are some special effects is not support You can download the plugin or a dedicated development IDE, you can download it from here www.javacos.com related development environment.
If you need to emulate JavaCard try to use jCardSim: <http://jcardsim.org>. It also supports access via javax.smartcardio API and apdu-scripts.
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
``` using System.IO; using System.Xml; using System.Xml.XPath; ``` . . . ``` string xml = @"<poi> <city>stockholm</city> <country>sweden</countr> <gpoint> <lat>51.1</lat> ...
If you can use LINQ for XML you can read those two values straight forward like this: ``` var doc = XDocument.Parse("..."); var point = doc.Element("poi").Element("gpoint"); Console.WriteLine("Lat: {0}, Lng: {1}", point.Element("lat").Value, point.Element("lng").Value); ``` If you need them as double you hav...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
``` using System.IO; using System.Xml; using System.Xml.XPath; ``` . . . ``` string xml = @"<poi> <city>stockholm</city> <country>sweden</countr> <gpoint> <lat>51.1</lat> ...
Even simpler than Mitch Wheat's answer, since the fragment in question is a well-formed XML document: ``` using System.Xml; using System.IO; ... string xml = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> ...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
``` using System.IO; using System.Xml; using System.Xml.XPath; ``` . . . ``` string xml = @"<poi> <city>stockholm</city> <country>sweden</countr> <gpoint> <lat>51.1</lat> ...
Use XElement.Parse(string text) method to do this. Example: ``` string xmlString = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi>"; try ...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
Using Linq for XML: ``` XDocument doc= XDocument.Parse("<poi><city>stockholm</city><country>sweden</country><gpoint><lat>51.1</lat><lng>67.98</lng></gpoint></poi>"); var points=doc.Descendants("gpoint"); foreach (XElement current in points) { Console.WriteLine(current.Element("lat").Value); ...
If you can use LINQ for XML you can read those two values straight forward like this: ``` var doc = XDocument.Parse("..."); var point = doc.Element("poi").Element("gpoint"); Console.WriteLine("Lat: {0}, Lng: {1}", point.Element("lat").Value, point.Element("lng").Value); ``` If you need them as double you hav...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
Using Linq for XML: ``` XDocument doc= XDocument.Parse("<poi><city>stockholm</city><country>sweden</country><gpoint><lat>51.1</lat><lng>67.98</lng></gpoint></poi>"); var points=doc.Descendants("gpoint"); foreach (XElement current in points) { Console.WriteLine(current.Element("lat").Value); ...
Even simpler than Mitch Wheat's answer, since the fragment in question is a well-formed XML document: ``` using System.Xml; using System.IO; ... string xml = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> ...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
Using Linq for XML: ``` XDocument doc= XDocument.Parse("<poi><city>stockholm</city><country>sweden</country><gpoint><lat>51.1</lat><lng>67.98</lng></gpoint></poi>"); var points=doc.Descendants("gpoint"); foreach (XElement current in points) { Console.WriteLine(current.Element("lat").Value); ...
Use XElement.Parse(string text) method to do this. Example: ``` string xmlString = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi>"; try ...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
Even simpler than Mitch Wheat's answer, since the fragment in question is a well-formed XML document: ``` using System.Xml; using System.IO; ... string xml = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> ...
If you can use LINQ for XML you can read those two values straight forward like this: ``` var doc = XDocument.Parse("..."); var point = doc.Element("poi").Element("gpoint"); Console.WriteLine("Lat: {0}, Lng: {1}", point.Element("lat").Value, point.Element("lng").Value); ``` If you need them as double you hav...
552,187
what is the simplest way to parse the lat and long out of the following xml fragment. There is no namespace etc. It is in a string variable. not a stream. ``` <poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi> ``` ...
2009/02/16
[ "https://Stackoverflow.com/questions/552187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17194/" ]
Even simpler than Mitch Wheat's answer, since the fragment in question is a well-formed XML document: ``` using System.Xml; using System.IO; ... string xml = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> ...
Use XElement.Parse(string text) method to do this. Example: ``` string xmlString = @"<poi> <city>stockholm</city> <country>sweden</country> <gpoint> <lat>51.1</lat> <lng>67.98</lng> </gpoint> </poi>"; try ...
55,196
I hope that this question follows the rules. One of my characters has a kalimba that, when played, allows the player to hear the thoughts of everyone around them, and everyone around them can hear the player's thoughts. These thoughts can also control each other, so everyone involved can make each other do anything th...
2021/03/09
[ "https://writers.stackexchange.com/questions/55196", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/49102/" ]
**It is *not* cliche:** Like I mentioned in comments, every good idea has been used before. Just by using a vague idea (an addictive magical item) and it happens that a different book with a *different* plot has also used a similar thing doesn't make your idea cliche. When you say "addictive magical item" cliche does...
Your magical item is distinct from the One Ring because it simultaneously takes control of others *and grants those others control over you*. One Kalimba to rule (and be ruled) by all... Sounds like a lot of new territory to explore in that one. Definitely not cliche'.
55,196
I hope that this question follows the rules. One of my characters has a kalimba that, when played, allows the player to hear the thoughts of everyone around them, and everyone around them can hear the player's thoughts. These thoughts can also control each other, so everyone involved can make each other do anything th...
2021/03/09
[ "https://writers.stackexchange.com/questions/55196", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/49102/" ]
Your magical item is distinct from the One Ring because it simultaneously takes control of others *and grants those others control over you*. One Kalimba to rule (and be ruled) by all... Sounds like a lot of new territory to explore in that one. Definitely not cliche'.
What seems the underlying mechanism of the Kalimba is to bring multiple people together into a singular hive mind, regardless of who's actually playing. (The way you've described this the person playing isn't conferred any particular "power" over the others in earshot.) On that note, what you have is something that's ...
55,196
I hope that this question follows the rules. One of my characters has a kalimba that, when played, allows the player to hear the thoughts of everyone around them, and everyone around them can hear the player's thoughts. These thoughts can also control each other, so everyone involved can make each other do anything th...
2021/03/09
[ "https://writers.stackexchange.com/questions/55196", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/49102/" ]
**It is *not* cliche:** Like I mentioned in comments, every good idea has been used before. Just by using a vague idea (an addictive magical item) and it happens that a different book with a *different* plot has also used a similar thing doesn't make your idea cliche. When you say "addictive magical item" cliche does...
[![enter image description here](https://i.stack.imgur.com/xXZQL.png)](https://i.stack.imgur.com/xXZQL.png) Dog: You want to give me a belly rub. Bard: You don't want to bite the mailman. Who will win? The One Ring wasn't addictive, like how opium or tobacco induce a positive experience that repeated use turns into ...
55,196
I hope that this question follows the rules. One of my characters has a kalimba that, when played, allows the player to hear the thoughts of everyone around them, and everyone around them can hear the player's thoughts. These thoughts can also control each other, so everyone involved can make each other do anything th...
2021/03/09
[ "https://writers.stackexchange.com/questions/55196", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/49102/" ]
[![enter image description here](https://i.stack.imgur.com/xXZQL.png)](https://i.stack.imgur.com/xXZQL.png) Dog: You want to give me a belly rub. Bard: You don't want to bite the mailman. Who will win? The One Ring wasn't addictive, like how opium or tobacco induce a positive experience that repeated use turns into ...
What seems the underlying mechanism of the Kalimba is to bring multiple people together into a singular hive mind, regardless of who's actually playing. (The way you've described this the person playing isn't conferred any particular "power" over the others in earshot.) On that note, what you have is something that's ...
55,196
I hope that this question follows the rules. One of my characters has a kalimba that, when played, allows the player to hear the thoughts of everyone around them, and everyone around them can hear the player's thoughts. These thoughts can also control each other, so everyone involved can make each other do anything th...
2021/03/09
[ "https://writers.stackexchange.com/questions/55196", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/49102/" ]
**It is *not* cliche:** Like I mentioned in comments, every good idea has been used before. Just by using a vague idea (an addictive magical item) and it happens that a different book with a *different* plot has also used a similar thing doesn't make your idea cliche. When you say "addictive magical item" cliche does...
What seems the underlying mechanism of the Kalimba is to bring multiple people together into a singular hive mind, regardless of who's actually playing. (The way you've described this the person playing isn't conferred any particular "power" over the others in earshot.) On that note, what you have is something that's ...
1,933
Is it possible to create a custom AI in a Starcraft 2 mod? If so, how?
2010/07/15
[ "https://gaming.stackexchange.com/questions/1933", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/679/" ]
As the new Starcraft editor is very mighty and supports something like procedures and functions you possibly can enhance available AIs with own stuff. For an example create some triggers like "IF player1 has >x units of this and that type, THEN AIPlayer2 order to tech for this tech" Maybe this style would be a bit too...
Well I know for the beta there were several AI mods released, so it might be possible.
1,933
Is it possible to create a custom AI in a Starcraft 2 mod? If so, how?
2010/07/15
[ "https://gaming.stackexchange.com/questions/1933", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/679/" ]
As the new Starcraft editor is very mighty and supports something like procedures and functions you possibly can enhance available AIs with own stuff. For an example create some triggers like "IF player1 has >x units of this and that type, THEN AIPlayer2 order to tech for this tech" Maybe this style would be a bit too...
Starcraft 2 AIs are written in a scripting language called Galaxy Script. There are a few custom AIs available (some even openSource) at: [Startcraft 2 AI Forum](http://darkblizz.org/Forum2/land-of-ai/)
53,380,402
I have a function that looks at keywords in multiple columns, and lists all unique versions alphabetically in one list. This is the function I have so far: ``` =unique(sort(substitute(query({A2:A;B2:B}, "where Col1 <>''"),"""",""))) ``` I also have a list of keywords in Column C that I do not want to be listed with ...
2018/11/19
[ "https://Stackoverflow.com/questions/53380402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824786/" ]
You can express immediates in both base 10 or hexadecimal. To express an hedacimal value you need to use the `0x` prefix before the numeral (e.g. `0x10`, which is `16` in base 10). If you don't use the prefix `0x` before the numeral, the assembler will assume the numeral is in decimal notation. Using your example, if ...
MIPS `addi` / `addiu` sign-extend the 16-bit immediate to 32 bits ([2's complement](https://en.wikipedia.org/wiki/Two%27s_complement)): Values from `-32768` (0xFFFF8000) to `32767` (0x00007FFFF) are encodeable. MIPS `andi` / `ori` *zero*-extend the 16-bit immediate to 32 bits, Values from `0` (0x00000000) to `65...
9,536,189
I have to recently redirect a site, say Site A to Site B. It should be per page redirection. The site holds top page ranks in related keywords and I am already worried about it. Since I have done .htaccess redirects in past, it was not a problem in beginning. But now I am facing horror. Searching online took me to onl...
2012/03/02
[ "https://Stackoverflow.com/questions/9536189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245390/" ]
I don't see the 'obvious' error, other than that you'd have to write a rule for every url used. Better to use mod\_rewrite: ``` RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^newdomain.example.com$ [NC] RewriteRule ^(.*)$ http://newdomain.example.com/$1 [R=301,L] ```
Not a big .htaccess expert here, but my site's .htaccess has all the URLs on the right-hand side in double quotes. Give it a shot.
9,536,189
I have to recently redirect a site, say Site A to Site B. It should be per page redirection. The site holds top page ranks in related keywords and I am already worried about it. Since I have done .htaccess redirects in past, it was not a problem in beginning. But now I am facing horror. Searching online took me to onl...
2012/03/02
[ "https://Stackoverflow.com/questions/9536189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245390/" ]
I don't see the 'obvious' error, other than that you'd have to write a rule for every url used. Better to use mod\_rewrite: ``` RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^newdomain.example.com$ [NC] RewriteRule ^(.*)$ http://newdomain.example.com/$1 [R=301,L] ```
I've just had this problem and it's because I added `Redirect 301 / http://siteB.com/` at the top. This redirects every link from siteA to siteB.com, regardless of any other redirects below it.
527,566
Is there any way through which i can restrict my AIR app to be further distribution? Say I have make one AIR application and I give this app to my friend. Is there any way so that he can not re distribute this app to any new person?
2009/02/09
[ "https://Stackoverflow.com/questions/527566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21988/" ]
There's nothing built in that will help you solve this, but two ideas come to mind. One choice is to require a serial number on first startup. Validate the serial number against a server using HTTPS and then store it, encrypted, in the local store. You could then validate that machine's use of the serial either on the...
If you restrict your AIR application from distribution, wouldn't that make it impossible for you to give the application to your friend? The only language-agnostic way I can see this be done with any application is that you have your friend come over and have a look on your computer. If you are keen on making the AIR ...
527,566
Is there any way through which i can restrict my AIR app to be further distribution? Say I have make one AIR application and I give this app to my friend. Is there any way so that he can not re distribute this app to any new person?
2009/02/09
[ "https://Stackoverflow.com/questions/527566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21988/" ]
There's nothing built in that will help you solve this, but two ideas come to mind. One choice is to require a serial number on first startup. Validate the serial number against a server using HTTPS and then store it, encrypted, in the local store. You could then validate that machine's use of the serial either on the...
This is a good question. A possible solution to this is certification. However i have a doubt here. Do you want your friend not to distribute this application + no secondary installation is possible with it. Secondary installation means if your friends wants his system to format and reinstall the application. Do you w...
527,566
Is there any way through which i can restrict my AIR app to be further distribution? Say I have make one AIR application and I give this app to my friend. Is there any way so that he can not re distribute this app to any new person?
2009/02/09
[ "https://Stackoverflow.com/questions/527566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21988/" ]
This is a good question. A possible solution to this is certification. However i have a doubt here. Do you want your friend not to distribute this application + no secondary installation is possible with it. Secondary installation means if your friends wants his system to format and reinstall the application. Do you w...
If you restrict your AIR application from distribution, wouldn't that make it impossible for you to give the application to your friend? The only language-agnostic way I can see this be done with any application is that you have your friend come over and have a look on your computer. If you are keen on making the AIR ...
109,127
I have two tables: first for products and second for prices. [![enter image description here](https://i.stack.imgur.com/rCg8S.png)](https://i.stack.imgur.com/rCg8S.png) I need to calculate and display the minimum price from all 5 prices for one product. I already have query to select five prices and dont know what t...
2015/08/05
[ "https://dba.stackexchange.com/questions/109127", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/72203/" ]
Of course your data is denormalized, otherwise it would be a simple `MIN(price)` :-) If you got luck your DBMS supports a LEAST function: ``` LEAST(price_one,price_two,price_three,price_four,price_five), ``` A huge CASE is supported in every DBMS: ``` CASE WHEN price_one <= price_two AND price_one <= price_th...
Using `UNION` in MySQL, this could work: ``` SELECT price.price_id, price.product_id, MIN(price.min_price) AS MinPrice FROM ( SELECT p.price_id, p.product_id, p.price_one AS min_price FROM test.price AS p UNION ALL SELECT p.p...
109,127
I have two tables: first for products and second for prices. [![enter image description here](https://i.stack.imgur.com/rCg8S.png)](https://i.stack.imgur.com/rCg8S.png) I need to calculate and display the minimum price from all 5 prices for one product. I already have query to select five prices and dont know what t...
2015/08/05
[ "https://dba.stackexchange.com/questions/109127", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/72203/" ]
Of course your data is denormalized, otherwise it would be a simple `MIN(price)` :-) If you got luck your DBMS supports a LEAST function: ``` LEAST(price_one,price_two,price_three,price_four,price_five), ``` A huge CASE is supported in every DBMS: ``` CASE WHEN price_one <= price_two AND price_one <= price_th...
It is easy to do if you unpivot the data with SQL Server: ``` Select p.price_id, p.product_id, min(price) From prices as p Unpivot( price for p in (price_one, price_two, price_three, price_four, price_five) ) as p group by p.price_id, p.product_id order by p.price_id ``` Whole query with test data: ``` -- your ...
109,127
I have two tables: first for products and second for prices. [![enter image description here](https://i.stack.imgur.com/rCg8S.png)](https://i.stack.imgur.com/rCg8S.png) I need to calculate and display the minimum price from all 5 prices for one product. I already have query to select five prices and dont know what t...
2015/08/05
[ "https://dba.stackexchange.com/questions/109127", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/72203/" ]
Using `UNION` in MySQL, this could work: ``` SELECT price.price_id, price.product_id, MIN(price.min_price) AS MinPrice FROM ( SELECT p.price_id, p.product_id, p.price_one AS min_price FROM test.price AS p UNION ALL SELECT p.p...
It is easy to do if you unpivot the data with SQL Server: ``` Select p.price_id, p.product_id, min(price) From prices as p Unpivot( price for p in (price_one, price_two, price_three, price_four, price_five) ) as p group by p.price_id, p.product_id order by p.price_id ``` Whole query with test data: ``` -- your ...
11,914,068
My issue is that i have this box aka container. Inside that container there are boxes that the user can click. To visually help the user I made overlay boxes with a gray faded out color that tells them they can use the boxes here. But my issue is that the click event is on the boxes behind the overlay box. So is the...
2012/08/11
[ "https://Stackoverflow.com/questions/11914068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1231901/" ]
You can use the CSS [`pointer-events`](https://developer.mozilla.org/en-US/docs/CSS/pointer-events) property: > > The CSS property `pointer-events` allows authors to control under what circumstances (if any) a particular graphic element can become the target of mouse events. > > > ``` #element { pointer-events:...
Avoiding CSS `pointer-events` ... Firstly, make sure the contained boxes all have the class name `box` (or similar). Secondly, make boxes inactive with `.addClass('inactive')`, (with corresponding CSS directives in the stylesheet to look after the background color and border). To re-activate boxes, simply `.removeCla...
11,914,068
My issue is that i have this box aka container. Inside that container there are boxes that the user can click. To visually help the user I made overlay boxes with a gray faded out color that tells them they can use the boxes here. But my issue is that the click event is on the boxes behind the overlay box. So is the...
2012/08/11
[ "https://Stackoverflow.com/questions/11914068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1231901/" ]
You can use the CSS [`pointer-events`](https://developer.mozilla.org/en-US/docs/CSS/pointer-events) property: > > The CSS property `pointer-events` allows authors to control under what circumstances (if any) a particular graphic element can become the target of mouse events. > > > ``` #element { pointer-events:...
You can use an Immediately Invoked Function Expression (IIFE) developed by [Ivan Castellanos](https://stackoverflow.com/users/800817/ivan-castellanos) that will detect where your mouse pointer is (x,y) and evaluate to true or false on the element of your choice if, in fact, the mouse was over that element. By utilizin...
11,914,068
My issue is that i have this box aka container. Inside that container there are boxes that the user can click. To visually help the user I made overlay boxes with a gray faded out color that tells them they can use the boxes here. But my issue is that the click event is on the boxes behind the overlay box. So is the...
2012/08/11
[ "https://Stackoverflow.com/questions/11914068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1231901/" ]
Avoiding CSS `pointer-events` ... Firstly, make sure the contained boxes all have the class name `box` (or similar). Secondly, make boxes inactive with `.addClass('inactive')`, (with corresponding CSS directives in the stylesheet to look after the background color and border). To re-activate boxes, simply `.removeCla...
You can use an Immediately Invoked Function Expression (IIFE) developed by [Ivan Castellanos](https://stackoverflow.com/users/800817/ivan-castellanos) that will detect where your mouse pointer is (x,y) and evaluate to true or false on the element of your choice if, in fact, the mouse was over that element. By utilizin...
8,869,011
I have tried to order this data below by occur, I used code from microsoft I get a couple of errors, I would like to know how people would tackle this? Thanks. ``` List<Alpha> letters = new List<Alpha> { new Alpha {letter ='A', occur = new List<int>{A}}, new Alpha {letter ='B', occur =...
2012/01/15
[ "https://Stackoverflow.com/questions/8869011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1141945/" ]
Your code doesn't compile because of many typos such as `A` instead of `'A'` , `B` instead of `'B'`, etc. After fixing typos, you actually have an ordered collection: ``` List<Alpha> letters = new List<Alpha> { new Alpha {letter ='A', occur = new List<int>{'A'}}, new Alpha {letter ='B',...
After fixing your typos, this should work for you: ``` var sortedLetters = (from c in letters select c).OrderBy(d=>d.letter) ```
4,963,607
So I'm starting to look into using the EF with POCO and transfering DTO over the wire to client of my WCF. Looks like it's a good architectural design to go with DTO instead of sending POCO over to the client. So I was reading about it and a lot of time it mentionned using the Adapter pattern to convert the POCO to...
2011/02/10
[ "https://Stackoverflow.com/questions/4963607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159527/" ]
[Adapter](http://en.wikipedia.org/wiki/Adapter_pattern) is GoW pattern with exact meaning. You don't need special article to read about using it on top of POCO and DTOs (it is same like with any other classes). But I think you actually don't want a real adapter. You want something which will convert POCO to DTO and vic...
This [post](https://stackoverflow.com/questions/725348/poco-vs-dto) talks about the purity of the two. But as far as converting them from one to the other, I have used extension methods in the past. So before the POCO is being sent over the wire, I have something like this. ``` accountPoco.toDTO() ``` which conver...
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
On dom ready you can target all span elements like ``` jQuery(function($){ $('span[style]').removeAttr('style') }) ``` If you want to target all elements with style attribute ``` $('[style]').removeAttr('style') ```
Simple in Jquery just use following, ``` $("span").removeAttr("style"); $("span").addClass("line"); ```
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
On dom ready you can target all span elements like ``` jQuery(function($){ $('span[style]').removeAttr('style') }) ``` If you want to target all elements with style attribute ``` $('[style]').removeAttr('style') ```
Try this: ``` $(document).ready(function(){ $('span[style]') .removeAttr('style') .addClass('line'); }); ``` If you need to match the underline rule *exactly*, you can add a constraint. Just replace this: ``` $('span[style]') ``` with this: ``` $('span[style="text-decoration: underline;"]') ...
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
On dom ready you can target all span elements like ``` jQuery(function($){ $('span[style]').removeAttr('style') }) ``` If you want to target all elements with style attribute ``` $('[style]').removeAttr('style') ```
``` $( document ).ready(function() { $('span[style]').removeAttr('style').addClass("line") }) ``` This should do
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
On dom ready you can target all span elements like ``` jQuery(function($){ $('span[style]').removeAttr('style') }) ``` If you want to target all elements with style attribute ``` $('[style]').removeAttr('style') ```
See [Demo](https://jsfiddle.net/nazexd7h/) **Html** ``` <p>My mother has <span style="text-decoration: underline;">blue</span> eyes and my father has <span style="text-decoration: underline;">dark green</span> eyes.</p><button onclick="btncheck();">Check</button> ``` **jQuery** ``` $(document).ready(function(){...
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
Check this DEMO : <https://jsfiddle.net/yv5apdaj/> You can do like this, update the css style according to your need. In this way, you still can use other styles and remove the desired css style only. ### JQUERY ``` $(document).ready(function(){ $('span').each(function(){ if($(this).css('text-decoration...
Simple in Jquery just use following, ``` $("span").removeAttr("style"); $("span").addClass("line"); ```
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
Check this DEMO : <https://jsfiddle.net/yv5apdaj/> You can do like this, update the css style according to your need. In this way, you still can use other styles and remove the desired css style only. ### JQUERY ``` $(document).ready(function(){ $('span').each(function(){ if($(this).css('text-decoration...
Try this: ``` $(document).ready(function(){ $('span[style]') .removeAttr('style') .addClass('line'); }); ``` If you need to match the underline rule *exactly*, you can add a constraint. Just replace this: ``` $('span[style]') ``` with this: ``` $('span[style="text-decoration: underline;"]') ...
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
Check this DEMO : <https://jsfiddle.net/yv5apdaj/> You can do like this, update the css style according to your need. In this way, you still can use other styles and remove the desired css style only. ### JQUERY ``` $(document).ready(function(){ $('span').each(function(){ if($(this).css('text-decoration...
``` $( document ).ready(function() { $('span[style]').removeAttr('style').addClass("line") }) ``` This should do
30,521,447
I've tried a few ways but none seem to get the result I want. I'm using `Visual Basic 2010` Express. What I currently have is: ``` Get selected word length I=1 Count =1 FOR count to selectedword length IF Guess.Text = index of selected word THEN word index(I) =index Character = Guess.Text ...
2015/05/29
[ "https://Stackoverflow.com/questions/30521447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4951692/" ]
Check this DEMO : <https://jsfiddle.net/yv5apdaj/> You can do like this, update the css style according to your need. In this way, you still can use other styles and remove the desired css style only. ### JQUERY ``` $(document).ready(function(){ $('span').each(function(){ if($(this).css('text-decoration...
See [Demo](https://jsfiddle.net/nazexd7h/) **Html** ``` <p>My mother has <span style="text-decoration: underline;">blue</span> eyes and my father has <span style="text-decoration: underline;">dark green</span> eyes.</p><button onclick="btncheck();">Check</button> ``` **jQuery** ``` $(document).ready(function(){...
30,677,848
I'm trying the make the scroll functionality between thumbnails of a gallery. so far the thumbnails are scrolling, but there's a small problem though. If the scroll reaches at the last thumbnail it keeps scrolling towards right direction (if you are scrolling towards right) same happening with the left part. 2nd probl...
2015/06/06
[ "https://Stackoverflow.com/questions/30677848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2477599/" ]
You could measure the position of the last `li` in the list by using the [`:last-child`](http://api.jquery.com/last-child-selector/) selector and adjust the max so it reflects the width of the `li`. ``` var min = $('.thumbs li').position().left; var left = $('.thumbs ul:last-child').position().left; var max = $('.thum...
Have you considered an infinitely looping scroll? ```js $('.arrow-next').click(function() { $(".slider").animate({left: "-=25px"}, 600, function(){ var left = $(this).css('left'); $(this).css('left', left == "0px" ? "175px" : left); }); }); $('.arrow-prev').click(function() { $("...
30,677,848
I'm trying the make the scroll functionality between thumbnails of a gallery. so far the thumbnails are scrolling, but there's a small problem though. If the scroll reaches at the last thumbnail it keeps scrolling towards right direction (if you are scrolling towards right) same happening with the left part. 2nd probl...
2015/06/06
[ "https://Stackoverflow.com/questions/30677848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2477599/" ]
Calculate the boundaries of the movement, and make sure that it doesn't scroll outside that. As it scrolls to a negative position the minimum is `-(sum of images - width of thumbs)`, and the maximum is `0`. ``` var left = 0; function scroll(dx) { var width = $('.thumbs').width() - 40; var min = width - $('.th...
Have you considered an infinitely looping scroll? ```js $('.arrow-next').click(function() { $(".slider").animate({left: "-=25px"}, 600, function(){ var left = $(this).css('left'); $(this).css('left', left == "0px" ? "175px" : left); }); }); $('.arrow-prev').click(function() { $("...
30,677,848
I'm trying the make the scroll functionality between thumbnails of a gallery. so far the thumbnails are scrolling, but there's a small problem though. If the scroll reaches at the last thumbnail it keeps scrolling towards right direction (if you are scrolling towards right) same happening with the left part. 2nd probl...
2015/06/06
[ "https://Stackoverflow.com/questions/30677848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2477599/" ]
Calculate the boundaries of the movement, and make sure that it doesn't scroll outside that. As it scrolls to a negative position the minimum is `-(sum of images - width of thumbs)`, and the maximum is `0`. ``` var left = 0; function scroll(dx) { var width = $('.thumbs').width() - 40; var min = width - $('.th...
You could measure the position of the last `li` in the list by using the [`:last-child`](http://api.jquery.com/last-child-selector/) selector and adjust the max so it reflects the width of the `li`. ``` var min = $('.thumbs li').position().left; var left = $('.thumbs ul:last-child').position().left; var max = $('.thum...
8,181,451
I have a scene in andEngine. The scene has basically three animated objects. I want to add and remove means show and hide on the screen. Hows that possible?
2011/11/18
[ "https://Stackoverflow.com/questions/8181451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/922140/" ]
Keep in mind that I don't own an Android phone, and I have never used this API. I think you'd need to add and remove sprites to the scene-graph: * Removing: <http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/SpriteRemoveExample.java> Example code: ``` scene.detachChild(child...
To remove an object from a scene: (in this case a Sprite object but you can remove any entity) ``` scene.getTopLayer().removeEntity(sprite); ``` To hide a scene: ``` scene.back(); ```
70,734,488
I just started learning Haskell and have a problem writing a basic function. This function should tell me for how many elements of an array the previous element is bigger than the current one. Here's the code: ```hs countIncreases :: (Ord a, Num b) => [a] -> b -> b countIncreases [x] c = c countIncreases (x:y:r) c ...
2022/01/16
[ "https://Stackoverflow.com/questions/70734488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6466206/" ]
You forgot to consider the empty list (`[]`) case: ``` countIncreases :: (Ord a, Num b) => [a] -> b -> b countIncreases [x] c = c countIncreases (x:y:r) c | y > x = countIncreases (y:r) (c+1) | otherwise = countIncreases (y:r) c countIncreases [] c = c -- here! ``` If you think the function should never be c...
Thank you guys for answering my question. Turns out the root of the problem was something different. Key thing is the fact that I was using `ghci` and inserting the overloads line by line thinking each line adds an overload to the function definition. Turns out with each line I was overwriting the previous input. So th...
70,734,488
I just started learning Haskell and have a problem writing a basic function. This function should tell me for how many elements of an array the previous element is bigger than the current one. Here's the code: ```hs countIncreases :: (Ord a, Num b) => [a] -> b -> b countIncreases [x] c = c countIncreases (x:y:r) c ...
2022/01/16
[ "https://Stackoverflow.com/questions/70734488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6466206/" ]
If you run your function, it will not produce an error, if you however compile the code where you turn on the `-Wincomplete-patterns`, and treat warnings as errors (`-Werror`), it will error on this. The reason this happens is because you can not run this function with an empty list. Indeed, if you call it with an emp...
Thank you guys for answering my question. Turns out the root of the problem was something different. Key thing is the fact that I was using `ghci` and inserting the overloads line by line thinking each line adds an overload to the function definition. Turns out with each line I was overwriting the previous input. So th...
32,863,097
I would like to know how to manipulate the DOM of the current page using PHP. The explanation is as below: This is the code in my PHP file: ``` <div id="edittitle" title="Editing title"> <b>1</b> </div> $strhtml=; libxml_use_internal_errors( true ); $dom=new DOMDocument('1.0','utf-8'); $dom->validateOnPar...
2015/09/30
[ "https://Stackoverflow.com/questions/32863097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4497866/" ]
If you really want to you can do this by putting all of your HTML in an output buffer while / before sending it to the browser (the latter can be easily done with [output control](https://secure.php.net/manual/en/ref.outcontrol.php)). Then you can DOM parse the "captured" HTML. But you should ask yourself what you are...
PHP is a server-side language and is **only** executed on the server, any DOM manipulations must be handled by client-side Javascript. <http://callmenick.com/post/basics-javascript-dom-manipulation>
71,330,362
Is it even possible to do select with links that when you click submit button it will move you to the selected website, for example ``` <form> <select> <option value="1"> test 1 </option> <option value="http://www.google.com"> google.com </option> <option value="http://www.yout...
2022/03/02
[ "https://Stackoverflow.com/questions/71330362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18358697/" ]
A better and simpler way. **c#** ``` void Main() { const string filename = @"e:\Temp\Sample.xml"; XDocument xdoc = XDocument.Load(filename); XNamespace aw = "http://www.adventure-works.com"; foreach (XElement el in xdoc.Descendants(aw + "Item")) { Console.WriteLine("#####################...
If you read the documentation for [Element](https://learn.microsoft.com/en-us/dotnet/api/system.xml.linq.xcontainer.element?view=net-6.0), it says: > > Gets the **first** (in document order) child element with the specified > XName. > > > Please notice how it says "first child". In your case you want to retrieve ...
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
Google documented how they did fast paxos for their megastore in the following paper: [Link](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/36971.pdf).
[Raft](https://raft.github.io/) is more understandable, and faster alternative of Paxos. One of the most popular distributed systems which uses Raft is [Etcd](https://github.com/etcd-io/etcd). Etcd is the distributed store used in Kubernetes. It's equivalent to Paxos in fault-tolerance.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
Not sure if this is helpful (since this is not from actual production information), but in our "distributed systems" course we've studied, along with Paxos, the **Chandra-Toueg** and **Mostefaoui-Raynal** algorithms (of the latter our professor was especially fond).
You should check the Apache Zookeeper project. It is used in production by Yahoo! and Facebook among others. <http://hadoop.apache.org/zookeeper/> If you look for academic papers describing it, it is described in a paper at usenix ATC'10. The consensus protocol (a variant of Paxos) is described in a paper at DSN'11.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
You should check the Apache Zookeeper project. It is used in production by Yahoo! and Facebook among others. <http://hadoop.apache.org/zookeeper/> If you look for academic papers describing it, it is described in a paper at usenix ATC'10. The consensus protocol (a variant of Paxos) is described in a paper at DSN'11.
[Raft](https://raft.github.io/) is more understandable, and faster alternative of Paxos. One of the most popular distributed systems which uses Raft is [Etcd](https://github.com/etcd-io/etcd). Etcd is the distributed store used in Kubernetes. It's equivalent to Paxos in fault-tolerance.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
Paxos is *optimal* in terms of performance of consensus protocols, at least in terms of the number of network delays (which is often the dominating factor). It's clearly not possible to reliably achieve consensus while tolerating up to *f* failures without a single round-trip communication to at least *(f-1)* other nod...
With Multi-Paxos when the leader is galloping it can respond to the client write when it has heard that the majority of nodes have written the value to disk. This is as good and efficient as you can get to maintain the consistency guarantees that Paxos makes. Typically though people use something paxos-like such as z...
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
The Paxos system I run (which supports really, really big web sites) is halfway in-between Basic-Paxos Multi-paxos. I plan on moving it to a full Multi-Paxos implementation. Paxos isn't that great as a high-throughput data storage system, but it excels in supporting those systems by providing leader election. For exam...
You should check the Apache Zookeeper project. It is used in production by Yahoo! and Facebook among others. <http://hadoop.apache.org/zookeeper/> If you look for academic papers describing it, it is described in a paper at usenix ATC'10. The consensus protocol (a variant of Paxos) is described in a paper at DSN'11.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
If performance is an issue, consider whether you need all of the strong consistency guarantees Paxos gives you. See e.g. <http://queue.acm.org/detail.cfm?id=1466448> and <http://incubator.apache.org/cassandra/>. Searching on Paxos optimised gets me hits, but I suspect that relaxing some of the requirements will buy you...
Google documented how they did fast paxos for their megastore in the following paper: [Link](http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/36971.pdf).
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
Not sure if this is helpful (since this is not from actual production information), but in our "distributed systems" course we've studied, along with Paxos, the **Chandra-Toueg** and **Mostefaoui-Raynal** algorithms (of the latter our professor was especially fond).
[Raft](https://raft.github.io/) is more understandable, and faster alternative of Paxos. One of the most popular distributed systems which uses Raft is [Etcd](https://github.com/etcd-io/etcd). Etcd is the distributed store used in Kubernetes. It's equivalent to Paxos in fault-tolerance.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
If performance is an issue, consider whether you need all of the strong consistency guarantees Paxos gives you. See e.g. <http://queue.acm.org/detail.cfm?id=1466448> and <http://incubator.apache.org/cassandra/>. Searching on Paxos optimised gets me hits, but I suspect that relaxing some of the requirements will buy you...
You should check the Apache Zookeeper project. It is used in production by Yahoo! and Facebook among others. <http://hadoop.apache.org/zookeeper/> If you look for academic papers describing it, it is described in a paper at usenix ATC'10. The consensus protocol (a variant of Paxos) is described in a paper at DSN'11.
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
Paxos is *optimal* in terms of performance of consensus protocols, at least in terms of the number of network delays (which is often the dominating factor). It's clearly not possible to reliably achieve consensus while tolerating up to *f* failures without a single round-trip communication to at least *(f-1)* other nod...
There are two general blockchain consensus systems: 1. Those that produce unambiguous 100% finality given a defined set of validators 2. Those which do not provide 100% finality but instead rely on high probability of finality. The first generation blockchain consensus algorithms (Proof of Work, Proof of Stake, and ...
1,997,825
I've read Lamport's [paper](http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf) on Paxos. I've also heard that it isn't used much in practice, for reasons of performance. What algorithms are commonly used for consensus in distributed systems?
2010/01/04
[ "https://Stackoverflow.com/questions/1997825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/688/" ]
The Paxos system I run (which supports really, really big web sites) is halfway in-between Basic-Paxos Multi-paxos. I plan on moving it to a full Multi-Paxos implementation. Paxos isn't that great as a high-throughput data storage system, but it excels in supporting those systems by providing leader election. For exam...
With Multi-Paxos when the leader is galloping it can respond to the client write when it has heard that the majority of nodes have written the value to disk. This is as good and efficient as you can get to maintain the consistency guarantees that Paxos makes. Typically though people use something paxos-like such as z...
16,083,884
Is it possible in any way to do the following without have to pass through temporary observables / computed observables? I have common data which is used for lookups to display data: ``` <span data-bind="text: lookupContactName(31)"></span> ``` result: function is exectuded, parameter is found, logic ok, and compute...
2013/04/18
[ "https://Stackoverflow.com/questions/16083884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1958480/" ]
If your `<span data-bind="text: lookupContactName(contactId())"></span>` is in a foreach loop then you need to prepend the method with $root or else it will look for "lookupContactName" within the array it is looping trough. Try: ``` <div>Creator: <span data-bind="text: $root.lookupContactName(contactId())"></span><...
I'm not so sure to understand what is your problem here. You can do something like that if you want: ``` function lookupContactName(cid) { var obj = ... // Find your object by id; return ko.computed(function () { return obj.name() + obj.lastname(); }); } ``` It should just work.
16,083,884
Is it possible in any way to do the following without have to pass through temporary observables / computed observables? I have common data which is used for lookups to display data: ``` <span data-bind="text: lookupContactName(31)"></span> ``` result: function is exectuded, parameter is found, logic ok, and compute...
2013/04/18
[ "https://Stackoverflow.com/questions/16083884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1958480/" ]
Problem is that you lookup function doesn't return a value ``` ko.utils.arrayForEach(contactList(), function (contact) { // some checking code return contact.fullName(); }); ``` your "return" is related to inner function passed to arrayForEach utility method. You need a code like this ``` var result; ko.utils.a...
I'm not so sure to understand what is your problem here. You can do something like that if you want: ``` function lookupContactName(cid) { var obj = ... // Find your object by id; return ko.computed(function () { return obj.name() + obj.lastname(); }); } ``` It should just work.
16,083,884
Is it possible in any way to do the following without have to pass through temporary observables / computed observables? I have common data which is used for lookups to display data: ``` <span data-bind="text: lookupContactName(31)"></span> ``` result: function is exectuded, parameter is found, logic ok, and compute...
2013/04/18
[ "https://Stackoverflow.com/questions/16083884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1958480/" ]
If your `<span data-bind="text: lookupContactName(contactId())"></span>` is in a foreach loop then you need to prepend the method with $root or else it will look for "lookupContactName" within the array it is looping trough. Try: ``` <div>Creator: <span data-bind="text: $root.lookupContactName(contactId())"></span><...
Problem is that you lookup function doesn't return a value ``` ko.utils.arrayForEach(contactList(), function (contact) { // some checking code return contact.fullName(); }); ``` your "return" is related to inner function passed to arrayForEach utility method. You need a code like this ``` var result; ko.utils.a...
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
``` TimeSpan span = end-start; double totalMinutes = span.TotalMinutes; ```
See [TimeSpan.TotalMinutes](http://msdn.microsoft.com/en-us/library/system.timespan.totalminutes.aspx): > > Gets the value of the current TimeSpan structure expressed in whole and fractional minutes. > > >
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
I would do it like this: ``` int totalMinutes = (int)(end - start).TotalMinutes; ```
See [TimeSpan.TotalMinutes](http://msdn.microsoft.com/en-us/library/system.timespan.totalminutes.aspx): > > Gets the value of the current TimeSpan structure expressed in whole and fractional minutes. > > >
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
Why not just doing it this way? ``` DateTime dt1 = new DateTime(2009, 6, 1); DateTime dt2 = DateTime.Now; double totalminutes = (dt2 - dt1).TotalMinutes; ``` Hope this helps.
See [TimeSpan.TotalMinutes](http://msdn.microsoft.com/en-us/library/system.timespan.totalminutes.aspx): > > Gets the value of the current TimeSpan structure expressed in whole and fractional minutes. > > >
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
``` TimeSpan span = end-start; double totalMinutes = span.TotalMinutes; ```
I would do it like this: ``` int totalMinutes = (int)(end - start).TotalMinutes; ```
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
``` TimeSpan span = end-start; double totalMinutes = span.TotalMinutes; ```
Why not just doing it this way? ``` DateTime dt1 = new DateTime(2009, 6, 1); DateTime dt2 = DateTime.Now; double totalminutes = (dt2 - dt1).TotalMinutes; ``` Hope this helps.
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
``` TimeSpan span = end-start; double totalMinutes = span.TotalMinutes; ```
``` double totalMinutes = (end-start).TotalMinutes; ```
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
Why not just doing it this way? ``` DateTime dt1 = new DateTime(2009, 6, 1); DateTime dt2 = DateTime.Now; double totalminutes = (dt2 - dt1).TotalMinutes; ``` Hope this helps.
I would do it like this: ``` int totalMinutes = (int)(end - start).TotalMinutes; ```
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
I would do it like this: ``` int totalMinutes = (int)(end - start).TotalMinutes; ```
``` double totalMinutes = (end-start).TotalMinutes; ```
1,030,869
To get TimeSpan in minutes from given two Dates I am doing the following ``` int totalMinutes = 0; TimeSpan outresult = end.Subtract(start); totalMinutes = totalMinutes + ((end.Subtract(start).Days) * 24 * 60) + ((end.Subtract(start).Hours) * 60) +(end.Subtract(start).Minutes); return totalMinutes; ``` Is there a be...
2009/06/23
[ "https://Stackoverflow.com/questions/1030869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85952/" ]
Why not just doing it this way? ``` DateTime dt1 = new DateTime(2009, 6, 1); DateTime dt2 = DateTime.Now; double totalminutes = (dt2 - dt1).TotalMinutes; ``` Hope this helps.
``` double totalMinutes = (end-start).TotalMinutes; ```
37,744,629
I am using node.js `request` module to fetch an id\_token from an API. After fetching that id\_token I want to send a `redirect uri` response with a `set-cookie header to the redirected url`. But I can't quite figure out how to do it. Here is my code: ``` app.use("/nodejs-server/retrieveCode", function(req, res) { ...
2016/06/10
[ "https://Stackoverflow.com/questions/37744629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5928186/" ]
After lots of trials and errors and googling I was finally able to achieve my goal. In order to send a cookie with an expiry to the the redirect URL, I just added ```js const expires = body.exp.toUTCString(); res.cookie('id_token', body.id_token, { expires }); res.redirect(302, 'http://localhost:8080'); ```
in express 4.16.3 , you must set > > res.cookie() > > > before > > res.redirect() > > > and it works for me, without error
233,882
I used to think that maximum trophies obtainable in multiplayer attacks is 34. Because from my past experiences I have not seen a value greater than 34. Today while searching for an opponent in multiplayer I came across a village that would yield 40 trophies if I had 3 starred it.(however I was able to make only 2 st...
2015/08/31
[ "https://gaming.stackexchange.com/questions/233882", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/90465/" ]
I'm pretty sure the game doesn't let you do this. As Byzantine Emperor, I tried to grant the Bishopric of Alexandria to the Ecumenical Patriarch after I captured it in a holy war, but it wouldn't let me. It didn't even show up in the list titles. I could give him any other bishopric in the Duchy of Alexandria, and I co...
The titles will stay together, since they have the same succession laws. But are you able to give all the pentarchies to the Ecummental Patriarch? Following a recent update i noticed that i cannot give more than one duchy to an prince-archbishop, and got the message "Cannot give more than one duchy or kingdom to theoc...
233,882
I used to think that maximum trophies obtainable in multiplayer attacks is 34. Because from my past experiences I have not seen a value greater than 34. Today while searching for an opponent in multiplayer I came across a village that would yield 40 trophies if I had 3 starred it.(however I was able to make only 2 st...
2015/08/31
[ "https://gaming.stackexchange.com/questions/233882", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/90465/" ]
There is something you can do: conquer the specified target, as Alexandria. Now, you must own both the province and the Bishopric of Alexandria. Make the Bishopric your primary title then give the county of Alexandria to your Ecumenical Patirach.
The titles will stay together, since they have the same succession laws. But are you able to give all the pentarchies to the Ecummental Patriarch? Following a recent update i noticed that i cannot give more than one duchy to an prince-archbishop, and got the message "Cannot give more than one duchy or kingdom to theoc...
233,882
I used to think that maximum trophies obtainable in multiplayer attacks is 34. Because from my past experiences I have not seen a value greater than 34. Today while searching for an opponent in multiplayer I came across a village that would yield 40 trophies if I had 3 starred it.(however I was able to make only 2 st...
2015/08/31
[ "https://gaming.stackexchange.com/questions/233882", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/90465/" ]
I'm pretty sure the game doesn't let you do this. As Byzantine Emperor, I tried to grant the Bishopric of Alexandria to the Ecumenical Patriarch after I captured it in a holy war, but it wouldn't let me. It didn't even show up in the list titles. I could give him any other bishopric in the Duchy of Alexandria, and I co...
There is something you can do: conquer the specified target, as Alexandria. Now, you must own both the province and the Bishopric of Alexandria. Make the Bishopric your primary title then give the county of Alexandria to your Ecumenical Patirach.
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
You are confusing virtual functions calls and overload resolution. All derived classes have vtables containing all virtual functions, from the base class and any additional own virtual functions. This is used to resolve calls at **runtime**, like in your case 2). In case 1) you get an error from overload resolution a...
Since you declared the second `obj` as a `Base*`, the vtable gives it all the methods of `Base`. Although for virtual methods which have been overriden by `Derived`, the overriden versions are called, the other methods (or method overloads) are still those that have been declared in `Base`. However, if you declared th...
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
Basically, function overloading happens only when the functions of same name are defined in the same scope.Now, Base class has its own scope and derived class has its own. So, when u don't redefine a function in the derived class and call that function, the compiler checks the scope of derived, discovers that there i...
Since you declared the second `obj` as a `Base*`, the vtable gives it all the methods of `Base`. Although for virtual methods which have been overriden by `Derived`, the overriden versions are called, the other methods (or method overloads) are still those that have been declared in `Base`. However, if you declared th...
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
You want to override overloaded function but hiding rules don't work like this. "The hiding rule says that an entity in an inner scope hides things with the same name in an outer scope." Note, it is irrelevant that it has different signature i.e. `gogo(int* a)` will hide all `gogo(whatever)` functions from the Base. ...
Since you declared the second `obj` as a `Base*`, the vtable gives it all the methods of `Base`. Although for virtual methods which have been overriden by `Derived`, the overriden versions are called, the other methods (or method overloads) are still those that have been declared in `Base`. However, if you declared th...
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
You are confusing virtual functions calls and overload resolution. All derived classes have vtables containing all virtual functions, from the base class and any additional own virtual functions. This is used to resolve calls at **runtime**, like in your case 2). In case 1) you get an error from overload resolution a...
Basically, function overloading happens only when the functions of same name are defined in the same scope.Now, Base class has its own scope and derived class has its own. So, when u don't redefine a function in the derived class and call that function, the compiler checks the scope of derived, discovers that there i...
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
You are confusing virtual functions calls and overload resolution. All derived classes have vtables containing all virtual functions, from the base class and any additional own virtual functions. This is used to resolve calls at **runtime**, like in your case 2). In case 1) you get an error from overload resolution a...
You want to override overloaded function but hiding rules don't work like this. "The hiding rule says that an entity in an inner scope hides things with the same name in an outer scope." Note, it is irrelevant that it has different signature i.e. `gogo(int* a)` will hide all `gogo(whatever)` functions from the Base. ...
10,173,212
By default the next item in wp7 panorama bleeds into the currently selected panorama item by a few pixels and I would like to show a bit more of the next item. Is there a way to control the amount of pixels? I tried setting margins and paddings and tried editing the controlTemplate, but had no success.
2012/04/16
[ "https://Stackoverflow.com/questions/10173212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462704/" ]
You want to override overloaded function but hiding rules don't work like this. "The hiding rule says that an entity in an inner scope hides things with the same name in an outer scope." Note, it is irrelevant that it has different signature i.e. `gogo(int* a)` will hide all `gogo(whatever)` functions from the Base. ...
Basically, function overloading happens only when the functions of same name are defined in the same scope.Now, Base class has its own scope and derived class has its own. So, when u don't redefine a function in the derived class and call that function, the compiler checks the scope of derived, discovers that there i...
28,357,785
Let's say I have two objects like ``` var a = { b: 1, c: this.b }; ``` And ``` var funcObj = { b : function() { return 1; }, c: function() { console.log(return this.b()) } } ``` On logging these two like ``` console.log(a.c)//results undefined console.log(funcObj.c()) //re...
2015/02/06
[ "https://Stackoverflow.com/questions/28357785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3932668/" ]
The answer depends on what `this` refers to in each context. In JavaScript, `this` is bound to whatever object was on the left of the dot (.) when the current function was called. If we're not in a function, things get a little hairier -- `this` is either the global `window` object or `undefined`, depending on the envi...
I know this post is a bit old, but I came across it while trying to figure out how to solve a similar issue. I was wanting to do something like: ``` const x = { a: 12, b: a + 1 } console.log(x) //results undefined ``` (That's extremely simplified compared to what I was actually doing, but the principle is the s...
28,357,785
Let's say I have two objects like ``` var a = { b: 1, c: this.b }; ``` And ``` var funcObj = { b : function() { return 1; }, c: function() { console.log(return this.b()) } } ``` On logging these two like ``` console.log(a.c)//results undefined console.log(funcObj.c()) //re...
2015/02/06
[ "https://Stackoverflow.com/questions/28357785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3932668/" ]
You cannot refer to other properties in the declaration as part of a Javascript literal declaration. So, in your Javascript literal declaration: ``` var a = { b: 1, c: this.b }; ``` `this` is not set to what you want and `a` has not yet been initialized yet so you can't refer to it either. There is simply no...
I know this post is a bit old, but I came across it while trying to figure out how to solve a similar issue. I was wanting to do something like: ``` const x = { a: 12, b: a + 1 } console.log(x) //results undefined ``` (That's extremely simplified compared to what I was actually doing, but the principle is the s...
38,462
In the US, which part of the government is holding the money due to federal employees? During a government shutdown, what happens to this money? Is it reinvested through short-term lending?
2019/02/01
[ "https://politics.stackexchange.com/questions/38462", "https://politics.stackexchange.com", "https://politics.stackexchange.com/users/2690/" ]
From the perspective of the U.S. Constitution, all of the US government's money is in the Treasury of the United States. Money comes out of there and goes to whoever gets it in accordance with legislation passed by Congress. If there is no such legislation, the money stays there. While it has become the habit of some ...
To add on to EvilSnack's answer more on point to what happens to the money in the Treasury viz "reinvestment through short term lending". It would be wonderful if that were the case.... Unfortunately there is little to no money to do that with - to the tune of almost $22T in debt. For a more exact reading see <http://w...