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
27,302,899
I have a text line with a fixed given count of numbers and strings like this: ``` set line " 0.123 -0.1 +0.31 +1.4 foo bar " ``` I tried to use regexp to pull out all the numbers and 'bar'. I don't need the string 'foo'. This finds a single number: ([-+]?(\d+.\d\*)) To capture the set of numbers I could concatena...
2014/12/04
[ "https://Stackoverflow.com/questions/27302899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2200539/" ]
Well, there's no other way than concatenating the regexp... ``` set line " 0.123 -0.1 +0.31 +1.4 foo bar " regexp {([-+]?\d+\.\d*) ([-+]?\d+\.\d*) ([-+]?\d+\.\d*) ([-+]?\d+\.\d*) (\S+) (\S+)} $line dummy n0 n1 n2 n3 s0 s1 ``` `\S+` will match any non-space character. I have used it assuming that neither `foo` nor `b...
`split` and `lassign` would be easier: ``` set line " 0.123 -0.1 +0.31 +1.4 foo bar " set fields [split [string trim $line]] if {[llength $fields] != 6} continue ;# handle missing fields somehow lassign $fields n0 n1 n2 n3 s0 s1 puts "$n0:$n1:$n2:$n3:$s0:$s1" ``` ``` 0.123:-0.1:+0.31:+1.4:foo:bar ``` Otherwise i...
7,173,533
I find myself writing lots and lots of boiler plate tests these days and I want to optimize away a lot of these basic tests in a clean way that can be added to all the current test classes without a lot of hassle. Here is a basic test class: ``` class MyClassTest { @Test public void doesWhatItDoes() { ...
2011/08/24
[ "https://Stackoverflow.com/questions/7173533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/812374/" ]
Two ideas. **Idea 1:** Use `Assume` > > A set of methods useful for stating assumptions about the conditions in which a test is meaningful. A failed assumption does not mean the code is broken, but that the test provides no useful information. The default JUnit runner treats tests with failing assumptions as ignored...
Most pragmatic solution within existing capabilities of JUnit is to have a single annotated test: ``` @Test void followsStandardJavaLibraryProtocols() { if (implementsInterface(Serializable.class) { testSerialisableInterface ... ``` Breaks various abstract principles of TDD, but works, with no u...
7,173,533
I find myself writing lots and lots of boiler plate tests these days and I want to optimize away a lot of these basic tests in a clean way that can be added to all the current test classes without a lot of hassle. Here is a basic test class: ``` class MyClassTest { @Test public void doesWhatItDoes() { ...
2011/08/24
[ "https://Stackoverflow.com/questions/7173533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/812374/" ]
Two ideas. **Idea 1:** Use `Assume` > > A set of methods useful for stating assumptions about the conditions in which a test is meaningful. A failed assumption does not mean the code is broken, but that the test provides no useful information. The default JUnit runner treats tests with failing assumptions as ignored...
Your approach seems like a valid one to me. I don't have a problem with it. I do this slightly differently. I would create another single test which tests all of your Serializable classes: ``` public class SerializablesTest { @Test public void serializes() { testSerializable(MyClass.class); te...
72,693,322
I am parsing an XML file in C#, how I can make sure the code is not breaking if XML does not have one of these fields I am parsing? I don't want to through an exception as well. ``` StringBuilder output = new StringBuilder(); var xDocument = XDocument.Load(filePath); string xml = xDocument.ToSt...
2022/06/20
[ "https://Stackoverflow.com/questions/72693322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2522162/" ]
You can add a generic type and make the return type depend on the generic param instead of on the actual result. This approach helps the consumers of your function, but doesn't protect your function itself: ```js type PlaneOrCar<T extends PossibleObjects> = T extends 'plane' ? Plane : Car; type PlaneOrCarPar<T exte...
Try explicitly casting the Type. ```js const bmw = vehicleFactory('car') as Car; ``` More information here: <https://stackoverflow.com/a/67909863/15407577> Or if you'd rather change the design of your classes you could create a parent class that is implemented differently by the sub-classes. Something like below. ...
72,693,322
I am parsing an XML file in C#, how I can make sure the code is not breaking if XML does not have one of these fields I am parsing? I don't want to through an exception as well. ``` StringBuilder output = new StringBuilder(); var xDocument = XDocument.Load(filePath); string xml = xDocument.ToSt...
2022/06/20
[ "https://Stackoverflow.com/questions/72693322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2522162/" ]
Just like @Etheryte said, you need to use function overloadings: ```js class Car { drive() { console.log('Driving!') } } class Plane { fly() { console.log('Flying!') } } function vehicleFactory(wantedObject: 'car'): Car function vehicleFactory(wantedObject: 'plane'): Plane function vehicleFactory(wan...
Try explicitly casting the Type. ```js const bmw = vehicleFactory('car') as Car; ``` More information here: <https://stackoverflow.com/a/67909863/15407577> Or if you'd rather change the design of your classes you could create a parent class that is implemented differently by the sub-classes. Something like below. ...
72,693,322
I am parsing an XML file in C#, how I can make sure the code is not breaking if XML does not have one of these fields I am parsing? I don't want to through an exception as well. ``` StringBuilder output = new StringBuilder(); var xDocument = XDocument.Load(filePath); string xml = xDocument.ToSt...
2022/06/20
[ "https://Stackoverflow.com/questions/72693322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2522162/" ]
Just like @Etheryte said, you need to use function overloadings: ```js class Car { drive() { console.log('Driving!') } } class Plane { fly() { console.log('Flying!') } } function vehicleFactory(wantedObject: 'car'): Car function vehicleFactory(wantedObject: 'plane'): Plane function vehicleFactory(wan...
You can add a generic type and make the return type depend on the generic param instead of on the actual result. This approach helps the consumers of your function, but doesn't protect your function itself: ```js type PlaneOrCar<T extends PossibleObjects> = T extends 'plane' ? Plane : Car; type PlaneOrCarPar<T exte...
59,479,626
I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error. ``` django-admin.py startproject learning_log. ``` " CommandError: 'learning\_log.' is not a valid project name. Please make sure the name is a valid identifier. " With my virtual environment activated I am...
2019/12/25
[ "https://Stackoverflow.com/questions/59479626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12587593/" ]
Just add a space after learning\_log and then place the point/period ; Ex :- django-admin.py startproject learning\_log .
My guess is that the error is caused by the `.` in the end of the project name. Tried the same and got the same error. Try to specify a different name (without a dot). The same applies to app names, so, for example ``` python manage.py startapp second_app/ ``` will give a similar error.
59,479,626
I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error. ``` django-admin.py startproject learning_log. ``` " CommandError: 'learning\_log.' is not a valid project name. Please make sure the name is a valid identifier. " With my virtual environment activated I am...
2019/12/25
[ "https://Stackoverflow.com/questions/59479626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12587593/" ]
You just remove '.' at the end and run below command. > > django-admin.py startproject learning\_log > > > * No space is required at the end of the line. As per PEP-8 guide, you should only use lower case letters, and '\_'(underscore) to create a project. * Do not provide iphen(-) or space or other special symbol...
My guess is that the error is caused by the `.` in the end of the project name. Tried the same and got the same error. Try to specify a different name (without a dot). The same applies to app names, so, for example ``` python manage.py startapp second_app/ ``` will give a similar error.
59,479,626
I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error. ``` django-admin.py startproject learning_log. ``` " CommandError: 'learning\_log.' is not a valid project name. Please make sure the name is a valid identifier. " With my virtual environment activated I am...
2019/12/25
[ "https://Stackoverflow.com/questions/59479626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12587593/" ]
You just remove '.' at the end and run below command. > > django-admin.py startproject learning\_log > > > * No space is required at the end of the line. As per PEP-8 guide, you should only use lower case letters, and '\_'(underscore) to create a project. * Do not provide iphen(-) or space or other special symbol...
Just add a space after learning\_log and then place the point/period ; Ex :- django-admin.py startproject learning\_log .
59,479,626
I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error. ``` django-admin.py startproject learning_log. ``` " CommandError: 'learning\_log.' is not a valid project name. Please make sure the name is a valid identifier. " With my virtual environment activated I am...
2019/12/25
[ "https://Stackoverflow.com/questions/59479626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12587593/" ]
Just add a space after learning\_log and then place the point/period ; Ex :- django-admin.py startproject learning\_log .
Keep the space between `learning_log` and `.`: ``` django-admin.py startproject learning_log . ```
59,479,626
I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error. ``` django-admin.py startproject learning_log. ``` " CommandError: 'learning\_log.' is not a valid project name. Please make sure the name is a valid identifier. " With my virtual environment activated I am...
2019/12/25
[ "https://Stackoverflow.com/questions/59479626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12587593/" ]
You just remove '.' at the end and run below command. > > django-admin.py startproject learning\_log > > > * No space is required at the end of the line. As per PEP-8 guide, you should only use lower case letters, and '\_'(underscore) to create a project. * Do not provide iphen(-) or space or other special symbol...
Keep the space between `learning_log` and `.`: ``` django-admin.py startproject learning_log . ```
74,304,992
I read various articles and found that the latest versions of Windows support the `cURL` command via the `command prompt` right out of the box without any installation. So I am trying to make a simple `cURL` request to my local web server, but it is unable to make the request and get the response. It may be because the...
2022/11/03
[ "https://Stackoverflow.com/questions/74304992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7584240/" ]
``` WITH data(transaction_date, item_ids) AS ( SELECT TO_DATE('10/11/2022','MM/DD/YYYY'), 'a;b;z' FROM DUAL UNION ALL SELECT TO_DATE('10/10/2022','MM/DD/YYYY'), 'a;d' FROM DUAL UNION ALL SELECT TO_DATE('10/9/2022','MM/DD/YYYY'), 'a;b;d;z' FROM DUAL UNION ALL SELECT TO_DATE('10/8/2022','MM/DD/...
You can accomplish this with a CTE and `regexp_substr`: ``` with transactions as ( select regexp_substr(tbl.Item_ids, '[^;]+', 1, level) Item_id , tbl.Transaction_date from tbl connect by level < length(replace(tbl.Item_ids, ';', '')) + 1 ) select Item_id , max(Transaction_date) Latest_transact...
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
Instead of your second loop just use: ``` Label1.Text = string.Join("," , interestitems); ``` --- **P.S.** if you're using .net 3.5, you need to pass an array of strings to `string.Join()`, then : ``` Label1.Text = string.Join("," , interestitems.ToArray()); ``` --- **EDIT:** If you want to completely avoid l...
How about LINQ: ``` Label1.Text = string.Join( ",", ListBox1.Items .OfType<ListItem>() .Where(item => item.Selected) .Select(x => x.Value.ToString()) .ToArray() ); ```
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
Instead of your second loop just use: ``` Label1.Text = string.Join("," , interestitems); ``` --- **P.S.** if you're using .net 3.5, you need to pass an array of strings to `string.Join()`, then : ``` Label1.Text = string.Join("," , interestitems.ToArray()); ``` --- **EDIT:** If you want to completely avoid l...
You can replace all of your code with some LINQ: ``` Label1.Text = String.Join(", ", ListBox1.Items.Cast<ListItem>() .Where(i => i.Selected) .Select(i => i.Value.ToString()) ); ``` In .Net 3.5, you'll need to add `.ToArray()`.
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
Instead of your second loop just use: ``` Label1.Text = string.Join("," , interestitems); ``` --- **P.S.** if you're using .net 3.5, you need to pass an array of strings to `string.Join()`, then : ``` Label1.Text = string.Join("," , interestitems.ToArray()); ``` --- **EDIT:** If you want to completely avoid l...
I believe you can do this: ``` interestitems.IndexOf(inteitem); ``` Altought it worked me with other item types, may give you an idea. I haven't checked if it works with strings. The you just have to eliminate the last one, with the index check if it's the last ones with interestitems.Count
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
Instead of your second loop just use: ``` Label1.Text = string.Join("," , interestitems); ``` --- **P.S.** if you're using .net 3.5, you need to pass an array of strings to `string.Join()`, then : ``` Label1.Text = string.Join("," , interestitems.ToArray()); ``` --- **EDIT:** If you want to completely avoid l...
Why not just build up the string as you iterate during the first loop ``` var builder = new StringBuilder(); var first = true; foreach (var item in ListBox1.Items) { if (item.Selected) { if (!first) { builder.Append(", "); } first = false; builder.Append(item.Value.ToString()); } } Label1.Te...
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
How about LINQ: ``` Label1.Text = string.Join( ",", ListBox1.Items .OfType<ListItem>() .Where(item => item.Selected) .Select(x => x.Value.ToString()) .ToArray() ); ```
You can replace all of your code with some LINQ: ``` Label1.Text = String.Join(", ", ListBox1.Items.Cast<ListItem>() .Where(i => i.Selected) .Select(i => i.Value.ToString()) ); ``` In .Net 3.5, you'll need to add `.ToArray()`.
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
How about LINQ: ``` Label1.Text = string.Join( ",", ListBox1.Items .OfType<ListItem>() .Where(item => item.Selected) .Select(x => x.Value.ToString()) .ToArray() ); ```
I believe you can do this: ``` interestitems.IndexOf(inteitem); ``` Altought it worked me with other item types, may give you an idea. I haven't checked if it works with strings. The you just have to eliminate the last one, with the index check if it's the last ones with interestitems.Count
5,170,768
Is there any other shorter/more efficient way to check and see if it is the last item in my ListBox? The main goal here is basically to add the selected items to a label, and add a comma after every one but the last one. Any suggestions? ``` int sc = 0; List<string> interestitems = new List<string>(); ...
2011/03/02
[ "https://Stackoverflow.com/questions/5170768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595208/" ]
How about LINQ: ``` Label1.Text = string.Join( ",", ListBox1.Items .OfType<ListItem>() .Where(item => item.Selected) .Select(x => x.Value.ToString()) .ToArray() ); ```
Why not just build up the string as you iterate during the first loop ``` var builder = new StringBuilder(); var first = true; foreach (var item in ListBox1.Items) { if (item.Selected) { if (!first) { builder.Append(", "); } first = false; builder.Append(item.Value.ToString()); } } Label1.Te...
42,273,549
**Introduction to the problem** I have a binding in XAML on a property in my view model, called "IsYoungerThanSeventy". Iøm using Prism to call a command on the event `TargetUpdated`. At the moment I'm passing `Source` (the `BinaryQuestion`) using `TriggerParameterPath="Source"`. **The problem** I can't pass both `S...
2017/02/16
[ "https://Stackoverflow.com/questions/42273549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1954413/" ]
The `Execute` method of the `ICommand` interface accepts only a single parameter so for you to be able to pass two values you need to create a type that can hold these two values and then pass an instance of this type as the command parameter to the command. The easiest way to do this would be to invoke the command fr...
Have you tried passing no argument? ``` <i:Interaction.Triggers> <i:EventTrigger EventName="TargetUpdated"> <prism:InvokeCommandAction Command="{Binding PropertyBoundToAnswerRequiredChangedCommand}" /> </i:EventTrigger> </i:Interaction.Triggers> ``` Then your command can be d...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
I am a Reformed Pastor and I think the passage most Reformed Christians would turn to is: Ephesians 2: 8-9: > > For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. > > > Much like Catholic teaching referred to above...
First, I am not a Calvinist and do not subscribe to Reformed theology, but my theology in this case would likely align with Reformed belief, although I haven't verified this. My perspective may fall under your category of "other perspectives." Romans 4 addresses the issue directly. Verse 2-5 (emphasis mine), > > Fo...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
You've fallen into a common trap of examining a single piece of a theological system by importing that piece into your own construct rather than seeing how it fits into its own context. A Reformed understanding of soteriology is dependent on several interwoven ideas about God and his role in creation. Note this assump...
First, I am not a Calvinist and do not subscribe to Reformed theology, but my theology in this case would likely align with Reformed belief, although I haven't verified this. My perspective may fall under your category of "other perspectives." Romans 4 addresses the issue directly. Verse 2-5 (emphasis mine), > > Fo...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
When Scripture talks of gaining salvation "by works" as opposed to "by faith" what I think it is really driving at is the distinction between gaining salvation as a *free gift* and *earning* salvation. When you exercised faith in Christ you were saved, but you didn't *earn* salvation by believing. Suppose Bill Gates...
First, I am not a Calvinist and do not subscribe to Reformed theology, but my theology in this case would likely align with Reformed belief, although I haven't verified this. My perspective may fall under your category of "other perspectives." Romans 4 addresses the issue directly. Verse 2-5 (emphasis mine), > > Fo...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
You've fallen into a common trap of examining a single piece of a theological system by importing that piece into your own construct rather than seeing how it fits into its own context. A Reformed understanding of soteriology is dependent on several interwoven ideas about God and his role in creation. Note this assump...
I am a Reformed Pastor and I think the passage most Reformed Christians would turn to is: Ephesians 2: 8-9: > > For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. > > > Much like Catholic teaching referred to above...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
I am a Reformed Pastor and I think the passage most Reformed Christians would turn to is: Ephesians 2: 8-9: > > For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. > > > Much like Catholic teaching referred to above...
You have arrived at the final destination of the Calvinist trap. Is obeying God's commands a system of works? Too many people are easily discarding the will of God and throwing out His commands, calling them instead works of man. There are works that are works of God, and there are the works that are of men. Matt. 23:...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
I am a Reformed Pastor and I think the passage most Reformed Christians would turn to is: Ephesians 2: 8-9: > > For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God— not by works, so that no one can boast. > > > Much like Catholic teaching referred to above...
When Scripture talks of gaining salvation "by works" as opposed to "by faith" what I think it is really driving at is the distinction between gaining salvation as a *free gift* and *earning* salvation. When you exercised faith in Christ you were saved, but you didn't *earn* salvation by believing. Suppose Bill Gates...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
You've fallen into a common trap of examining a single piece of a theological system by importing that piece into your own construct rather than seeing how it fits into its own context. A Reformed understanding of soteriology is dependent on several interwoven ideas about God and his role in creation. Note this assump...
You have arrived at the final destination of the Calvinist trap. Is obeying God's commands a system of works? Too many people are easily discarding the will of God and throwing out His commands, calling them instead works of man. There are works that are works of God, and there are the works that are of men. Matt. 23:...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
You've fallen into a common trap of examining a single piece of a theological system by importing that piece into your own construct rather than seeing how it fits into its own context. A Reformed understanding of soteriology is dependent on several interwoven ideas about God and his role in creation. Note this assump...
When Scripture talks of gaining salvation "by works" as opposed to "by faith" what I think it is really driving at is the distinction between gaining salvation as a *free gift* and *earning* salvation. When you exercised faith in Christ you were saved, but you didn't *earn* salvation by believing. Suppose Bill Gates...
60,628
While reviewing the superb answers to [this question about *free will*](https://christianity.stackexchange.com/q/54588/24204), I was inspired to leave [a comment for Ian](https://christianity.stackexchange.com/a/56596/24204) that I realized ought to be its own question. As I understand (and possibly misunderstand) Re...
2017/11/08
[ "https://christianity.stackexchange.com/questions/60628", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/24204/" ]
When Scripture talks of gaining salvation "by works" as opposed to "by faith" what I think it is really driving at is the distinction between gaining salvation as a *free gift* and *earning* salvation. When you exercised faith in Christ you were saved, but you didn't *earn* salvation by believing. Suppose Bill Gates...
You have arrived at the final destination of the Calvinist trap. Is obeying God's commands a system of works? Too many people are easily discarding the will of God and throwing out His commands, calling them instead works of man. There are works that are works of God, and there are the works that are of men. Matt. 23:...
80,838
I am looking for a solution to control my computer mouse just with my hands and a webcam. The goal is to combine it with voice input to let me move more freely in front of my desk. It should support the usual mouse actions: * position mouse pointer, left click, right click, middle click, scroll up, scroll down * opti...
2021/10/08
[ "https://softwarerecs.stackexchange.com/questions/80838", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/76676/" ]
You can try Kdenlive. From their site: > > Multi-track video editing > Kdenlive allows you to use and arrange several audio and video tracks, each one can be locked or muted to your convenience. > > > [Kdenlive | Libre Video Editor](https://kdenlive.org/en/download) [Wikipedia link](https://tr.wikipedia.org/w...
[avidemux](https://en.wikipedia.org/wiki/Avidemux) can add .mkv files at the end of each other. Usage: Open the avidemux GUI, drag-and-drop the first .mkv file, then the second, then press "save" and enter the filename you want for the output file. The input files must have the same size and encoding. Available for ...
80,838
I am looking for a solution to control my computer mouse just with my hands and a webcam. The goal is to combine it with voice input to let me move more freely in front of my desk. It should support the usual mouse actions: * position mouse pointer, left click, right click, middle click, scroll up, scroll down * opti...
2021/10/08
[ "https://softwarerecs.stackexchange.com/questions/80838", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/76676/" ]
You can try Kdenlive. From their site: > > Multi-track video editing > Kdenlive allows you to use and arrange several audio and video tracks, each one can be locked or muted to your convenience. > > > [Kdenlive | Libre Video Editor](https://kdenlive.org/en/download) [Wikipedia link](https://tr.wikipedia.org/w...
This is what I use <https://www.fosshub.com/MKVToolNix.html> You can see the result here <https://www.youtube.com/watch?v=2_TCmWRUQrI> Basically a 3:20 video is combined with a 30 minutes video Notice to do this you need to ensure you that you append video to another video The first time I am doing it I just comb...
80,838
I am looking for a solution to control my computer mouse just with my hands and a webcam. The goal is to combine it with voice input to let me move more freely in front of my desk. It should support the usual mouse actions: * position mouse pointer, left click, right click, middle click, scroll up, scroll down * opti...
2021/10/08
[ "https://softwarerecs.stackexchange.com/questions/80838", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/76676/" ]
Use [ffmpeg](http://ffmpeg.org) ``` ffmpeg -f concat -i mylist.txt -c copy output.mkv ``` Put path to your MKVs in mylist.txt in line seperated manner. You don't even need to think about re-encoding. The codecs will be copied as-is. Quality unchanged.
[avidemux](https://en.wikipedia.org/wiki/Avidemux) can add .mkv files at the end of each other. Usage: Open the avidemux GUI, drag-and-drop the first .mkv file, then the second, then press "save" and enter the filename you want for the output file. The input files must have the same size and encoding. Available for ...
80,838
I am looking for a solution to control my computer mouse just with my hands and a webcam. The goal is to combine it with voice input to let me move more freely in front of my desk. It should support the usual mouse actions: * position mouse pointer, left click, right click, middle click, scroll up, scroll down * opti...
2021/10/08
[ "https://softwarerecs.stackexchange.com/questions/80838", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/76676/" ]
Use [ffmpeg](http://ffmpeg.org) ``` ffmpeg -f concat -i mylist.txt -c copy output.mkv ``` Put path to your MKVs in mylist.txt in line seperated manner. You don't even need to think about re-encoding. The codecs will be copied as-is. Quality unchanged.
This is what I use <https://www.fosshub.com/MKVToolNix.html> You can see the result here <https://www.youtube.com/watch?v=2_TCmWRUQrI> Basically a 3:20 video is combined with a 30 minutes video Notice to do this you need to ensure you that you append video to another video The first time I am doing it I just comb...
80,838
I am looking for a solution to control my computer mouse just with my hands and a webcam. The goal is to combine it with voice input to let me move more freely in front of my desk. It should support the usual mouse actions: * position mouse pointer, left click, right click, middle click, scroll up, scroll down * opti...
2021/10/08
[ "https://softwarerecs.stackexchange.com/questions/80838", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/76676/" ]
[avidemux](https://en.wikipedia.org/wiki/Avidemux) can add .mkv files at the end of each other. Usage: Open the avidemux GUI, drag-and-drop the first .mkv file, then the second, then press "save" and enter the filename you want for the output file. The input files must have the same size and encoding. Available for ...
This is what I use <https://www.fosshub.com/MKVToolNix.html> You can see the result here <https://www.youtube.com/watch?v=2_TCmWRUQrI> Basically a 3:20 video is combined with a 30 minutes video Notice to do this you need to ensure you that you append video to another video The first time I am doing it I just comb...
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
`Math.Truncate (x * 10.0) / 10.0` is one way to do it. Using your numbers: ``` double x = 5.0 * (53.0 - 32.0) / 9.0; double result = Math.Truncate (x * 10.0) / 10.0; ``` Note the use of ".0" at the end of all numbers, this ensures that floating-point math, and not integer math, is used when combining them. Intege...
If you want 12.6666667 to show up as 12.6, you'll have to truncate, not round; otherwise you'd get 12.7 to one decimal place. Personally I'd do that by going ((int) (12.6666667 \* 10)) / 10.
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
`Math.Truncate (x * 10.0) / 10.0` is one way to do it. Using your numbers: ``` double x = 5.0 * (53.0 - 32.0) / 9.0; double result = Math.Truncate (x * 10.0) / 10.0; ``` Note the use of ".0" at the end of all numbers, this ensures that floating-point math, and not integer math, is used when combining them. Intege...
If you want formatting (as John has suggested in the comment): ``` String.Format("{0:0.0}", 12.6666666); // Note: this shows up as 12.7 ```
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
`Math.Truncate (x * 10.0) / 10.0` is one way to do it. Using your numbers: ``` double x = 5.0 * (53.0 - 32.0) / 9.0; double result = Math.Truncate (x * 10.0) / 10.0; ``` Note the use of ".0" at the end of all numbers, this ensures that floating-point math, and not integer math, is used when combining them. Intege...
See [Decimal formatting without rounding .net](https://stackoverflow.com/questions/1138217/decimal-formatting-without-rounding-net) -----------------------------------------------------------------------------------------------------------------------------------
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
`Math.Truncate (x * 10.0) / 10.0` is one way to do it. Using your numbers: ``` double x = 5.0 * (53.0 - 32.0) / 9.0; double result = Math.Truncate (x * 10.0) / 10.0; ``` Note the use of ".0" at the end of all numbers, this ensures that floating-point math, and not integer math, is used when combining them. Intege...
``` d -= d % 0.1; //Where 0.1 is the desired least significant unit. ``` It should truncate rather than round at whatever precision you would like, and it seems to work fine on negative numbers as well, always rounding towards zero.
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
If you want formatting (as John has suggested in the comment): ``` String.Format("{0:0.0}", 12.6666666); // Note: this shows up as 12.7 ```
If you want 12.6666667 to show up as 12.6, you'll have to truncate, not round; otherwise you'd get 12.7 to one decimal place. Personally I'd do that by going ((int) (12.6666667 \* 10)) / 10.
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
``` d -= d % 0.1; //Where 0.1 is the desired least significant unit. ``` It should truncate rather than round at whatever precision you would like, and it seems to work fine on negative numbers as well, always rounding towards zero.
If you want 12.6666667 to show up as 12.6, you'll have to truncate, not round; otherwise you'd get 12.7 to one decimal place. Personally I'd do that by going ((int) (12.6666667 \* 10)) / 10.
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
If you want formatting (as John has suggested in the comment): ``` String.Format("{0:0.0}", 12.6666666); // Note: this shows up as 12.7 ```
See [Decimal formatting without rounding .net](https://stackoverflow.com/questions/1138217/decimal-formatting-without-rounding-net) -----------------------------------------------------------------------------------------------------------------------------------
2,091,421
So i want 12.6666667 to show up as 12.6 and not 13 or 12.67 This is what i have done ``` Math.Round((5 * (53 - 32)) / 9, 1) ```
2010/01/19
[ "https://Stackoverflow.com/questions/2091421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253752/" ]
``` d -= d % 0.1; //Where 0.1 is the desired least significant unit. ``` It should truncate rather than round at whatever precision you would like, and it seems to work fine on negative numbers as well, always rounding towards zero.
See [Decimal formatting without rounding .net](https://stackoverflow.com/questions/1138217/decimal-formatting-without-rounding-net) -----------------------------------------------------------------------------------------------------------------------------------
15,174
Our Environment : SDL Tridion 2013 SP1 We are trying to automate sitemap during every page publishing/unpublishing. The requirement is to create two sitemap files (audiositemap.xml/videositemap.xml). While creating content pages, author would choose whether the page type is audio or video in page metadata. During pub...
2016/07/19
[ "https://tridion.stackexchange.com/questions/15174", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/252/" ]
Well, this wouldn't be Tridion if there weren't 15 ways of doing it. My preferred approach for this - given that you already have the sitemap logic built into CM Templates - would be to use a [Custom Resolver](http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/GUID-F792AB1A-060A-4757-802D-3A2DB18F022D). While ...
This can be achieved using Event system. Only thing if your sitemap is bigger in size it will have some performance effect. But you can try the following: 1. Write a custom event handler on Page Publish/unpublish and make the phase TransactionCommitted which is suitable for auto publishing trigger. As if the action is...
15,174
Our Environment : SDL Tridion 2013 SP1 We are trying to automate sitemap during every page publishing/unpublishing. The requirement is to create two sitemap files (audiositemap.xml/videositemap.xml). While creating content pages, author would choose whether the page type is audio or video in page metadata. During pub...
2016/07/19
[ "https://tridion.stackexchange.com/questions/15174", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/252/" ]
This can be achieved using Event system. Only thing if your sitemap is bigger in size it will have some performance effect. But you can try the following: 1. Write a custom event handler on Page Publish/unpublish and make the phase TransactionCommitted which is suitable for auto publishing trigger. As if the action is...
I will use a similar but slightly different approach to what @Anumap suggested, because I like to keep things decoupled. So, I would create two separate components in Tridion which hold the audio and video sitemap and update them on every publish of a page of type audio or video and then publish the same only if there ...
15,174
Our Environment : SDL Tridion 2013 SP1 We are trying to automate sitemap during every page publishing/unpublishing. The requirement is to create two sitemap files (audiositemap.xml/videositemap.xml). While creating content pages, author would choose whether the page type is audio or video in page metadata. During pub...
2016/07/19
[ "https://tridion.stackexchange.com/questions/15174", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/252/" ]
Well, this wouldn't be Tridion if there weren't 15 ways of doing it. My preferred approach for this - given that you already have the sitemap logic built into CM Templates - would be to use a [Custom Resolver](http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/GUID-F792AB1A-060A-4757-802D-3A2DB18F022D). While ...
Welcome the tridion community. Coming to your question about generating site map using event handler is not good idea, because when you publish in bulk, there will be performance and concurrency issues which are very difficult to handle and if you are able to handle them that will be at the cost of increased publishin...
15,174
Our Environment : SDL Tridion 2013 SP1 We are trying to automate sitemap during every page publishing/unpublishing. The requirement is to create two sitemap files (audiositemap.xml/videositemap.xml). While creating content pages, author would choose whether the page type is audio or video in page metadata. During pub...
2016/07/19
[ "https://tridion.stackexchange.com/questions/15174", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/252/" ]
Welcome the tridion community. Coming to your question about generating site map using event handler is not good idea, because when you publish in bulk, there will be performance and concurrency issues which are very difficult to handle and if you are able to handle them that will be at the cost of increased publishin...
I will use a similar but slightly different approach to what @Anumap suggested, because I like to keep things decoupled. So, I would create two separate components in Tridion which hold the audio and video sitemap and update them on every publish of a page of type audio or video and then publish the same only if there ...
15,174
Our Environment : SDL Tridion 2013 SP1 We are trying to automate sitemap during every page publishing/unpublishing. The requirement is to create two sitemap files (audiositemap.xml/videositemap.xml). While creating content pages, author would choose whether the page type is audio or video in page metadata. During pub...
2016/07/19
[ "https://tridion.stackexchange.com/questions/15174", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/252/" ]
Well, this wouldn't be Tridion if there weren't 15 ways of doing it. My preferred approach for this - given that you already have the sitemap logic built into CM Templates - would be to use a [Custom Resolver](http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/GUID-F792AB1A-060A-4757-802D-3A2DB18F022D). While ...
I will use a similar but slightly different approach to what @Anumap suggested, because I like to keep things decoupled. So, I would create two separate components in Tridion which hold the audio and video sitemap and update them on every publish of a page of type audio or video and then publish the same only if there ...
24,799
Given a hierarchical model $p(x|\phi,\theta)$, I want a two stage process to fit the model. First, fix a handful of hyperparameters $\theta$, and then do Bayesian inference on the rest of the parameters $\phi$. For fixing the hyperparameters I am considering two options. 1. Use **Empirical Bayes (EB)** and maximize th...
2012/03/17
[ "https://stats.stackexchange.com/questions/24799", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/8960/" ]
I doubt there will be a theoretical link that says that CV and evidence maximisation are asymptotically equivalent as the evidence tells us the probability of the data *given the assumptions of the model*. Thus if the model is mis-specified, then the evidence may be unreliable. Cross-validation on the other hand gives ...
If you didn't have the other parameters $k$, then EB is identical to CV except that you don't have to search. You say that you are integrating out $k$ in both CV and EB. In that case, they are identical.
16,084,155
I want to handle all the unhandled exceptions in my `Progress` class, in which I wrote some code for error logging: ``` static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { try { Applicatio...
2013/04/18
[ "https://Stackoverflow.com/questions/16084155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1828339/" ]
in the program.cs do this: ``` [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppDomain.CurrentDomain.UnhandledException += AppDomain_UnhandledException; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException...
My approach would probably be event handlers. The problem you face is communication across threads, which is a notorious bummer! You should research threads and invoking to learn more about this. However, you can use events and event handlers to safely communicate between your worker and primary threads. Here's a brief...
16,084,155
I want to handle all the unhandled exceptions in my `Progress` class, in which I wrote some code for error logging: ``` static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { try { Applicatio...
2013/04/18
[ "https://Stackoverflow.com/questions/16084155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1828339/" ]
You can use the AppDomain.UnhandledException event
My approach would probably be event handlers. The problem you face is communication across threads, which is a notorious bummer! You should research threads and invoking to learn more about this. However, you can use events and event handlers to safely communicate between your worker and primary threads. Here's a brief...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
The product manager (I think) at the time this feature was introduced explains it [like this](https://success.salesforce.com/ideaView?id=08730000000Dj51AAC): > > If you want information that is common to all tests, it can be > inserted in the test setup method and queried in each test method. > The idea here is no...
From my humble point of view, the biggest advantage is to not have to duplicate code and have a consistent set of data that you can use for all the tests in a given class (or classes). However, there are a couple of other good use-cases. 1. Your code is a lot easier to read, having one place where all the data is cre...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
To be honest, the increase in speed is about the only tangible benefit to us (as developers). Salesforce themselves arguably sees more benefit from people using this annotation than we developers (directly) do. If it's faster for us, that means that it also places less load on Salesforce's pods. As others (including...
From my humble point of view, the biggest advantage is to not have to duplicate code and have a consistent set of data that you can use for all the tests in a given class (or classes). However, there are a couple of other good use-cases. 1. Your code is a lot easier to read, having one place where all the data is cre...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
From my humble point of view, the biggest advantage is to not have to duplicate code and have a consistent set of data that you can use for all the tests in a given class (or classes). However, there are a couple of other good use-cases. 1. Your code is a lot easier to read, having one place where all the data is cre...
I have a design pattern that I use so frequently for unit tests that I made an Eclipse template for it. You can also find it [here.](https://gist.github.com/latentfuss/589860c344edee03b06a161c642b1f13) ``` @isTest private class ${class_name} { //setup testClass variables here. For example: //RecordType Ids ...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
The product manager (I think) at the time this feature was introduced explains it [like this](https://success.salesforce.com/ideaView?id=08730000000Dj51AAC): > > If you want information that is common to all tests, it can be > inserted in the test setup method and queried in each test method. > The idea here is no...
The `Apex Developer Guide` does indicate *speed* is the primary motivation, especially in the face of *data-volume*: > > [Using Test Setup Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm?search_text=testsetup) > =======================================...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
The product manager (I think) at the time this feature was introduced explains it [like this](https://success.salesforce.com/ideaView?id=08730000000Dj51AAC): > > If you want information that is common to all tests, it can be > inserted in the test setup method and queried in each test method. > The idea here is no...
I have a design pattern that I use so frequently for unit tests that I made an Eclipse template for it. You can also find it [here.](https://gist.github.com/latentfuss/589860c344edee03b06a161c642b1f13) ``` @isTest private class ${class_name} { //setup testClass variables here. For example: //RecordType Ids ...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
To be honest, the increase in speed is about the only tangible benefit to us (as developers). Salesforce themselves arguably sees more benefit from people using this annotation than we developers (directly) do. If it's faster for us, that means that it also places less load on Salesforce's pods. As others (including...
The `Apex Developer Guide` does indicate *speed* is the primary motivation, especially in the face of *data-volume*: > > [Using Test Setup Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm?search_text=testsetup) > =======================================...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
The `Apex Developer Guide` does indicate *speed* is the primary motivation, especially in the face of *data-volume*: > > [Using Test Setup Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm?search_text=testsetup) > =======================================...
I have a design pattern that I use so frequently for unit tests that I made an Eclipse template for it. You can also find it [here.](https://gist.github.com/latentfuss/589860c344edee03b06a161c642b1f13) ``` @isTest private class ${class_name} { //setup testClass variables here. For example: //RecordType Ids ...
160,328
Before Salesforce introduced @testSetup annotation in 2015, I used to create common data in a method and call it in every test method. Ex: ``` @isTest private class clsAccountTest { private static Account testAccount; private static void createCommonData(){ testAccount = new Account(Name= 'Avinash',...
2017/02/14
[ "https://salesforce.stackexchange.com/questions/160328", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/17228/" ]
To be honest, the increase in speed is about the only tangible benefit to us (as developers). Salesforce themselves arguably sees more benefit from people using this annotation than we developers (directly) do. If it's faster for us, that means that it also places less load on Salesforce's pods. As others (including...
I have a design pattern that I use so frequently for unit tests that I made an Eclipse template for it. You can also find it [here.](https://gist.github.com/latentfuss/589860c344edee03b06a161c642b1f13) ``` @isTest private class ${class_name} { //setup testClass variables here. For example: //RecordType Ids ...
32,686,855
I am building a Laravel application. In the back-end, the `$controller->wantsJson()` method is `TRUE` if the content type of the request is `application/json`. So, to satisfy this, my jQuery AJAX call is this. ``` jQuery.ajax({ type: "POST", method: "PUT", url: $form.attr('action'), ...
2015/09/21
[ "https://Stackoverflow.com/questions/32686855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4635062/" ]
I had the same problem but this package did the trick: [jQuery Serialize Object](https://github.com/macek/jquery-serialize-object) It's easy to use, just call this on your form (after loading the script) ``` $('form#contact').serializeJSON(); // to get the form as a JS object ```
You can use PHP [`parse_str`](http://php.net/manual/en/function.parse-str.php) > > parse\_str — Parses the string into variables > > > ``` $str = "first=value&arr[]=foo+bar&arr[]=baz"; parse_str($str); echo $first; // value echo $arr[0]; // foo bar echo $arr[1]; // baz parse_str($str, $output); echo $output['fi...
32,686,855
I am building a Laravel application. In the back-end, the `$controller->wantsJson()` method is `TRUE` if the content type of the request is `application/json`. So, to satisfy this, my jQuery AJAX call is this. ``` jQuery.ajax({ type: "POST", method: "PUT", url: $form.attr('action'), ...
2015/09/21
[ "https://Stackoverflow.com/questions/32686855", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4635062/" ]
I had the same problem but this package did the trick: [jQuery Serialize Object](https://github.com/macek/jquery-serialize-object) It's easy to use, just call this on your form (after loading the script) ``` $('form#contact').serializeJSON(); // to get the form as a JS object ```
I agree with @mdamia Here is the snippet with more detail. After `JSON.stringify(dataObj);` You will get a json string as below: **JSON:** ``` [ { "name":"something", "value":"1" }, { "name":"field[foo]", "value":"2" }, { "name":"field[bar][]", "value":"a" }, ...
30,088,391
I'm doing codecademy right now and I'm having an issue with one lesson involving for-in loops. The requirement for thi exercise is to log "bill" and "steve to the console. However, I'm getting the entire array except those two strings logged instead. What's going on here? ``` var friends = { bill: {firstName: "...
2015/05/06
[ "https://Stackoverflow.com/questions/30088391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872504/" ]
change `console.log(friends[p]);` into `console.log(friends[p].firstName);`.
You need to specify what you want even further. This: ``` console.log(friends[p]); ``` should be changed to this: ``` console.log(friends[p].firstName); ``` Your code is only getting you all of the properties associated with `friends[bill]` and `friends[steve]`. You want their first names, so you have to use dot...
30,088,391
I'm doing codecademy right now and I'm having an issue with one lesson involving for-in loops. The requirement for thi exercise is to log "bill" and "steve to the console. However, I'm getting the entire array except those two strings logged instead. What's going on here? ``` var friends = { bill: {firstName: "...
2015/05/06
[ "https://Stackoverflow.com/questions/30088391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872504/" ]
In a `for-in` loop, the variable is set to the property names. So if you want to log the property name, use `console.log(p)`. `friends[p]` is the value that the property name maps to in the object.
You need to specify what you want even further. This: ``` console.log(friends[p]); ``` should be changed to this: ``` console.log(friends[p].firstName); ``` Your code is only getting you all of the properties associated with `friends[bill]` and `friends[steve]`. You want their first names, so you have to use dot...
41,659,474
I have a sequence of dates ``` daysList <- seq(as.Date('2016-12-29'),as.Date('2017-01-01'),by="days") ``` countList, a list with decremented value of daysList count from 0 to last value: ``` countList <- list() for (i in (length(daysList)-1):0) { res <- 0:i countList <- append(countList, list(res)) } ``` finally ...
2017/01/15
[ "https://Stackoverflow.com/questions/41659474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3674993/" ]
Based on your output, then one way to go is to replace all the dates of `days_decrement` with the first date, i.e. ``` lapply(days_decrement, function(i)replace(i, i != i[1], i[1])) #[[1]] #[1] "2016-12-29" "2016-12-29" "2016-12-29" "2016-12-29" #[[2]] #[1] "2016-12-30" "2016-12-30" "2016-12-30" #[[3]] #[1] "2016-12-...
For this kind of work, you can try using `purrr` package and fonctional programming. `map` function and its friends are "kind of like" `lapply` but they reveal more consistent and powerful at usage and syntax with pipes is very concise. ```r # your input daysList <- seq(as.Date('2016-12-29'),as.Date('2017-01-01'),by="...
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
You should convert '01/08/2012' and '01/12/2012' to MySQL date/time values using [STR\_TO\_DATE()](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date) e.g. ``` STR_TO_DATE('01/08/2012', '%d/%m/%Y') ```
Well that's really only part of the query -- any, "between" works differently than you imply - here's an excerpt from the MySQL manual: > > •expr BETWEEN min AND max If expr is greater than or equal to min and > expr is less than or equal to max, BETWEEN returns 1, otherwise it > returns 0. This is equivalent to th...
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
You should convert '01/08/2012' and '01/12/2012' to MySQL date/time values using [STR\_TO\_DATE()](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date) e.g. ``` STR_TO_DATE('01/08/2012', '%d/%m/%Y') ```
This looks as if it should work on first glance, however the values you have supplied **are not valid datetimes**. Try this instead ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '2012-01-08 00:00:00' AND `Project`.`approval_...
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
You should convert '01/08/2012' and '01/12/2012' to MySQL date/time values using [STR\_TO\_DATE()](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date) e.g. ``` STR_TO_DATE('01/08/2012', '%d/%m/%Y') ```
you can still use `BETWEEN` ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND (`Project`.`approval_date` BETWEEN '2012-01-08 00:00:00' AND '2012-01-12 23:59:59') ```
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
You should convert '01/08/2012' and '01/12/2012' to MySQL date/time values using [STR\_TO\_DATE()](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date) e.g. ``` STR_TO_DATE('01/08/2012', '%d/%m/%Y') ```
My main problem was getting the string to format into datetime. kissmyface was correct on just structuring it correctly so mysql could understand. So I used php to convert it before sending it out. ``` "Project.approval_date >= '".date("Y-m-d H:i:s", strtotime($start))."'"; "Project.approval_date <= '".date("Y-m-d H:...
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
Well that's really only part of the query -- any, "between" works differently than you imply - here's an excerpt from the MySQL manual: > > •expr BETWEEN min AND max If expr is greater than or equal to min and > expr is less than or equal to max, BETWEEN returns 1, otherwise it > returns 0. This is equivalent to th...
you can still use `BETWEEN` ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND (`Project`.`approval_date` BETWEEN '2012-01-08 00:00:00' AND '2012-01-12 23:59:59') ```
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
Well that's really only part of the query -- any, "between" works differently than you imply - here's an excerpt from the MySQL manual: > > •expr BETWEEN min AND max If expr is greater than or equal to min and > expr is less than or equal to max, BETWEEN returns 1, otherwise it > returns 0. This is equivalent to th...
My main problem was getting the string to format into datetime. kissmyface was correct on just structuring it correctly so mysql could understand. So I used php to convert it before sending it out. ``` "Project.approval_date >= '".date("Y-m-d H:i:s", strtotime($start))."'"; "Project.approval_date <= '".date("Y-m-d H:...
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
This looks as if it should work on first glance, however the values you have supplied **are not valid datetimes**. Try this instead ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '2012-01-08 00:00:00' AND `Project`.`approval_...
you can still use `BETWEEN` ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND (`Project`.`approval_date` BETWEEN '2012-01-08 00:00:00' AND '2012-01-12 23:59:59') ```
8,812,553
My Queries looks like this ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '01/08/2012' AND `Project`.`approval_date` <= '01/12/2012' ``` I do have a record that matches this criteria, I actually created the query ba...
2012/01/11
[ "https://Stackoverflow.com/questions/8812553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201934/" ]
This looks as if it should work on first glance, however the values you have supplied **are not valid datetimes**. Try this instead ``` WHERE `Project`.`user_id` = 9 AND `Project`.`project_status` = 1 AND `Project`.`project_type_id` = 4 AND `Project`.`approval_date` >= '2012-01-08 00:00:00' AND `Project`.`approval_...
My main problem was getting the string to format into datetime. kissmyface was correct on just structuring it correctly so mysql could understand. So I used php to convert it before sending it out. ``` "Project.approval_date >= '".date("Y-m-d H:i:s", strtotime($start))."'"; "Project.approval_date <= '".date("Y-m-d H:...
25,152,346
Which way do you reset magento orders? For example, now the current order - # 100000051 I need: ``` 1) completely remove all orders from the Database 2) new order will have to start with a number # 100000001 (this is important) ``` Please let us know your trusty and checked up way!
2014/08/06
[ "https://Stackoverflow.com/questions/25152346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3912793/" ]
Use third party extension for delete all orders from magento system: <http://www.magentocommerce.com/magento-connect/orders-eraser.html> Or <http://www.magentocommerce.com/magento-connect/delete-orders-6.html> Then truncate sales\_flat\_order or sales\_flat\_order\_grid or rest increment field value using mysql qu...
Here is some trick. you can remove all order from using admin sales order grid by user interface. and just change increment id from table `eav_entity_store` of column name like `increment_last_id` which you need **# 100000001** So from next order of your store will start as fresh magento orders **EDIT** Follow b...
25,152,346
Which way do you reset magento orders? For example, now the current order - # 100000051 I need: ``` 1) completely remove all orders from the Database 2) new order will have to start with a number # 100000001 (this is important) ``` Please let us know your trusty and checked up way!
2014/08/06
[ "https://Stackoverflow.com/questions/25152346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3912793/" ]
Use third party extension for delete all orders from magento system: <http://www.magentocommerce.com/magento-connect/orders-eraser.html> Or <http://www.magentocommerce.com/magento-connect/delete-orders-6.html> Then truncate sales\_flat\_order or sales\_flat\_order\_grid or rest increment field value using mysql qu...
Simply got your database phpMyadmin and then open the table `sales_flat_order` and then simply remove tha data from this tabel and your test orders will be cleared. No need of any code ,commands or extensions . cool.
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
If $x$ belongs to every closed set containing $A$, then, in particular, $x$ belongs to every closed set containg $B$ (since $A\subset B$) and therefore $x\in\overline B$.
Let $x\in\overline{A}$ then by definition for every $\varepsilon>0$ the ball $B(x,\varepsilon)\cap A\neq\emptyset$. Since $A\subset B$ then $$\emptyset\neq B(x,\varepsilon)\cap A=B(x,\varepsilon)\cap (A\cap B)=(B(x,\varepsilon)\cap B)\cap A\Rightarrow B(x,\varepsilon)\cap B\neq \emptyset$$ hence $x\in\overline{B}$. $\...
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
If $x$ belongs to every closed set containing $A$, then, in particular, $x$ belongs to every closed set containg $B$ (since $A\subset B$) and therefore $x\in\overline B$.
Let $x\in \bar A$. Then $x$ is a limit point of $A$. Then $\exists$ a sequence $(x\_n)$ in $A$ with $x\_n\to x$. But $(x\_n)$ is also a sequence in $B$ ($x\_n\in A\subset B \forall n$). Thus $x\in \bar B$.
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
If $x$ belongs to every closed set containing $A$, then, in particular, $x$ belongs to every closed set containg $B$ (since $A\subset B$) and therefore $x\in\overline B$.
Correct me if wrong. $A \subset B.$ $\overline{A}= A\cup A'$ , where $A'$ is the set of limit points of $A.$ Need to show that $A' \subset B'$. Let $x \in A'$. Then every open neighbourhood $K\_r(x)$ contains points $y \in A,$ and $y \not = x.$ But $A \subset B$ : Thus every open neighbourhood $K\_r(x)$ , $x \in ...
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
If $x$ belongs to every closed set containing $A$, then, in particular, $x$ belongs to every closed set containg $B$ (since $A\subset B$) and therefore $x\in\overline B$.
Suppose $A \subseteq B$. Then always $B \subseteq \overline{B}$, and $\overline{B}$ is closed. Both are true from the definition of $\overline{B}$. Now, $\overline{A} = \bigcap \{C: C \text{ is closed and } A \subseteq C\}$, and as we saw that $\overline{B}$ is closed *and* contains $A$ (as $A \subseteq B \subseteq ...
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
If $x$ belongs to every closed set containing $A$, then, in particular, $x$ belongs to every closed set containg $B$ (since $A\subset B$) and therefore $x\in\overline B$.
Let $x\in \overline{A}$, then $x$ is in all closed set containing $A$. Every closed set containing $B$ contain $A$, so contain $x$. Then $x$ is in all closed set cointaining $B$, therefore $x\in\overline{B}$
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
Suppose $A \subseteq B$. Then always $B \subseteq \overline{B}$, and $\overline{B}$ is closed. Both are true from the definition of $\overline{B}$. Now, $\overline{A} = \bigcap \{C: C \text{ is closed and } A \subseteq C\}$, and as we saw that $\overline{B}$ is closed *and* contains $A$ (as $A \subseteq B \subseteq ...
Let $x\in\overline{A}$ then by definition for every $\varepsilon>0$ the ball $B(x,\varepsilon)\cap A\neq\emptyset$. Since $A\subset B$ then $$\emptyset\neq B(x,\varepsilon)\cap A=B(x,\varepsilon)\cap (A\cap B)=(B(x,\varepsilon)\cap B)\cap A\Rightarrow B(x,\varepsilon)\cap B\neq \emptyset$$ hence $x\in\overline{B}$. $\...
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
Suppose $A \subseteq B$. Then always $B \subseteq \overline{B}$, and $\overline{B}$ is closed. Both are true from the definition of $\overline{B}$. Now, $\overline{A} = \bigcap \{C: C \text{ is closed and } A \subseteq C\}$, and as we saw that $\overline{B}$ is closed *and* contains $A$ (as $A \subseteq B \subseteq ...
Let $x\in \bar A$. Then $x$ is a limit point of $A$. Then $\exists$ a sequence $(x\_n)$ in $A$ with $x\_n\to x$. But $(x\_n)$ is also a sequence in $B$ ($x\_n\in A\subset B \forall n$). Thus $x\in \bar B$.
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
Suppose $A \subseteq B$. Then always $B \subseteq \overline{B}$, and $\overline{B}$ is closed. Both are true from the definition of $\overline{B}$. Now, $\overline{A} = \bigcap \{C: C \text{ is closed and } A \subseteq C\}$, and as we saw that $\overline{B}$ is closed *and* contains $A$ (as $A \subseteq B \subseteq ...
Correct me if wrong. $A \subset B.$ $\overline{A}= A\cup A'$ , where $A'$ is the set of limit points of $A.$ Need to show that $A' \subset B'$. Let $x \in A'$. Then every open neighbourhood $K\_r(x)$ contains points $y \in A,$ and $y \not = x.$ But $A \subset B$ : Thus every open neighbourhood $K\_r(x)$ , $x \in ...
2,688,061
Let $A,\ B$ denote subsets of a space $X$. Prove that if $A\subset B$, then $\overline{A}\subset\overline{B}$. **My attempt:** Let $x\in\overline{A}$ $\implies x\in\bigcap\limits\_{\alpha\in K}U\_\alpha$ where $U\_\alpha$ is a closed set of $X$ and $U\_\alpha\supset A$ $\implies x\in U\_\alpha\ \forall\alpha\in K$ ...
2018/03/12
[ "https://math.stackexchange.com/questions/2688061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/257185/" ]
Suppose $A \subseteq B$. Then always $B \subseteq \overline{B}$, and $\overline{B}$ is closed. Both are true from the definition of $\overline{B}$. Now, $\overline{A} = \bigcap \{C: C \text{ is closed and } A \subseteq C\}$, and as we saw that $\overline{B}$ is closed *and* contains $A$ (as $A \subseteq B \subseteq ...
Let $x\in \overline{A}$, then $x$ is in all closed set containing $A$. Every closed set containing $B$ contain $A$, so contain $x$. Then $x$ is in all closed set cointaining $B$, therefore $x\in\overline{B}$
42,047,596
For example I have a class named "Tree" with two private variables ``` public class Tree() { private string name; private int age; public void Tree(string s, int x) { //simply make an object. } } ``` I create an object from another class making a Dictio...
2017/02/05
[ "https://Stackoverflow.com/questions/42047596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7517454/" ]
``` Tree tree = null; if( family.TryGetValue( lastName, out tree ) ) { var fName = tree.Name; var age = tree.Age; } ```
If you certainly know, that the item you want to access does exist in the dictionary, you can use direct access syntax with square brackets instead of using `TryGetValue`. ``` string a = family[nickN].name; int x = family[nickN].age; ``` --- In order to access the private fields `name` and `age` from outside the `T...
7,180,177
I just downloaded the [semantic CSS](http://semantic.gs/) and was running the examples but saw the following error on Firefox ``` Access to restricted URI denied file:///C:/semanticcss/examples/fixed/fixed.less ``` Below is the code in the example page ``` <!-- Stylesheets --> <link rel="stylesheet" href="fix...
2011/08/24
[ "https://Stackoverflow.com/questions/7180177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44286/" ]
This is on purpose. Local files may only read other local files in the same directory or sub-directories. See <https://developer.mozilla.org/en/Same-origin_policy_for_file%3a_URIs>
Try ``` [sudo] npm install less -g ``` Then it shouldn't have any problems with the directories. My system (MBP) did the same thing until I did this. The main problem was that it doesn't know where the LESS compiler is located. You will more than likely need root privileges to run the command, hence [sudo] is system...
75,089
I recently purchased a Raspberry Pi 3, which I understand to have the BCM2837 chip. When I purchased a codec from raspberrypi.com, I was asked to run: cat /proc/cpuinfo I was surprised to see the following output at the bottom: Hardware : BCM2835 Revision : a22082 Serial : Why should I see this output from a new R...
2017/11/12
[ "https://raspberrypi.stackexchange.com/questions/75089", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/76111/" ]
Quoted from a Raspberry Pi engineer : > > It's just a kernel/device tree anomaly. Upstream have chosen to denote > all the Pi's as BCM2835, whereas the original Pi specific kernels > would display BCM2708, BCM2709, or BCM2710 as appropriate. > > > Whether it is more correct to use 2708/9/10 or 2835/6/7 is also > ...
You shouldn't. That's the chip for the original Raspberry Pi. 1. Make sure you have a Raspberry Pi 3. Compare yours to the picture below. Check the markings on the chip and the PCB. [![enter image description here](https://i.stack.imgur.com/z32Vc.jpg)](https://i.stack.imgur.com/z32Vc.jpg) 2. The output from `cat /proc...
75,089
I recently purchased a Raspberry Pi 3, which I understand to have the BCM2837 chip. When I purchased a codec from raspberrypi.com, I was asked to run: cat /proc/cpuinfo I was surprised to see the following output at the bottom: Hardware : BCM2835 Revision : a22082 Serial : Why should I see this output from a new R...
2017/11/12
[ "https://raspberrypi.stackexchange.com/questions/75089", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/76111/" ]
I did some more digging and found [this.](https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/revision-codes/README.md) Basically, the 'revision code' is the only useful bit of information. Look it up in this table to confirm what you really have. In your case, it's a Pi3B manufactured by Embe...
You shouldn't. That's the chip for the original Raspberry Pi. 1. Make sure you have a Raspberry Pi 3. Compare yours to the picture below. Check the markings on the chip and the PCB. [![enter image description here](https://i.stack.imgur.com/z32Vc.jpg)](https://i.stack.imgur.com/z32Vc.jpg) 2. The output from `cat /proc...
75,089
I recently purchased a Raspberry Pi 3, which I understand to have the BCM2837 chip. When I purchased a codec from raspberrypi.com, I was asked to run: cat /proc/cpuinfo I was surprised to see the following output at the bottom: Hardware : BCM2835 Revision : a22082 Serial : Why should I see this output from a new R...
2017/11/12
[ "https://raspberrypi.stackexchange.com/questions/75089", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/76111/" ]
Quoted from a Raspberry Pi engineer : > > It's just a kernel/device tree anomaly. Upstream have chosen to denote > all the Pi's as BCM2835, whereas the original Pi specific kernels > would display BCM2708, BCM2709, or BCM2710 as appropriate. > > > Whether it is more correct to use 2708/9/10 or 2835/6/7 is also > ...
I did some more digging and found [this.](https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/revision-codes/README.md) Basically, the 'revision code' is the only useful bit of information. Look it up in this table to confirm what you really have. In your case, it's a Pi3B manufactured by Embe...
28,999,586
I do not understand why nothing is showing up on the screen when I run this little program? Is the while loop even starting? ``` #include <stdio.h> #include <string.h> int main() { char word[20]; char TryAgain[20] = "y"; int WordLength = 0; while (strcmp(TryAgain, "y")) { printf("\t\t\t Word \n\n"); ...
2015/03/11
[ "https://Stackoverflow.com/questions/28999586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2836816/" ]
`strcmp` returns 0 if its arguments are the same, so at the first iteration your while loop is checking `while(0)`. 0 is equivalent to `false` in boolean checks so the while loop is skipped. Try `while(!strcmp(TryAgain, "y"))`.
I prefer to change it to a do-while ``` do { printf("\nWould you like to try another word? [y/n]\n"); scanf("%s", TryAgain); } while (TryAgain=="y" || TryAgain=="Y"); ``` the TryAgain must be boolean. see ya
54,264,378
I'm writing a macOS app in Swift that needs a privileged helper tool -- wish the elevation wasn't necessary, but [it looks like it is](https://stackoverflow.com/questions/54174674/workaround-for-a-certain-ioserviceopen-call-requiring-root-privileges). I found [this](https://github.com/erikberglund/SwiftPrivilegedHelpe...
2019/01/19
[ "https://Stackoverflow.com/questions/54264378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/523079/" ]
Since you create the helper tool, simply add an XPC message handler to report the status of your tool. When you launch, connect and send that message. If any of that fails, your tool is not correctly installed (or isn't responding). In my code, all of my XPC services (which include my privileged helper) adopt a base p...
I would check the file system if the binary exists (in /Library/PrivilegedHelperTools and if the plist exists in /Library/LaunchDaemons). Then you might contact the XPC service and call kind of a ping function which answers if the service is up and running. just my 2 cts, Robert
54,264,378
I'm writing a macOS app in Swift that needs a privileged helper tool -- wish the elevation wasn't necessary, but [it looks like it is](https://stackoverflow.com/questions/54174674/workaround-for-a-certain-ioserviceopen-call-requiring-root-privileges). I found [this](https://github.com/erikberglund/SwiftPrivilegedHelpe...
2019/01/19
[ "https://Stackoverflow.com/questions/54264378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/523079/" ]
I would check the file system if the binary exists (in /Library/PrivilegedHelperTools and if the plist exists in /Library/LaunchDaemons). Then you might contact the XPC service and call kind of a ping function which answers if the service is up and running. just my 2 cts, Robert
Background ========== It actually *is* possible to avoid a timeout waiting for the tool to respond. In fact, the `erikberglund/SwiftPrivilegedHelper` example you cited does print the word "No" beside the "Helper Installed" textfield if the tool is not enabled (see [here](https://github.com/erikberglund/SwiftPrivileged...
54,264,378
I'm writing a macOS app in Swift that needs a privileged helper tool -- wish the elevation wasn't necessary, but [it looks like it is](https://stackoverflow.com/questions/54174674/workaround-for-a-certain-ioserviceopen-call-requiring-root-privileges). I found [this](https://github.com/erikberglund/SwiftPrivilegedHelpe...
2019/01/19
[ "https://Stackoverflow.com/questions/54264378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/523079/" ]
Since you create the helper tool, simply add an XPC message handler to report the status of your tool. When you launch, connect and send that message. If any of that fails, your tool is not correctly installed (or isn't responding). In my code, all of my XPC services (which include my privileged helper) adopt a base p...
Background ========== It actually *is* possible to avoid a timeout waiting for the tool to respond. In fact, the `erikberglund/SwiftPrivilegedHelper` example you cited does print the word "No" beside the "Helper Installed" textfield if the tool is not enabled (see [here](https://github.com/erikberglund/SwiftPrivileged...
51,369,466
I have an Angular app that uses Firebase Authentication for logging in and then reading and writing data to a Firestore database. I want to do some e2e tests for it. I would rather write the tests with mocked data or a local server. I haven't found any local way of running Firestore so far. I saw that you can stub o...
2018/07/16
[ "https://Stackoverflow.com/questions/51369466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1241136/" ]
List all the sheet names and see if they are what you think they are. ``` Sub SheetNames() Columns(1).Insert For i = 1 To Sheets.Count Cells(i, 1) = Sheets(i).Name Next i End Sub ```
Can you try this? Modify to suit your needs. Also, can you get rid of the '!' symbol, at least for testing purposes. Make it work in a simple context, and then you can work your way up to more and more complex things. Usually it's not a good idea to start with more complex things, unless you are really confident that y...
72,558,240
i have a problem when I use my commands modal on my discord bot I don't know for what but this lines make conflicts : ``` const firstActionRow = new MessageActionRow().addComponents(favoriteColorInput); ``` this is the code of my command : ``` const { SlashCommandBuilder } = require('@discordjs/builders'); ...
2022/06/09
[ "https://Stackoverflow.com/questions/72558240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19297078/" ]
What your code does currently is that it shows the modal, then checks if the interaction which you received when the user ran the slash command was a modal submit. Instead, you need to create a new event listener for modal submits in the command by using `client.on('interactionCreate')`, then you need to check whether ...
I tested with that, but other problems surfaced: code : - `client.on('interactionCreate', (modalSubmit), async interaction => {` error : ``` /root/bot_adev/commands/modal.js:37 if (!modalSubmit.isModalSubmit()) return; ^ > ReferenceError: modalSubmit is not defined ```
578,649
I'm looking for shortcuts that would help me to navigate directories quickly and efficiently.
2020/04/08
[ "https://unix.stackexchange.com/questions/578649", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/402076/" ]
If you [check the contents of the repository with a web browser](http://ppa.launchpad.net/videolan/stable-daily/ubuntu/dists/), you'll see that this repository does not have a directory for release named `bionic`. This PPA seems to have ended support for release `bionic` or never had one. The repository name includes ...
What that error messgae means is that apt thinks that the repository that you are trying to update from is a bunch of random code from the internet. If you do in fact trust this source however, you can turn off checking if repositorys are secure by using the --allow-unauthenticated flag after apt update (e.g sudo apt u...
1,728
I am applying for job online and the form includes an area for me to list my references and our "Working Relationship". What should I write in that area? Also, when I report to a person who is the only other person in the company, what is their position: owner/manager/MD/CEO?
2012/06/07
[ "https://workplace.stackexchange.com/questions/1728", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/-1/" ]
One of: * My Manager * Directly Reported to me * Indirectly Reported to me * Colleague on the same team * Colleague on another team * Friend * Mentor * Family (best avoided when possible.) Terms may vary about between culture / country
> > What should I write in that area? > > > For the references you are putting down, how would you categorize the relationship: Is this person your manager, team lead, teammate, subordinate, or something else? Where in the organizational chart are you in relation to the reference. Was this person a client of yours...
15,242,170
Just to help other developers, because there is no similar question on SO. ``` div class=(is_active? ? 'active' : 'inactive') div class=('active' if is_active?) ```
2013/03/06
[ "https://Stackoverflow.com/questions/15242170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1085570/" ]
See the examples below: ``` div class=(is_active? ? 'active' : 'inactive') div class=('active' if is_active?) ``` The same approach can be used to assign dynamic values to other attributes.
If you have multiple conditions I am doing right now something like ``` div class=(('foo ' if is_foo?) + ('bar' if is_bar?)) ``` Though I feel it to be a blemish if is\_bar? return false and the generated HTML results in ``` <div class="foo "></div> ``` (the blemish is the blank character after the `foo`). If som...
15,242,170
Just to help other developers, because there is no similar question on SO. ``` div class=(is_active? ? 'active' : 'inactive') div class=('active' if is_active?) ```
2013/03/06
[ "https://Stackoverflow.com/questions/15242170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1085570/" ]
See the examples below: ``` div class=(is_active? ? 'active' : 'inactive') div class=('active' if is_active?) ``` The same approach can be used to assign dynamic values to other attributes.
I use array of classes and nil element if there is no need to include class in list, then compact array to remove nil elements and finally join all together. ``` div class=(["cday", "col-md-1", day.day == 1 ? "col-md-offset-#{day.cwday-1}" : nil].compact.join(' ')) ```
15,242,170
Just to help other developers, because there is no similar question on SO. ``` div class=(is_active? ? 'active' : 'inactive') div class=('active' if is_active?) ```
2013/03/06
[ "https://Stackoverflow.com/questions/15242170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1085570/" ]
I use array of classes and nil element if there is no need to include class in list, then compact array to remove nil elements and finally join all together. ``` div class=(["cday", "col-md-1", day.day == 1 ? "col-md-offset-#{day.cwday-1}" : nil].compact.join(' ')) ```
If you have multiple conditions I am doing right now something like ``` div class=(('foo ' if is_foo?) + ('bar' if is_bar?)) ``` Though I feel it to be a blemish if is\_bar? return false and the generated HTML results in ``` <div class="foo "></div> ``` (the blemish is the blank character after the `foo`). If som...
629,323
I have decided to mark down the mechanism that I have learnt. However, I have got some problem. I would like to use a vertical arrow on the second step but I do not know any command that can form a vertical arrow. Also, I would like to ask why part of my command does not count as command in the question part? ``` \doc...
2022/01/07
[ "https://tex.stackexchange.com/questions/629323", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/260882/" ]
As mentioned in the comment vertical arrows are drawn with `A\arrow[90]B`. In order to arrange the arrow to the plus sign see example below: ``` \documentclass[border=1cm]{standalone} \usepackage{chemfig} \begin{document} \schemestart A\subscheme{\+}BCDEF \arrow G \arrow(@c2--)[-90]H \schemesto...
Do you want something like this? Using \subscheme helps position the arrow in the center of each reaction step. ``` \begin{center} \schemestart % \subscheme{ \chemfig{-[:-60]C(-[:240])=_[@{a1}]C(-[:60])(-[:-60])} \arrow{0}[,0]\+ \chemfig{@{a2}H-[@{a3}]@{b1}X@{z}} } % ...
54,388,514
I have the contents of a text file in a php string. Now I want to store the two characters which occur before the following strings - `"(A)","(B)","(C)","(B+)"` For example if the `php` variable contains something like - ``` 33(F) 15352(1) 24 31 55(B+) 15360(1) 6 32 38 70(A) 2 3 4 5 6 7 8 9 10 10 *Passed with Grace Ma...
2019/01/27
[ "https://Stackoverflow.com/questions/54388514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This is a much better answer than mine (by @Andreas): ``` $re = '/(\d+)\(([A-Z]\+?)\)/m'; $str = '33(F) 15352(1) 24 31 55(B+) 56(B+) 15360(1) 6 32 38 70(A) 2 3 4 5 6 7 8 9 10 10 *Passed with Grace Marks *SID: Student ID; SchemeID: The scheme applicable to the s...
Another option is to using [preg\_match\_all](http://php.net/manual/en/function.preg-match-all.php) and capture 1+ digits `\d+` (or 2 digits exactly `\d{2}` in a capturing group followed by matching an uppercase char followed by an optional plus sign `\([A-Z]\+?` Then from the resulting array convert the values using ...