qid
int64
20
74.4M
question
stringlengths
36
16.3k
date
stringlengths
10
10
metadata
listlengths
3
3
response_j
stringlengths
33
24k
response_k
stringlengths
33
23k
25,948,218
My java project has files which have same name but different cases (Test.java & test.java). I have setup a case sensitive file system on my mac and am able to view/edit them via CLI. However, Intellij Idea does not regard them as different and compilation fails. How can I fix Intellij Idea to honor cases for a file nam...
2014/09/20
[ "https://Stackoverflow.com/questions/25948218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367890/" ]
I filed a support request at JetBrains. Here is the answer: > > add "idea.case.sensitive.fs=true" to bin/idea.properties file (<https://intellij-support.jetbrains.com/entries/23395793> ), perform File | Invalidate Caches and restart the IDE. > > > It solved the issue for me. update: 2015-02-14 / Idea 14.0.3 It ...
To update your case sensitive settings you can simply run the folowing in your shell (Path would have to be changed for InteliJ as I use php storm but should work for the jet brains products) ``` echo idea.case.sensitive.fs=true >> /Applications/PhpStorm.app/Contents/bin/idea.properties ```
25,948,218
My java project has files which have same name but different cases (Test.java & test.java). I have setup a case sensitive file system on my mac and am able to view/edit them via CLI. However, Intellij Idea does not regard them as different and compilation fails. How can I fix Intellij Idea to honor cases for a file nam...
2014/09/20
[ "https://Stackoverflow.com/questions/25948218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367890/" ]
I filed a support request at JetBrains. Here is the answer: > > add "idea.case.sensitive.fs=true" to bin/idea.properties file (<https://intellij-support.jetbrains.com/entries/23395793> ), perform File | Invalidate Caches and restart the IDE. > > > It solved the issue for me. update: 2015-02-14 / Idea 14.0.3 It ...
It looks like the best option may be to add the idea.properties option to user profile configuration rather than global. See the first comment here: <https://confluence.jetbrains.com/display/IDEADEV/Filesystem+Case-Sensitivity+Mismatch> Also this page mentions where the idea.properties file should go, if you don't h...
25,948,218
My java project has files which have same name but different cases (Test.java & test.java). I have setup a case sensitive file system on my mac and am able to view/edit them via CLI. However, Intellij Idea does not regard them as different and compilation fails. How can I fix Intellij Idea to honor cases for a file nam...
2014/09/20
[ "https://Stackoverflow.com/questions/25948218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367890/" ]
To update your case sensitive settings you can simply run the folowing in your shell (Path would have to be changed for InteliJ as I use php storm but should work for the jet brains products) ``` echo idea.case.sensitive.fs=true >> /Applications/PhpStorm.app/Contents/bin/idea.properties ```
It looks like the best option may be to add the idea.properties option to user profile configuration rather than global. See the first comment here: <https://confluence.jetbrains.com/display/IDEADEV/Filesystem+Case-Sensitivity+Mismatch> Also this page mentions where the idea.properties file should go, if you don't h...
963,370
I'm trying to install the SSRS data connector for my CRM4 implementation. I'm using the [Method 2: Modify the Install-config.xml file from this page](http://support.microsoft.com/kb/947060). But keep getting the same error message: > > Unable to validate SQL Server Reporting Services Report Server > installation. Pl...
2009/06/08
[ "https://Stackoverflow.com/questions/963370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You may need to post more details regarding this issue: 1) The 2nd method described in this link : [here](http://support.microsoft.com/kb/947060) is used when the Reporting Server database is installed using the SQL Server named instance. Are you installing the Reporting Server database in the default instance or named...
I realise this is a really old article however I wanted to post the resolution I found to work as I have spent the past 3 days trying to resolve this issue! I created an account just to post this. I was having the same problem as the original article. I had SSRS 2008 installed on a server, CRM (4.0!!!) on a different ...
3,873,110
I have a table with two number columns, and a unique constraint over them both. I would like to insert a new pair of values UNLESS the pair already exists. What is the simplest way to do this? If I do ``` insert into TABLE values (100,200) ``` and the pair already exists I get a ORA-00001 error, so I would like t...
2010/10/06
[ "https://Stackoverflow.com/questions/3873110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64082/" ]
You can use [MERGE](http://psoug.org/reference/merge.html)
You can try something like: ``` insert into table select :a, :b from dual where not exists (select 1 from table where column1 = :a and column2=:b) ```
4,162,930
Let it be $\alpha=1+\sqrt[3]{5}\,i$ and $f(x)$ the minimal polynomial of $\alpha$ in $\mathbb{Q}$. Is $\mathbb{Q}(\alpha)$ the splitting field of $\alpha$? I generally know how to deal with splitting field when the roots are simple but I dont know how to deal with this or in general when minimal polynomial aren't tha...
2021/06/04
[ "https://math.stackexchange.com/questions/4162930", "https://math.stackexchange.com", "https://math.stackexchange.com/users/918258/" ]
For your example, let $\beta=\sqrt[3]5i$, then we have $\beta^6=-25$. Clearly $\beta$ has degree 6 over $\mathbb Q$, and its conjugates are given by $\beta\zeta^k$, $k=0,\dots,5$, where $\zeta=\frac{1+\sqrt3i}2$ is a primitive sixth root of unity. Therefore, the extension $\mathbb Q(\beta)/\mathbb Q$ is not Galois, bec...
Knowing that ℚ(1+∛5i)=ℚ(∛5i) and that ∛5i is root of the polynomial x^6+25, then the splitting field must be ℚ(∛5i\*ω), where ω is a primitive root of x^6-1. Thus, ℚ(α) isn't the splitting field.
20,981,466
I'm facing problem with jquery here is my code ``` <script type='text/javascript' src='jquery-1.10.2.min.js'></script> <script type="text/javascript"> $(function() { $(".more2").click(function() { var element = $(this); var msg = element.attr("id"); $.ajax({ type: "POST", url: "insta2.php", ...
2014/01/07
[ "https://Stackoverflow.com/questions/20981466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69821/" ]
Looking at the [source](https://github.com/thquinn/DraggableGridView) you provided, the `DraggableGridView` class is already under `src`. So adding the jar that contains the same is redundant and dex will complain about duplicate definitions. To fix it, just remove the `DraggableGridView.jar` from your project.
Project - build Path - Libraries. Check if android private libraries contains the same jars listed in the libraries in the first place. If so remove private libraries and leave the jars. That worked for me.
20,981,466
I'm facing problem with jquery here is my code ``` <script type='text/javascript' src='jquery-1.10.2.min.js'></script> <script type="text/javascript"> $(function() { $(".more2").click(function() { var element = $(this); var msg = element.attr("id"); $.ajax({ type: "POST", url: "insta2.php", ...
2014/01/07
[ "https://Stackoverflow.com/questions/20981466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69821/" ]
Looking at the [source](https://github.com/thquinn/DraggableGridView) you provided, the `DraggableGridView` class is already under `src`. So adding the jar that contains the same is redundant and dex will complain about duplicate definitions. To fix it, just remove the `DraggableGridView.jar` from your project.
Add all the jars in the libs folder externally and uncheck the android private libraries this should work
20,981,466
I'm facing problem with jquery here is my code ``` <script type='text/javascript' src='jquery-1.10.2.min.js'></script> <script type="text/javascript"> $(function() { $(".more2").click(function() { var element = $(this); var msg = element.attr("id"); $.ajax({ type: "POST", url: "insta2.php", ...
2014/01/07
[ "https://Stackoverflow.com/questions/20981466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69821/" ]
Project - build Path - Libraries. Check if android private libraries contains the same jars listed in the libraries in the first place. If so remove private libraries and leave the jars. That worked for me.
Add all the jars in the libs folder externally and uncheck the android private libraries this should work
34,379,584
I shoul use setText() but how should I use it instead of System.out.println()? I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question. ``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { ...
2015/12/20
[ "https://Stackoverflow.com/questions/34379584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184742/" ]
You need to use **Logs** to print and debug stuff in android. Generally there are **five methods**, ``` Log.v() Log.d() Log.i() Log.w() and Log.e() ``` > > v for Verbose > > > d for Debug > > > i for Info > > > w for Warnings > > > e for Error > > > **In your case** ``` Log.d("Key", json.toString() +...
You can use a [`CharArrayWriter`](http://developer.android.com/reference/java/io/CharArrayWriter.html) to collect the output: ``` CharArrayWriter writer = new CharArrayWriter(); // write your stuff TextView view = ... view.setText(writer.toString()); ``` You'll have to use the methods available to a `Writer` rather ...
34,379,584
I shoul use setText() but how should I use it instead of System.out.println()? I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question. ``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { ...
2015/12/20
[ "https://Stackoverflow.com/questions/34379584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184742/" ]
You will need to print the result in a TextView if you want to view the result on phone instead of LogCat console as suggested by johnrao07. To print result in a TextView first add a TextView widget in activity\_main.xml layout file. ``` <TextView android:id="@+id/text_view_id" android:layout_width="...
You need to use **Logs** to print and debug stuff in android. Generally there are **five methods**, ``` Log.v() Log.d() Log.i() Log.w() and Log.e() ``` > > v for Verbose > > > d for Debug > > > i for Info > > > w for Warnings > > > e for Error > > > **In your case** ``` Log.d("Key", json.toString() +...
34,379,584
I shoul use setText() but how should I use it instead of System.out.println()? I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question. ``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { ...
2015/12/20
[ "https://Stackoverflow.com/questions/34379584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184742/" ]
You need to use **Logs** to print and debug stuff in android. Generally there are **five methods**, ``` Log.v() Log.d() Log.i() Log.w() and Log.e() ``` > > v for Verbose > > > d for Debug > > > i for Info > > > w for Warnings > > > e for Error > > > **In your case** ``` Log.d("Key", json.toString() +...
``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Thread(new Runnable(){ public void run(){ JSONObject json = readJsonFromUrl("http://www.w3schoo...
34,379,584
I shoul use setText() but how should I use it instead of System.out.println()? I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question. ``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { ...
2015/12/20
[ "https://Stackoverflow.com/questions/34379584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184742/" ]
You will need to print the result in a TextView if you want to view the result on phone instead of LogCat console as suggested by johnrao07. To print result in a TextView first add a TextView widget in activity\_main.xml layout file. ``` <TextView android:id="@+id/text_view_id" android:layout_width="...
You can use a [`CharArrayWriter`](http://developer.android.com/reference/java/io/CharArrayWriter.html) to collect the output: ``` CharArrayWriter writer = new CharArrayWriter(); // write your stuff TextView view = ... view.setText(writer.toString()); ``` You'll have to use the methods available to a `Writer` rather ...
34,379,584
I shoul use setText() but how should I use it instead of System.out.println()? I want to print the result in a TextView. The code is a json reader. sorry I need to write some text to let me post my question. ``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { ...
2015/12/20
[ "https://Stackoverflow.com/questions/34379584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5184742/" ]
You will need to print the result in a TextView if you want to view the result on phone instead of LogCat console as suggested by johnrao07. To print result in a TextView first add a TextView widget in activity\_main.xml layout file. ``` <TextView android:id="@+id/text_view_id" android:layout_width="...
``` public class JsonReader extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new Thread(new Runnable(){ public void run(){ JSONObject json = readJsonFromUrl("http://www.w3schoo...
39,041,257
How optimize an API call in symfony? I call with Guzzle bundle, but the time in some situations is very long. In client application call a function from the server. In server application extract the objects from the database and send back to the client. In client creat the new object with properties from server resp...
2016/08/19
[ "https://Stackoverflow.com/questions/39041257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
One of the ways to improve your API calls is to use caching. In Symfony there are many different ways to achieve this. I can show you one of them (`PhpFileCache` example): In **services.yml** create cache service: ``` your_app.cache_provider: class: Doctrine\Common\Cache\PhpFileCache arguments: ["%kernel.cach...
**If you control the server** You should put a cache reverse proxy like Varnish on top of your PHP server. The PHP app must send HTTP cache headers to tell to the proxy how many time it must cache the request. Alternatively, you can use a library like [FOSHttpCache](http://foshttpcachebundle.readthedocs.io/en/latest/)...
86,352
``` > CREATE TABLE test(foo FLOAT); > INSERT INTO test VALUES(1.2899999); > SELECT * FROM test; +------+ | foo | +------+ | 1.29 | +------+ ``` While it's obvious that FLOAT is not a precise data type, it is still rounding this data too arbitrarily. Let's check if it's actually able to store it: ``` > ALTER TABLE t...
2014/12/16
[ "https://dba.stackexchange.com/questions/86352", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/9479/" ]
I hate precision-based issues. I dealt with one before: [Data Truncated for Column](https://dba.stackexchange.com/questions/4091/data-truncated-for-column/4094#4094) You may have do the ALTER TABLE manually ``` CREATE TABLE test_new LIKE test; ALTER TABLE test_new MODIFY foo DOUBLE; INSERT INTO test_new (foo) SELECT ...
Maybe this post could be somehow useful for your question - as far as I had experience with till now (even in ERP db we serviced for nearly 5 years) type `FLOAT` or `DOUBLE` was almost never used. Instead of it all the fields storing values like cost prices, purchase prices, stock item characteristics, warehouse, prod...
34,494
I have a data-set of genetic variants which I'm trying to use as predictors for a simple phenotype, and for starters I use a binary logistic regression in SPSS. I have around 900 individuals, and for each individual around 50 variations and a phenotype. However, I get an unreasonably high amount of removed values when...
2012/08/17
[ "https://stats.stackexchange.com/questions/34494", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/12259/" ]
SPSS removes cases [list-wise](http://en.wikipedia.org/wiki/Listwise_deletion) by default, and in my experience this is the case for the majority of statistical procedures. So if a case is missing data for any of the variables in the analysis it will be dropped entirely from the model. For generating correlation matric...
Ran into this problem too, the only option for missing case deletion in logistic regression is listwise. It is very weird that its not an option, there are certainly cases where pairwise deletion is appropriate (e.g. ipsative data) I recommend switching to R Its a steep learning curve but well worth it for the degree...
74,309,944
I have a db like this: ``` tibble(Q1 = c("0","A"), Q2 = c("A","A"), Q3 = c("0","A"), C1 = c("A","0") ) -> DB ``` I aim to add a new column which is a count of how many `"0"` are detected in the row when the column starts with `"Q"`. In this case, this column would be like ``` DB %>% mutate(S =...
2022/11/03
[ "https://Stackoverflow.com/questions/74309944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17122831/" ]
```r DB %>% rowwise() %>% mutate(S = sum(c_across(starts_with("Q")) == "0")) %>% ungroup() # # A tibble: 2 x 5 # Q1 Q2 Q3 C1 S # <chr> <chr> <chr> <chr> <int> # 1 0 A 0 A 2 # 2 A A A 0 0 ```
One possible solution: ``` DB %>% mutate(S = rowSums(.[startsWith(names(.), "Q")]=="0")) # A tibble: 2 x 5 Q1 Q2 Q3 C1 S <chr> <chr> <chr> <chr> <dbl> 1 0 A 0 A 2 2 A A A 0 0 ```
20,928,413
I am getting odd redirection in general. It works in development but not production. Here are the responses for an update. The same things happens on a create. DEVELOPMENT ``` Redirected to http://localhost:3000/trackers Completed 302 Found in 43ms (ActiveRecord: 18.7ms) Started GET "/trackers" for 127.0.0.1 at 2014...
2014/01/05
[ "https://Stackoverflow.com/questions/20928413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938097/" ]
`$scope.$digest()` is what processes all of the `$watch` events that are on the current and children scope. It essentially manually tells the scope to check if a scope variable has changed. You don't generally want to use this when you are inside of a controller or a directive, because the `$scope.$apply()` function ca...
You don't need a `$rootScope.$digest` here because resolving/rejecting the promise will fire a `$rootScope.$digest` internally, as `$interval`,`$timeout`,and `$http` (after request finished) do that for you. And this `$digest` can throw errors of `$digest` already in progress.
13,279,390
Write a program that reads in a series of first names and eliminates duplicates by storing them in a Set. Allow the user to search for a first name. (Trust me, I am not taking any Java classes. So, not my homework). My issue is to implement this: **Allow the user to search for a first name.** Everything else works, ...
2012/11/07
[ "https://Stackoverflow.com/questions/13279390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1415064/" ]
Use `language.ShowDialog();`. Per [MSDN](http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx), the code following it is not executed until after the dialog box is closed.
It's a little dangerous to put code before `InitializeComponent` - you'll run into `NullReferenceException`s if you forget to avoid trying to touch controls on your form. Updating member fields is OK, though. Could the code that loads `FrmMain` load and execute `FrmLanguage` first, perhaps near the place where the INI...
13,279,390
Write a program that reads in a series of first names and eliminates duplicates by storing them in a Set. Allow the user to search for a first name. (Trust me, I am not taking any Java classes. So, not my homework). My issue is to implement this: **Allow the user to search for a first name.** Everything else works, ...
2012/11/07
[ "https://Stackoverflow.com/questions/13279390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1415064/" ]
Use `language.ShowDialog();`. Per [MSDN](http://msdn.microsoft.com/en-us/library/c7ykbedk.aspx), the code following it is not executed until after the dialog box is closed.
I'm not sure if this will work, so just let me know if it helps you. In your Main() method, you could load the first form with: ``` Application.Run(new FrmLanguage()); ``` Then from that form gather the language setting, and load the other form like normal.
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
The second chunk of code is just about the best approach you can get all other things staying the same. However, it may be possible to create a property on `Something` which takes `Item`. In turn the event code could access this `Item` off the sender of the event or it might be included in the eventargs for the event....
The problem you are facing here is related to such language construct as **closure**. Second piece of code fixes the problem.
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
If ItemCollection is a [(generic) List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) you can use its [ForEach](http://msdn.microsoft.com/en-us/library/bwabdf9z.aspx)-method. It will give you a fresh scope per i: ``` ItemCollection.ForEach( i => { Something s = new Something(); s.Event...
The problem you are facing here is related to such language construct as **closure**. Second piece of code fixes the problem.
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
UPDATE: There is extensive analysis and commentary on this issue here: <http://ericlippert.com/2009/11/12/closing-over-the-loop-variable-considered-harmful-part-one/> --- This is an extremely frequently reported issue; usually it is reported as a compiler bug, but in fact the compiler is doing the right thing accord...
The problem you are facing here is related to such language construct as **closure**. Second piece of code fixes the problem.
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
The second chunk of code is just about the best approach you can get all other things staying the same. However, it may be possible to create a property on `Something` which takes `Item`. In turn the event code could access this `Item` off the sender of the event or it might be included in the eventargs for the event....
``` foreach(Item i on ItemCollection) { Something s = new Something(i); s.EventX += (sender, eventArgs) => { ProcessItem(eventArgs.Item);}; SomethingCollection.Add(s); } ``` would you not just pass 'i' in into your 'Something' Class and use it in EventX's event args
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
The second chunk of code is just about the best approach you can get all other things staying the same. However, it may be possible to create a property on `Something` which takes `Item`. In turn the event code could access this `Item` off the sender of the event or it might be included in the eventargs for the event....
If ItemCollection is a [(generic) List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) you can use its [ForEach](http://msdn.microsoft.com/en-us/library/bwabdf9z.aspx)-method. It will give you a fresh scope per i: ``` ItemCollection.ForEach( i => { Something s = new Something(); s.Event...
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
UPDATE: There is extensive analysis and commentary on this issue here: <http://ericlippert.com/2009/11/12/closing-over-the-loop-variable-considered-harmful-part-one/> --- This is an extremely frequently reported issue; usually it is reported as a compiler bug, but in fact the compiler is doing the right thing accord...
The second chunk of code is just about the best approach you can get all other things staying the same. However, it may be possible to create a property on `Something` which takes `Item`. In turn the event code could access this `Item` off the sender of the event or it might be included in the eventargs for the event....
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
If ItemCollection is a [(generic) List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) you can use its [ForEach](http://msdn.microsoft.com/en-us/library/bwabdf9z.aspx)-method. It will give you a fresh scope per i: ``` ItemCollection.ForEach( i => { Something s = new Something(); s.Event...
``` foreach(Item i on ItemCollection) { Something s = new Something(i); s.EventX += (sender, eventArgs) => { ProcessItem(eventArgs.Item);}; SomethingCollection.Add(s); } ``` would you not just pass 'i' in into your 'Something' Class and use it in EventX's event args
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
UPDATE: There is extensive analysis and commentary on this issue here: <http://ericlippert.com/2009/11/12/closing-over-the-loop-variable-considered-harmful-part-one/> --- This is an extremely frequently reported issue; usually it is reported as a compiler bug, but in fact the compiler is doing the right thing accord...
``` foreach(Item i on ItemCollection) { Something s = new Something(i); s.EventX += (sender, eventArgs) => { ProcessItem(eventArgs.Item);}; SomethingCollection.Add(s); } ``` would you not just pass 'i' in into your 'Something' Class and use it in EventX's event args
1,600,597
Suppose the following code: ``` foreach(Item i on ItemCollection) { Something s = new Something(); s.EventX += delegate { ProcessItem(i); }; SomethingCollection.Add(s); } ``` Of course, this is wrong because all the delegates points to the same Item. The alternative is: ``` foreach(Item i on ItemCollection...
2009/10/21
[ "https://Stackoverflow.com/questions/1600597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40441/" ]
UPDATE: There is extensive analysis and commentary on this issue here: <http://ericlippert.com/2009/11/12/closing-over-the-loop-variable-considered-harmful-part-one/> --- This is an extremely frequently reported issue; usually it is reported as a compiler bug, but in fact the compiler is doing the right thing accord...
If ItemCollection is a [(generic) List](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) you can use its [ForEach](http://msdn.microsoft.com/en-us/library/bwabdf9z.aspx)-method. It will give you a fresh scope per i: ``` ItemCollection.ForEach( i => { Something s = new Something(); s.Event...
471,949
Let's take the function $f(x)=x^{-1}$. My question is this: Is the sum $$\frac{1}{x-a}+\frac{1}{x+a}$$ as $a\rightarrow 0$ near the point $x=0$ equal 0? And how would I proove this anytime I encounter this kind of limit? How would this work with derivatives or integrals?
2013/08/20
[ "https://math.stackexchange.com/questions/471949", "https://math.stackexchange.com", "https://math.stackexchange.com/users/47567/" ]
The quantity you seem to be asking about is $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}$$ "near" $x=0.$ Well, assuming that $x$ is not $0,$ then this is simply $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}=\frac1x+\frac1x=\frac2x$$ by continuity. Now, if $x=0,$ then we have $$\lim\_{a\to 0}\frac{1}{x-a}+\frac{1}{x+a}=\li...
Well, it depends what limit are you evaluating first. First, $\lim\_{a\to 0}(\lim\_{x\to 0} (\frac{1}{x-a}+\frac{1}{x+a}))=\lim\_{a\to 0}0=0$, but, on the other hand, you have $\lim\_{x\to 0}(\lim\_{a\to 0} (\frac{1}{x-a}+\frac{1}{x+a}))=\lim\_{x\to 0}\frac{2}{x}$ and this limit does not exist. So, the order of taking...
118,606
I am a 15-year-old female, and I am currently a high soprano. I can currently sing from a low C4 to a high F above the bar. Is there a way I could get higher and become a coloratura soprano or gain an octave?
2021/11/18
[ "https://music.stackexchange.com/questions/118606", "https://music.stackexchange.com", "https://music.stackexchange.com/users/83089/" ]
You already have a full soprano range: C4 to F6. Coloratura is a vocal quality, not a range. Coloratura voices generally have a light quality to them, as opposed to the more powerful voice of a dramatic soprano. Coloraturas specialize in highly decorative passages with lots of runs, trills, and other ornaments. So col...
You dont just simply add a octave. Most singers range is between an octave and maybe a 10th. Even then a 10th is extraordinary. Singing around middle C is hard for soprano and very few ever get to the fabled nessum dorma high B. Your range will gravitate between the E above middle C to the G a tenth above it. That is...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
Dapper does not currently have an instrumentation point here. This is perhaps due, as you note, to the fact that we (as the authors) use mini-profiler to handle this. However, if it helps, the core parts of mini-profiler are actually designed to be architecture neutral, and I know of other people using it with winforms...
You should consider using SQL profiler located in the menu of *SQL Management Studio* ***→ Extras → SQL Server Profiler*** (no Dapper extensions needed - may work with other RDBMS when they got a SQL profiler tool too). Then, start a new session. You'll get something like this for example (you see all parameters and ...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
I got the same issue and implemented some code after doing some search but having no ready-to-use stuff. There is a package on nuget [MiniProfiler.Integrations](https://www.nuget.org/packages/MiniProfiler.Integrations/) I would like to share. **Update V2**: it supports to work with other database servers, for MySQL it...
You should consider using SQL profiler located in the menu of *SQL Management Studio* ***→ Extras → SQL Server Profiler*** (no Dapper extensions needed - may work with other RDBMS when they got a SQL profiler tool too). Then, start a new session. You'll get something like this for example (you see all parameters and ...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
Try [Dapper.Logging](https://github.com/hryz/Dapper.Logging/tree/71f4f3de06b95f131e84171698e0d3ed7cb52f83). ----------------------------------------------------------------------------------------------------------- You can get it from NuGet. The way it works is you pass your code that creates your actual database con...
This is not exhaustive and is essentially a bit of hack, but if you have your SQL and you want to initialize your parameters, it's useful for basic debugging. Set up this extension method, then call it anywhere as desired. ``` public static class DapperExtensions { public static string ArgsAsSql(this DynamicParame...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
You should consider using SQL profiler located in the menu of *SQL Management Studio* ***→ Extras → SQL Server Profiler*** (no Dapper extensions needed - may work with other RDBMS when they got a SQL profiler tool too). Then, start a new session. You'll get something like this for example (you see all parameters and ...
This is not exhaustive and is essentially a bit of hack, but if you have your SQL and you want to initialize your parameters, it's useful for basic debugging. Set up this extension method, then call it anywhere as desired. ``` public static class DapperExtensions { public static string ArgsAsSql(this DynamicParame...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
I got the same issue and implemented some code after doing some search but having no ready-to-use stuff. There is a package on nuget [MiniProfiler.Integrations](https://www.nuget.org/packages/MiniProfiler.Integrations/) I would like to share. **Update V2**: it supports to work with other database servers, for MySQL it...
This is not exhaustive and is essentially a bit of hack, but if you have your SQL and you want to initialize your parameters, it's useful for basic debugging. Set up this extension method, then call it anywhere as desired. ``` public static class DapperExtensions { public static string ArgsAsSql(this DynamicParame...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
Dapper does not currently have an instrumentation point here. This is perhaps due, as you note, to the fact that we (as the authors) use mini-profiler to handle this. However, if it helps, the core parts of mini-profiler are actually designed to be architecture neutral, and I know of other people using it with winforms...
This is not exhaustive and is essentially a bit of hack, but if you have your SQL and you want to initialize your parameters, it's useful for basic debugging. Set up this extension method, then call it anywhere as desired. ``` public static class DapperExtensions { public static string ArgsAsSql(this DynamicParame...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
Dapper does not currently have an instrumentation point here. This is perhaps due, as you note, to the fact that we (as the authors) use mini-profiler to handle this. However, if it helps, the core parts of mini-profiler are actually designed to be architecture neutral, and I know of other people using it with winforms...
Just to add an update here since I see this question still get's quite a few hits - these days I use either [Glimpse](http://getglimpse.com/) (seems it's dead now) or [Stackify Prefix](https://stackify.com/prefix/) which both have sql command trace capabilities. It's not exactly what I was looking for when I asked the...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
I got the same issue and implemented some code after doing some search but having no ready-to-use stuff. There is a package on nuget [MiniProfiler.Integrations](https://www.nuget.org/packages/MiniProfiler.Integrations/) I would like to share. **Update V2**: it supports to work with other database servers, for MySQL it...
Try [Dapper.Logging](https://github.com/hryz/Dapper.Logging/tree/71f4f3de06b95f131e84171698e0d3ed7cb52f83). ----------------------------------------------------------------------------------------------------------- You can get it from NuGet. The way it works is you pass your code that creates your actual database con...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
I got the same issue and implemented some code after doing some search but having no ready-to-use stuff. There is a package on nuget [MiniProfiler.Integrations](https://www.nuget.org/packages/MiniProfiler.Integrations/) I would like to share. **Update V2**: it supports to work with other database servers, for MySQL it...
Dapper does not currently have an instrumentation point here. This is perhaps due, as you note, to the fact that we (as the authors) use mini-profiler to handle this. However, if it helps, the core parts of mini-profiler are actually designed to be architecture neutral, and I know of other people using it with winforms...
18,529,965
Is there a way to dump the generated sql to the Debug log or something? I'm using it in a winforms solution so the mini-profiler idea won't work for me.
2013/08/30
[ "https://Stackoverflow.com/questions/18529965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11421/" ]
You should consider using SQL profiler located in the menu of *SQL Management Studio* ***→ Extras → SQL Server Profiler*** (no Dapper extensions needed - may work with other RDBMS when they got a SQL profiler tool too). Then, start a new session. You'll get something like this for example (you see all parameters and ...
Just to add an update here since I see this question still get's quite a few hits - these days I use either [Glimpse](http://getglimpse.com/) (seems it's dead now) or [Stackify Prefix](https://stackify.com/prefix/) which both have sql command trace capabilities. It's not exactly what I was looking for when I asked the...
2,507,595
I'm using Google Test Framework to set some unit tests. I have got three projects in my solution: * FN (my project) * FN\_test (my tests) * gtest (Google Test Framework) I set FN\_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd ...
2010/03/24
[ "https://Stackoverflow.com/questions/2507595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241161/" ]
I found the answer to be a rather simple one. After two days of intense headknocking, it's this: **You have to compile your main project as `.lib` and not `.exe`** After doing this, all linking went as a bliss. I thought Visual Studio would do this automatically for me, since I declared a dependency to FN from FN\_te...
The linker can't find the definition of the `Embark` constructor. * Have you defined that constructor somewhere? * Is your test project actually linking to the FN library?
2,507,595
I'm using Google Test Framework to set some unit tests. I have got three projects in my solution: * FN (my project) * FN\_test (my tests) * gtest (Google Test Framework) I set FN\_test to have FN and gtest as references (dependencies), and then I think I'm ready to set up my tests (I've already set everyone to /MTd ...
2010/03/24
[ "https://Stackoverflow.com/questions/2507595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241161/" ]
I found the answer to be a rather simple one. After two days of intense headknocking, it's this: **You have to compile your main project as `.lib` and not `.exe`** After doing this, all linking went as a bliss. I thought Visual Studio would do this automatically for me, since I declared a dependency to FN from FN\_te...
The linker can't find `Embark::Embark(int, int)` Here is what MSDN says about error [LNK2019](http://msdn.microsoft.com/en-us/library/799kze2z(VS.80).aspx).
23,880,663
What we take for granted in other languages and almost expect it to work in go, won't work - its almost so natural to do this, so why isn't the compiler happy? Just feeling like bailing out of go sometimes. The only way to increment the value is to put it in its own separate line? <http://play.golang.org/p/_UnpZVSN9...
2014/05/27
[ "https://Stackoverflow.com/questions/23880663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901460/" ]
`++` and `--` are statements in golang, not expressions
Specifically, `++` and `--` are statements because it can be very difficult to understand the order of evaluation when they're in an expression. Consider the following: ``` // This is not valid Go! x := 1 x = x++ + x y := 1 y = ++y + y ``` What would you expect `x` to be? What would you expect `y` to be? By contras...
23,880,663
What we take for granted in other languages and almost expect it to work in go, won't work - its almost so natural to do this, so why isn't the compiler happy? Just feeling like bailing out of go sometimes. The only way to increment the value is to put it in its own separate line? <http://play.golang.org/p/_UnpZVSN9...
2014/05/27
[ "https://Stackoverflow.com/questions/23880663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901460/" ]
`++` and `--` are statements in golang, not expressions
Just to help clarify, an expression has a `=`, `:=` or `+=` in them. A statement (such as `++` and `—`) does not. See <https://stackoverflow.com/a/1720029/12817546>. ``` package main import "fmt" var x int func f(x int) { x = x + 1 //expression x++ //statement fmt.Println(x) //2 } func ...
23,880,663
What we take for granted in other languages and almost expect it to work in go, won't work - its almost so natural to do this, so why isn't the compiler happy? Just feeling like bailing out of go sometimes. The only way to increment the value is to put it in its own separate line? <http://play.golang.org/p/_UnpZVSN9...
2014/05/27
[ "https://Stackoverflow.com/questions/23880663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901460/" ]
Specifically, `++` and `--` are statements because it can be very difficult to understand the order of evaluation when they're in an expression. Consider the following: ``` // This is not valid Go! x := 1 x = x++ + x y := 1 y = ++y + y ``` What would you expect `x` to be? What would you expect `y` to be? By contras...
Just to help clarify, an expression has a `=`, `:=` or `+=` in them. A statement (such as `++` and `—`) does not. See <https://stackoverflow.com/a/1720029/12817546>. ``` package main import "fmt" var x int func f(x int) { x = x + 1 //expression x++ //statement fmt.Println(x) //2 } func ...
1,483,068
The charset is Unicode. I want to write a string of CString type into a file, and then read it out from the file afterwards. I write the string into a file with CFile::Write() method: ``` int nLen = strSample.GetLength()*sizeof(TCHAR); file.Write(strSample.GetBuffer(), nLen); ``` Here is the question: I want to obta...
2009/09/27
[ "https://Stackoverflow.com/questions/1483068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87955/" ]
``` UINT nBytes = (UINT)file.GetLength(); int nChars = nBytes / sizeof(TCHAR); nBytes = file.Read(strSample.GetBuffer(nChars), nBytes); strSample.ReleaseBuffer(nChars); ```
I think you forgot to include the '\0' at the end strSample.GetLength() + 1
1,483,068
The charset is Unicode. I want to write a string of CString type into a file, and then read it out from the file afterwards. I write the string into a file with CFile::Write() method: ``` int nLen = strSample.GetLength()*sizeof(TCHAR); file.Write(strSample.GetBuffer(), nLen); ``` Here is the question: I want to obta...
2009/09/27
[ "https://Stackoverflow.com/questions/1483068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87955/" ]
``` UINT nBytes = (UINT)file.GetLength(); int nChars = nBytes / sizeof(TCHAR); nBytes = file.Read(strSample.GetBuffer(nChars), nBytes); strSample.ReleaseBuffer(nChars); ```
I would try this, since it can be that the file is larger than what is read (DOS style end line). Read does not set the final \0, but ReleaseBuffer apparently does, if not called with -1. ``` UINT nBytes = (UINT)file.GetLength(); UINT nBytesRead = file.Read(strSample.GetBuffer(nBytes+1), nBytes); strSample.ReleaseBuff...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
Good question, here's my attempt. You still have to convert your input signal from the time domain to s domain, then do the math, then convert the result back to the time domain. That pole just tells you where the resonance is, the behavior of the resonance is usually "growing infinitely forever" - but the exact behavi...
Here is my (very short) answer: All the calculations in the frequency domain (transfer function, input-and output impedances, pole location,..) do consider STEADY STATE conditions for the circuit under test. Therefore - due to the time dependence of your input - you cannot expect that the circuit will react upon such ...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
Good question, here's my attempt. You still have to convert your input signal from the time domain to s domain, then do the math, then convert the result back to the time domain. That pole just tells you where the resonance is, the behavior of the resonance is usually "growing infinitely forever" - but the exact behavi...
[KD9PDP's answer](https://electronics.stackexchange.com/a/551541/95619) alreay explains very nice (+1) why the result is as you see it, but there might be an easier way to do it. You already have the impulse response (1) and the input (2): $$\begin{align} h(t)&=\dfrac{1}{RC}\mathrm{e}^{-\frac{t}{RC}}\tag{1} \\ s(t)&=\...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
Good question, here's my attempt. You still have to convert your input signal from the time domain to s domain, then do the math, then convert the result back to the time domain. That pole just tells you where the resonance is, the behavior of the resonance is usually "growing infinitely forever" - but the exact behavi...
If the system's impulse response is \$h(t)=e^{-at}u(t)\$, \$a>0\$, where \$u(t)\$ is the unit step function, and if its input is \$x(t)=e^{-at}u(t)\$, then its response is given by $$y(t)=te^{-at}u(t)\tag{1}$$ which is a basic result. The function \$(1)\$ is just the inverse Laplace transform of a double real-valued ...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
Good question, here's my attempt. You still have to convert your input signal from the time domain to s domain, then do the math, then convert the result back to the time domain. That pole just tells you where the resonance is, the behavior of the resonance is usually "growing infinitely forever" - but the exact behavi...
It *is* ramping to infinity as you expected. The s-domain calculation is a steady-state calculation, and you have an initial transient (your input exponential was effectively a constant '1' for all t < 0). You have to wait for that to decay (i.e. become negligible) -- e.g. a long (infinite) time. You can see that afte...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
Here is my (very short) answer: All the calculations in the frequency domain (transfer function, input-and output impedances, pole location,..) do consider STEADY STATE conditions for the circuit under test. Therefore - due to the time dependence of your input - you cannot expect that the circuit will react upon such ...
It *is* ramping to infinity as you expected. The s-domain calculation is a steady-state calculation, and you have an initial transient (your input exponential was effectively a constant '1' for all t < 0). You have to wait for that to decay (i.e. become negligible) -- e.g. a long (infinite) time. You can see that afte...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
[KD9PDP's answer](https://electronics.stackexchange.com/a/551541/95619) alreay explains very nice (+1) why the result is as you see it, but there might be an easier way to do it. You already have the impulse response (1) and the input (2): $$\begin{align} h(t)&=\dfrac{1}{RC}\mathrm{e}^{-\frac{t}{RC}}\tag{1} \\ s(t)&=\...
It *is* ramping to infinity as you expected. The s-domain calculation is a steady-state calculation, and you have an initial transient (your input exponential was effectively a constant '1' for all t < 0). You have to wait for that to decay (i.e. become negligible) -- e.g. a long (infinite) time. You can see that afte...
551,535
Yeah, you probably are reading this question and thinking I'm one of those engineers who hasn't learned about the s-plane. I can assure you I'm not! I know that the transfer function of an RC circuit (Vout/Vin) has a REAL pole, with no imaginary component at s= -1/RC + j0. I am curious what happens when we excite an RC...
2021/03/06
[ "https://electronics.stackexchange.com/questions/551535", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/257550/" ]
If the system's impulse response is \$h(t)=e^{-at}u(t)\$, \$a>0\$, where \$u(t)\$ is the unit step function, and if its input is \$x(t)=e^{-at}u(t)\$, then its response is given by $$y(t)=te^{-at}u(t)\tag{1}$$ which is a basic result. The function \$(1)\$ is just the inverse Laplace transform of a double real-valued ...
It *is* ramping to infinity as you expected. The s-domain calculation is a steady-state calculation, and you have an initial transient (your input exponential was effectively a constant '1' for all t < 0). You have to wait for that to decay (i.e. become negligible) -- e.g. a long (infinite) time. You can see that afte...
7,327,164
I am developing a node.js app, and I want to use a module I am creating for the node.js server also on the client side. An example module would be circle.js: ``` var PI = Math.PI; exports.area = function (r) { return PI * r * r; }; exports.circumference = function (r) { return 2 * PI * r; }; ``` and you do a...
2011/09/06
[ "https://Stackoverflow.com/questions/7327164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101909/" ]
This seems to be how to make a module something you can use on the client side. <https://caolan.org/posts/writing_for_node_and_the_browser.html> mymodule.js: ``` (function(exports){ // your code goes here exports.test = function(){ return 'hello world' }; })(typeof exports === 'undefined'? this...
![Browserify](https://i.stack.imgur.com/5FtLy.png) [Browserify](https://github.com/substack/node-browserify) It magically lets you do that.
7,327,164
I am developing a node.js app, and I want to use a module I am creating for the node.js server also on the client side. An example module would be circle.js: ``` var PI = Math.PI; exports.area = function (r) { return PI * r * r; }; exports.circumference = function (r) { return 2 * PI * r; }; ``` and you do a...
2011/09/06
[ "https://Stackoverflow.com/questions/7327164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101909/" ]
![Browserify](https://i.stack.imgur.com/5FtLy.png) [Browserify](https://github.com/substack/node-browserify) It magically lets you do that.
[Webmake](https://github.com/medikoo/modules-webmake) was made to port CommonJS/NodeJS modules to browser. Give it a try
7,327,164
I am developing a node.js app, and I want to use a module I am creating for the node.js server also on the client side. An example module would be circle.js: ``` var PI = Math.PI; exports.area = function (r) { return PI * r * r; }; exports.circumference = function (r) { return 2 * PI * r; }; ``` and you do a...
2011/09/06
[ "https://Stackoverflow.com/questions/7327164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101909/" ]
This seems to be how to make a module something you can use on the client side. <https://caolan.org/posts/writing_for_node_and_the_browser.html> mymodule.js: ``` (function(exports){ // your code goes here exports.test = function(){ return 'hello world' }; })(typeof exports === 'undefined'? this...
[Webmake](https://github.com/medikoo/modules-webmake) was made to port CommonJS/NodeJS modules to browser. Give it a try
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values: ``` var rightPane = $("#right"); // Draw the right pane rightPane...
Not currently, other than templates as others have mentioned. What you could do, however, is to include the initial HTML code in your main document, and then set the values with `rightPane.val(task.data1);`, etc.
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values: ``` var rightPane = $("#right"); // Draw the right pane rightPane...
You can try to do something like this: [Format a string using placeholders and an object of substitutions?](https://stackoverflow.com/questions/7975005/format-a-string-using-placeholders-and-an-object-of-substitutions) but as Hacketo suggests it would be better to learn to use templates. Take for instance look at unde...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values: ``` var rightPane = $("#right"); // Draw the right pane rightPane...
One alternative way of approaching this would be : ``` var $h2 = $("<h2>", {text : task.task}); var $data1 = $("<input>", {type : 'text', value : task.data1}); var $data2 = $("<input>", {type : 'text', value : task.data2}); var $data3 = $("<input>", {type : 'text', value : task.data3}); var $button = $("<input...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values: ``` var rightPane = $("#right"); // Draw the right pane rightPane...
You could take a look at a JavaScript templating engine. Such as Handlebars, Mustache etc. You can see some of the popular ones [here](http://www.creativebloq.com/web-design/templating-engines-9134396): You can *kind* of view these as user controls similar to what you get in ASP.NET This is an example of Handlebars fo...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
In the current version of JavaScript, you can do this by escaping the newlines at the ends of lines, which is a *bit* better but note that leading whitespace will be included in the string, and you still have to use concatenation to swap in your values: ``` var rightPane = $("#right"); // Draw the right pane rightPane...
You could create your own super-simple 'template engine'. * Write your template in the markup of your page as you would a usual element. * Give the template container element an attribute to denote its role as a template, for example a data attribute of `data-template`. * Clone and detach all `data-template` elements...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
You could create your own super-simple 'template engine'. * Write your template in the markup of your page as you would a usual element. * Give the template container element an attribute to denote its role as a template, for example a data attribute of `data-template`. * Clone and detach all `data-template` elements...
Not currently, other than templates as others have mentioned. What you could do, however, is to include the initial HTML code in your main document, and then set the values with `rightPane.val(task.data1);`, etc.
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
You could create your own super-simple 'template engine'. * Write your template in the markup of your page as you would a usual element. * Give the template container element an attribute to denote its role as a template, for example a data attribute of `data-template`. * Clone and detach all `data-template` elements...
You can try to do something like this: [Format a string using placeholders and an object of substitutions?](https://stackoverflow.com/questions/7975005/format-a-string-using-placeholders-and-an-object-of-substitutions) but as Hacketo suggests it would be better to learn to use templates. Take for instance look at unde...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
You could create your own super-simple 'template engine'. * Write your template in the markup of your page as you would a usual element. * Give the template container element an attribute to denote its role as a template, for example a data attribute of `data-template`. * Clone and detach all `data-template` elements...
One alternative way of approaching this would be : ``` var $h2 = $("<h2>", {text : task.task}); var $data1 = $("<input>", {type : 'text', value : task.data1}); var $data2 = $("<input>", {type : 'text', value : task.data2}); var $data3 = $("<input>", {type : 'text', value : task.data3}); var $button = $("<input...
31,424,294
say I have the following code: ``` var rightPane = $("#right"); // Draw the right pane rightPane.html('<h2>' + task.task + '<h2> <hr />' + 'data1: <input type="text" id="data1" value="' + task.data1 + '" /> <br />' + 'data2: <input type="text" id="data2" value="' + ta...
2015/07/15
[ "https://Stackoverflow.com/questions/31424294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1798362/" ]
You could create your own super-simple 'template engine'. * Write your template in the markup of your page as you would a usual element. * Give the template container element an attribute to denote its role as a template, for example a data attribute of `data-template`. * Clone and detach all `data-template` elements...
You could take a look at a JavaScript templating engine. Such as Handlebars, Mustache etc. You can see some of the popular ones [here](http://www.creativebloq.com/web-design/templating-engines-9134396): You can *kind* of view these as user controls similar to what you get in ASP.NET This is an example of Handlebars fo...
27,975,841
I need to write in a pure JavaScript function which will execute only for 5 seconds and will stop if either one of the following conditions (whichever comes first) 1. 5 seconds has elapsed 2. user inputted a field I could only do condition 2 but can't figure out how to break the loop after 5 seconds: ``` function be...
2015/01/16
[ "https://Stackoverflow.com/questions/27975841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4459865/" ]
Javascript tends to be very callback oriented, since by default all the Javascript on a page runs in a single thread, which means that the UI isn't responsive while other code is busy running. So rather than looping in a function and looking for input on each loop, you likely want to register a callback function which ...
**Eddited** You could combine `setInterval` and `setTimeout` to solve . Your code will look like this. ``` var interval = setInterval(function() { var userInput= false; var element; while (!userInput){ element = document.getElementById("input").value; if (element != null){ user...
65,047,655
I am following [this thread](https://stackoverflow.com/questions/7707074/creating-dynamic-button-with-click-event-in-javascript) which shows how to generate DOM elements dynamically. Suppose I have this snippet that generate a series of buttons: ``` for(var i = 0; i < result.length;i++){ var menuCatButton = docu...
2020/11/28
[ "https://Stackoverflow.com/questions/65047655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10765455/" ]
You can add the class the element using `classList.add()`. **Demo:** ```js var result = [1,2]; var menuMgtCategoryButtons = document.getElementById('menuMgtCategoryButtons'); for(var i = 0; i < result.length;i++){ var menuCatButton = document.createElement("button"); menuCatButton.id = "menu-mgt-button-"+result[i...
Add this line ``` menuCatButton.className="new-button" ```
65,047,655
I am following [this thread](https://stackoverflow.com/questions/7707074/creating-dynamic-button-with-click-event-in-javascript) which shows how to generate DOM elements dynamically. Suppose I have this snippet that generate a series of buttons: ``` for(var i = 0; i < result.length;i++){ var menuCatButton = docu...
2020/11/28
[ "https://Stackoverflow.com/questions/65047655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10765455/" ]
You can add the class the element using `classList.add()`. **Demo:** ```js var result = [1,2]; var menuMgtCategoryButtons = document.getElementById('menuMgtCategoryButtons'); for(var i = 0; i < result.length;i++){ var menuCatButton = document.createElement("button"); menuCatButton.id = "menu-mgt-button-"+result[i...
Just add the class to each element in the loop just after you have created the element. ``` menuCatButton.classList.add("new-button"); ```
1,659,348
`For example:` Suppose we have an impulsive force $f(t)$ lasting from $t=t\_0$ until $t=t\_1$ which is applied to a mass $m$. Then by Newtons Second law we have $$\int\_{t=t\_0}^{t=t\_1}f(t)\,\mathrm{d}t=\int\_\color{red}{t=t\_0}^\color{red}{t=t\_1}m\color{blue}{\frac{\mathrm{d}v}{\mathrm{d}t}}\mathrm{d}t=\int\_\color...
2016/02/17
[ "https://math.stackexchange.com/questions/1659348", "https://math.stackexchange.com", "https://math.stackexchange.com/users/144533/" ]
The fundamental reason to change the limits of integration is that the *variable* of integration has changed. Substitution is an obvious case in which this is likely to occur. For example, substitute $u = x - 2$ in $\int (x - 2) dx$: $$ \int\_0^2 (x - 2) dx = \int\_{-2}^0 u\; du. $$ The intuition I follow on this is t...
Apart from your prefactors (like mass), when you integrate $dv/dt$ you integrate the derivative of a function, hence we all know the answer is the function itself. Hence: $$\int\_{t\_0}^{t\_1} v^{\prime}(t)\, dt = v(t\_1) - v(t\_0)$$
55,011,833
Other people who have asked this question had answers about downloading Vim from Vim.org, but that website doesn't respond. Are there other ways to use Vi on Windows?
2019/03/05
[ "https://Stackoverflow.com/questions/55011833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10496528/" ]
Use a mutation observer to watch the list item instead of watching the document as a whole. ```js // The item we want to watch var watch = document.querySelector('.active') // The new observer with a callback to execute upon change var observer = new MutationObserver((mutationsList) => { console.log(new Date()....
Most jQuery code has a similar counterpart available. The `$('li.active')` can be replaced with `document.querySelectorAll('li.active')`. This gives you all elements matching your selector. The `bind` call would be achieved by iterating over the elements and using `addEventListener('DOMSubtreeModified', function(event)...
3,933,744
When I closed MySql server, how can I understand that mysql server is gone away from my Qt program? **Edit:** Here my trial: When I close MySql, I get these results, and I can't catch that MySql is closed. My Code Snippet is ``` QSqlQuery query(db); query.exec("SELECT * From RequestIds"); qDebug()<<query.lastError...
2010/10/14
[ "https://Stackoverflow.com/questions/3933744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311762/" ]
There is a bug related with QSqlDatabase::isOpen() in Qt. <https://bugreports.qt.io/browse/QTBUG-223>
Your program has no idea of its surroundings. If something changes, you may be able to have the OS notify your program, or you'll have to test yourself. If the database connection closes before your program, the status from the connection should return some kind of error code. You **are checking status** from the con...
3,933,744
When I closed MySql server, how can I understand that mysql server is gone away from my Qt program? **Edit:** Here my trial: When I close MySql, I get these results, and I can't catch that MySql is closed. My Code Snippet is ``` QSqlQuery query(db); query.exec("SELECT * From RequestIds"); qDebug()<<query.lastError...
2010/10/14
[ "https://Stackoverflow.com/questions/3933744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311762/" ]
There is a bug related with QSqlDatabase::isOpen() in Qt. <https://bugreports.qt.io/browse/QTBUG-223>
`QSqlQuery::lastError()` should give you an error if your query via `QSqlQuery::exec()` has failed. Also `QSqlDatabase::isOpen()` should report the state of your connection, `QSqlDatabase::lastError()` is also available
3,933,744
When I closed MySql server, how can I understand that mysql server is gone away from my Qt program? **Edit:** Here my trial: When I close MySql, I get these results, and I can't catch that MySql is closed. My Code Snippet is ``` QSqlQuery query(db); query.exec("SELECT * From RequestIds"); qDebug()<<query.lastError...
2010/10/14
[ "https://Stackoverflow.com/questions/3933744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/311762/" ]
There is a bug related with QSqlDatabase::isOpen() in Qt. <https://bugreports.qt.io/browse/QTBUG-223>
You can use `isOpenError` to determine whether opening the initial database connection was successfull. I agree that `isOpen` returning `true` is confusing. To monitor the database connection I repeatedly try to open and close a lightweight MySQL connection (e.g. every 3 seconds): ``` #include <mysql/mysql.h> ...
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
Any selector-only solution requires you to make assumptions about your markup that may or may not be within your control since the specificity of two contextual selectors is always the same regardless of how close the ancestor is to each descendant that is matched, and any solution that makes use of inheriting the actu...
I tried this and it works, regardless of what element is it as long as you define the parent, hope this helps ``` body > :first-child { background-color: #ff0000; } ```
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
This porblem is a little bit difficult if you want to solve it with all elements. You have to think the other way: NOT "a rule is valid until there is another rule" BUT "the closest rule is valid". How to achieve this? First set a rule for all elements that are grandchildren except the form tag (perhaps also the ol,...
To target only the direct descendant of an element, you can use the direct descendant operator: `>`: ``` .red > input { background-color: red; } ``` And to go one step better, you can replace all repetitions like so, instead of having to manually declare each element: ``` .red > * { background-color: red; }...
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
Any selector-only solution requires you to make assumptions about your markup that may or may not be within your control since the specificity of two contextual selectors is always the same regardless of how close the ancestor is to each descendant that is matched, and any solution that makes use of inheriting the actu...
**Try This :** ``` .yellow > *:not(form):not(section), .yellow form * {background-color: yellow !important} .blue > *:not(form):not(section), .blue form * {background-color: blue !important} .red > *:not(form):not(section), .red form * {background-color: red !important} ``` ```css .yellow > *:not(form):not(section),...
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
**Try This :** ``` .yellow > *:not(form):not(section), .yellow form * {background-color: yellow !important} .blue > *:not(form):not(section), .blue form * {background-color: blue !important} .red > *:not(form):not(section), .red form * {background-color: red !important} ``` ```css .yellow > *:not(form):not(section),...
I tried this and it works, regardless of what element is it as long as you define the parent, hope this helps ``` body > :first-child { background-color: #ff0000; } ```
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
To target only the direct descendant of an element, you can use the direct descendant operator: `>`: ``` .red > input { background-color: red; } ``` And to go one step better, you can replace all repetitions like so, instead of having to manually declare each element: ``` .red > * { background-color: red; }...
I tried this and it works, regardless of what element is it as long as you define the parent, hope this helps ``` body > :first-child { background-color: #ff0000; } ```
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
This porblem is a little bit difficult if you want to solve it with all elements. You have to think the other way: NOT "a rule is valid until there is another rule" BUT "the closest rule is valid". How to achieve this? First set a rule for all elements that are grandchildren except the form tag (perhaps also the ol,...
Not sure if I understand your question, so just comment if I'm wrong. Increase the specificity of the style so that will not be overridden that easily. ``` .red > article > p { background-color: red; } ``` ```css .red input { background-color: red; } .red article { background-color: red; } .red > arti...
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
Any selector-only solution requires you to make assumptions about your markup that may or may not be within your control since the specificity of two contextual selectors is always the same regardless of how close the ancestor is to each descendant that is matched, and any solution that makes use of inheriting the actu...
Not sure if I understand your question, so just comment if I'm wrong. Increase the specificity of the style so that will not be overridden that easily. ``` .red > article > p { background-color: red; } ``` ```css .red input { background-color: red; } .red article { background-color: red; } .red > arti...
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
This porblem is a little bit difficult if you want to solve it with all elements. You have to think the other way: NOT "a rule is valid until there is another rule" BUT "the closest rule is valid". How to achieve this? First set a rule for all elements that are grandchildren except the form tag (perhaps also the ol,...
I tried this and it works, regardless of what element is it as long as you define the parent, hope this helps ``` body > :first-child { background-color: #ff0000; } ```
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
Not sure if I understand your question, so just comment if I'm wrong. Increase the specificity of the style so that will not be overridden that easily. ``` .red > article > p { background-color: red; } ``` ```css .red input { background-color: red; } .red article { background-color: red; } .red > arti...
I tried this and it works, regardless of what element is it as long as you define the parent, hope this helps ``` body > :first-child { background-color: #ff0000; } ```
45,852,012
So in this program, a user is able to create/specify a directory and create a file, given that the file doesn't exist already. when the user is entering a file name, they are required to enter a file extension as well. The problem I am having is how to make the code look for a file extension at the end of the string th...
2017/08/24
[ "https://Stackoverflow.com/questions/45852012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4902004/" ]
Any selector-only solution requires you to make assumptions about your markup that may or may not be within your control since the specificity of two contextual selectors is always the same regardless of how close the ancestor is to each descendant that is matched, and any solution that makes use of inheriting the actu...
To target only the direct descendant of an element, you can use the direct descendant operator: `>`: ``` .red > input { background-color: red; } ``` And to go one step better, you can replace all repetitions like so, instead of having to manually declare each element: ``` .red > * { background-color: red; }...
36,688,254
My question maybe unheard of or may even be impractical. But, I believe it is practical and acceptable. **Problem: PHP request and response in background thread.** Problem constraints: 1. You know it uses POST method. 2. It has two fields fname and lname as html ids that need to be filled. 3. You get response in the...
2016/04/18
[ "https://Stackoverflow.com/questions/36688254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2298251/" ]
use [this link](http://www.androidhive.info/2012/01/android-json-parsing-tutorial/) for best solution of calling web service without using WebView. In this example fname and lname sent in namevaluepairs we get responce in json formet and parse json and get data also json parse defined in examples.
What you are trying to achieve is to create a webservice call using a [AsyncTask](http://developer.android.com/reference/android/os/AsyncTask.html). Like you have mentioned, you can make a post request within the AsyncTask, passing in the variables required for the request. You can find a good example as shown: [Sen...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The song you quote with the bass line la,fa do,so and the chords Bm G D A can’t be identified as B minor or D major without listening to it. vi IV I V is one possible solution referring to major (beginning on the 6th degree) but this progression is ambivalent and it can be interpreted in Bm as i VI III bVII (b stands...
The answer to your question is **yes**. The notation you use is relative to tonic. Establishing which sound is the tonic (and whether it changes) is completely outside of this tool. Consider anything noted as II-V as carrying a standard disclaimer "assuming that X is the tonic". If you have a song with chords: C F C ...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The scale/chords are good clues to the key of a song, but at least as important is the *tonal center*. That's not as easy to define but generally it's where the song comes back to a place of less musical tension. IMHO the chord played when the song in question returns to a "rest" state is A major. Which means I would ...
The answer to your question is **yes**. The notation you use is relative to tonic. Establishing which sound is the tonic (and whether it changes) is completely outside of this tool. Consider anything noted as II-V as carrying a standard disclaimer "assuming that X is the tonic". If you have a song with chords: C F C ...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The answer lies in which chord is used to finish the piece (or section thereof.) If a piece ends with V-I (with I being D major and V being A major for example), one would say that that section (or piece) is in D major. To end a piece in the relative minor (same key signature but that's just for notational convenience ...
The answer to your question is **yes**. The notation you use is relative to tonic. Establishing which sound is the tonic (and whether it changes) is completely outside of this tool. Consider anything noted as II-V as carrying a standard disclaimer "assuming that X is the tonic". If you have a song with chords: C F C ...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The problem goes away if you consider D and Bm to be two sides of the same key. They have the same key signature. The Roman numeral analysis system - in the form you talk about - assumes that either the major or minor side is clearly more prominent, in order to assign number one to a scale degree. You should make a dec...
As others have pointed out, whether a song is in a major key or its relative minor is often a matter of debate or opinion. However, there are some clues that can point in one or other direction. First, in specifically the *harmonic* minor there is a key difference, the raised leading note: thus here you would expect a...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
As others have pointed out, whether a song is in a major key or its relative minor is often a matter of debate or opinion. However, there are some clues that can point in one or other direction. First, in specifically the *harmonic* minor there is a key difference, the raised leading note: thus here you would expect a...
The answer to your question is **yes**. The notation you use is relative to tonic. Establishing which sound is the tonic (and whether it changes) is completely outside of this tool. Consider anything noted as II-V as carrying a standard disclaimer "assuming that X is the tonic". If you have a song with chords: C F C ...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
A complete song need not be just in one key, and stay in that key throughout. I guess that's one good thing about relative key signatures - they are identical. There are many songs which may be in relative major for the verse, and move to relative minor for the chorus - or vice versa. There are many songs which move b...
The answer lies in which chord is used to finish the piece (or section thereof.) If a piece ends with V-I (with I being D major and V being A major for example), one would say that that section (or piece) is in D major. To end a piece in the relative minor (same key signature but that's just for notational convenience ...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The scale/chords are good clues to the key of a song, but at least as important is the *tonal center*. That's not as easy to define but generally it's where the song comes back to a place of less musical tension. IMHO the chord played when the song in question returns to a "rest" state is A major. Which means I would ...
As others have pointed out, whether a song is in a major key or its relative minor is often a matter of debate or opinion. However, there are some clues that can point in one or other direction. First, in specifically the *harmonic* minor there is a key difference, the raised leading note: thus here you would expect a...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The answer lies in which chord is used to finish the piece (or section thereof.) If a piece ends with V-I (with I being D major and V being A major for example), one would say that that section (or piece) is in D major. To end a piece in the relative minor (same key signature but that's just for notational convenience ...
As others have pointed out, whether a song is in a major key or its relative minor is often a matter of debate or opinion. However, there are some clues that can point in one or other direction. First, in specifically the *harmonic* minor there is a key difference, the raised leading note: thus here you would expect a...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
The scale/chords are good clues to the key of a song, but at least as important is the *tonal center*. That's not as easy to define but generally it's where the song comes back to a place of less musical tension. IMHO the chord played when the song in question returns to a "rest" state is A major. Which means I would ...
The problem goes away if you consider D and Bm to be two sides of the same key. They have the same key signature. The Roman numeral analysis system - in the form you talk about - assumes that either the major or minor side is clearly more prominent, in order to assign number one to a scale degree. You should make a dec...
105,305
quick question that's been bugging me lately. When it comes to a songs key specifically major and minor relatives- is it correct to say it can be written in two different keys with the same progression with the progression being written differently? I say this because a lot of times pop songs I see people post the prog...
2020/09/30
[ "https://music.stackexchange.com/questions/105305", "https://music.stackexchange.com", "https://music.stackexchange.com/users/72239/" ]
A complete song need not be just in one key, and stay in that key throughout. I guess that's one good thing about relative key signatures - they are identical. There are many songs which may be in relative major for the verse, and move to relative minor for the chorus - or vice versa. There are many songs which move b...
The problem goes away if you consider D and Bm to be two sides of the same key. They have the same key signature. The Roman numeral analysis system - in the form you talk about - assumes that either the major or minor side is clearly more prominent, in order to assign number one to a scale degree. You should make a dec...
239,209
On OS from win 2000 or later (any language) can I assume that this path will always exists? For example I know that on win xp in some languages the "Program Files" directory have a different name. So is it true for the System32 folder? Thanks. Ohad.
2008/10/27
[ "https://Stackoverflow.com/questions/239209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17212/" ]
Windows can be installed on a different harddrive and or in a different folder. Use the %windir% or %systemroot% environment variables to get you to the windows folder and append system32. Or use the %path% variable, it's usually the first entrance and the preferred method of searching for files such as dlls AFAIK. As ...
Just an FYI, but in a Terminal Server environment (ie, Citrix), GetWindowsDirectory() may return a unique path for a remote user. [link text](http://msdn.microsoft.com/en-us/library/ms724454(VS.85).aspx) As more and more companies use virtualized desktops, developers need to keep this in mind.
239,209
On OS from win 2000 or later (any language) can I assume that this path will always exists? For example I know that on win xp in some languages the "Program Files" directory have a different name. So is it true for the System32 folder? Thanks. Ohad.
2008/10/27
[ "https://Stackoverflow.com/questions/239209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17212/" ]
You definitely cannot assume that: Windows could be installed on a different drive letter, or in a different directory. On a previous work PC Windows was installed in D:\WINNT, for example. The short answer is to use the API call GetSystemDirectory(), which will return the path you are after. The longer answer is to ...
Windows can be installed on a different harddrive and or in a different folder. Use the %windir% or %systemroot% environment variables to get you to the windows folder and append system32. Or use the %path% variable, it's usually the first entrance and the preferred method of searching for files such as dlls AFAIK. As ...
239,209
On OS from win 2000 or later (any language) can I assume that this path will always exists? For example I know that on win xp in some languages the "Program Files" directory have a different name. So is it true for the System32 folder? Thanks. Ohad.
2008/10/27
[ "https://Stackoverflow.com/questions/239209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17212/" ]
Windows can be installed on a different harddrive and or in a different folder. Use the %windir% or %systemroot% environment variables to get you to the windows folder and append system32. Or use the %path% variable, it's usually the first entrance and the preferred method of searching for files such as dlls AFAIK. As ...
I would use the **GetWindowsDirectory** Win32 API to get the current Windows directory, append **System32** to it an then check if it exists.