qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
2,191,749
I need to focus out from the textbox when it focus in. I try to set focus for outer div and its working fine in IE but not in mozilla. How do I do this? This is my current code: ``` <div id="outer"> <input type = "textbox" /></div> Onfocus: document.getElementById("outer").focus() ```
2010/02/03
[ "https://Stackoverflow.com/questions/2191749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171365/" ]
I have tried all the answers and not worked in all the browsers. And I combined all together in to it. 1. `TextBox.readonly = true;` **OnFocus:** 2. `var curText = TextBox.value;` `TextBox.value = "";` `TextBox.value = curText;` 3. `TextBox.blur();` 4. `TextBox_Parent.focus()` And its working fine in all the browse...
Where is the point in that? JS would be (didn't test it): ``` $('#textbox').focusin(function() { $(this).focusout(); }); ```
2,191,749
I need to focus out from the textbox when it focus in. I try to set focus for outer div and its working fine in IE but not in mozilla. How do I do this? This is my current code: ``` <div id="outer"> <input type = "textbox" /></div> Onfocus: document.getElementById("outer").focus() ```
2010/02/03
[ "https://Stackoverflow.com/questions/2191749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171365/" ]
Where is the point in that? JS would be (didn't test it): ``` $('#textbox').focusin(function() { $(this).focusout(); }); ```
``` /*for textarea*/ $(document).ready(function() { $('textarea[type="text"]').addClass("idleField"); $('textarea[type="text"]').focus(function() { $(this).removeClass("idleField").addClass("focusField"); if (this.value == this.defaultValue){ this.value = ''; } if(this.value != this.defaultValue...
2,191,749
I need to focus out from the textbox when it focus in. I try to set focus for outer div and its working fine in IE but not in mozilla. How do I do this? This is my current code: ``` <div id="outer"> <input type = "textbox" /></div> Onfocus: document.getElementById("outer").focus() ```
2010/02/03
[ "https://Stackoverflow.com/questions/2191749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171365/" ]
In HTML: ``` <input type="text" onfocus="this.blur();" /> ``` In JS: ``` document.getElementById("input1").onfocus = function () { this.blur(); } ``` Some elements cannot accept focus without being editable.
``` /*for textarea*/ $(document).ready(function() { $('textarea[type="text"]').addClass("idleField"); $('textarea[type="text"]').focus(function() { $(this).removeClass("idleField").addClass("focusField"); if (this.value == this.defaultValue){ this.value = ''; } if(this.value != this.defaultValue...
2,191,749
I need to focus out from the textbox when it focus in. I try to set focus for outer div and its working fine in IE but not in mozilla. How do I do this? This is my current code: ``` <div id="outer"> <input type = "textbox" /></div> Onfocus: document.getElementById("outer").focus() ```
2010/02/03
[ "https://Stackoverflow.com/questions/2191749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/171365/" ]
I have tried all the answers and not worked in all the browsers. And I combined all together in to it. 1. `TextBox.readonly = true;` **OnFocus:** 2. `var curText = TextBox.value;` `TextBox.value = "";` `TextBox.value = curText;` 3. `TextBox.blur();` 4. `TextBox_Parent.focus()` And its working fine in all the browse...
``` /*for textarea*/ $(document).ready(function() { $('textarea[type="text"]').addClass("idleField"); $('textarea[type="text"]').focus(function() { $(this).removeClass("idleField").addClass("focusField"); if (this.value == this.defaultValue){ this.value = ''; } if(this.value != this.defaultValue...
34,784,064
I have 2 buttons, Correct & Wrong. When a random question (vragen) pops up on the screen, its index number [1] needs to be the same as the answer (antw) index number [1]. If pressed on the G button and its good it has to say yay, bad noo and when clicked on the F the same but then the other way! ``` window.onload = f...
2016/01/14
[ "https://Stackoverflow.com/questions/34784064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5784525/" ]
No you do not need to persist the actual dog object, if you already persist an object containing it.
For the users who are wondering about cascading delete, the answer is `NO`. Realm supports cascading write but `NOT` delete. For delete you may have to query all the relations and delete one by one.
54,040,265
I was trying to work on a rainbow-pen drawing canvas, but whenever I draw, the lines appear dotted. Only when I move really slowly, does it appear properly. The 'mousemove' event listener, isn't really being able to detect fast changes or is there some other issue in my code? Also, here is the codepen link, if anyone ...
2019/01/04
[ "https://Stackoverflow.com/questions/54040265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4611854/" ]
I don't think that it's as much the fact you're storing a `Stream` per se that makes this feel awkward, but rather that you've got [sequential coupling](https://en.wikipedia.org/wiki/Sequential_coupling). You *have to* call `hasMoreData`; then `getCurrentStream()`; then `finish()`. If you're only using the class in a ...
Mixing imperative *(while loop, try-finally)* and declarative *(streams)* code together doesn't seem right. If all of these opeartions are synchronous I guess it could be done in one pipeline (without MyStreamManager at all). I think that you could think of focusing on moving some logic to object containing method `so...
36,731,277
I'm creating my first react-native project with this tutorial: <http://facebook.github.io/react-native/> When it comes to executing code and running `react-native run-android` I am getting: ``` adb server is out of date. killing... * daemon started successfully * ``` And the app on the android device is obviously ...
2016/04/19
[ "https://Stackoverflow.com/questions/36731277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4747748/" ]
Open Android Studio, and then update all your build tools, install the SDKs that you need for your device and ensure that have you set `ANDROID_HOME` env var to the same dir that you have in Android Studio (commonly in `/home/you/Android/Sdk`), also update react-native-cli node package. Run adb `kill-server` and adb `s...
In the latest `adb` update the *adb server is out of date. killing...* message has been replaced with more informative *adb server version (%d) doesn't match this client (%d)* So this solution is applicable to both. The root cause of the error is that your system has multiple `adb` binaries of different versions) ins...
36,731,277
I'm creating my first react-native project with this tutorial: <http://facebook.github.io/react-native/> When it comes to executing code and running `react-native run-android` I am getting: ``` adb server is out of date. killing... * daemon started successfully * ``` And the app on the android device is obviously ...
2016/04/19
[ "https://Stackoverflow.com/questions/36731277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4747748/" ]
Open Android Studio, and then update all your build tools, install the SDKs that you need for your device and ensure that have you set `ANDROID_HOME` env var to the same dir that you have in Android Studio (commonly in `/home/you/Android/Sdk`), also update react-native-cli node package. Run adb `kill-server` and adb `s...
I'm getting this error using ADB (1.0.32) and Genymotion (2.8.2). My solution was change the ADB of the VM, from my local Android SDK's ADB to Genymotion ADB (default).
36,731,277
I'm creating my first react-native project with this tutorial: <http://facebook.github.io/react-native/> When it comes to executing code and running `react-native run-android` I am getting: ``` adb server is out of date. killing... * daemon started successfully * ``` And the app on the android device is obviously ...
2016/04/19
[ "https://Stackoverflow.com/questions/36731277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4747748/" ]
Open Android Studio, and then update all your build tools, install the SDKs that you need for your device and ensure that have you set `ANDROID_HOME` env var to the same dir that you have in Android Studio (commonly in `/home/you/Android/Sdk`), also update react-native-cli node package. Run adb `kill-server` and adb `s...
It might be that you installed the `adb` package in addition to the SDK's. In that case, a ``` sudo apt purge adb ``` might solve the problem.
36,731,277
I'm creating my first react-native project with this tutorial: <http://facebook.github.io/react-native/> When it comes to executing code and running `react-native run-android` I am getting: ``` adb server is out of date. killing... * daemon started successfully * ``` And the app on the android device is obviously ...
2016/04/19
[ "https://Stackoverflow.com/questions/36731277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4747748/" ]
In the latest `adb` update the *adb server is out of date. killing...* message has been replaced with more informative *adb server version (%d) doesn't match this client (%d)* So this solution is applicable to both. The root cause of the error is that your system has multiple `adb` binaries of different versions) ins...
I'm getting this error using ADB (1.0.32) and Genymotion (2.8.2). My solution was change the ADB of the VM, from my local Android SDK's ADB to Genymotion ADB (default).
36,731,277
I'm creating my first react-native project with this tutorial: <http://facebook.github.io/react-native/> When it comes to executing code and running `react-native run-android` I am getting: ``` adb server is out of date. killing... * daemon started successfully * ``` And the app on the android device is obviously ...
2016/04/19
[ "https://Stackoverflow.com/questions/36731277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4747748/" ]
It might be that you installed the `adb` package in addition to the SDK's. In that case, a ``` sudo apt purge adb ``` might solve the problem.
I'm getting this error using ADB (1.0.32) and Genymotion (2.8.2). My solution was change the ADB of the VM, from my local Android SDK's ADB to Genymotion ADB (default).
704,815
Basically I have this which I know won't work but I it illustrates what I'm trying to do: MessageBox.Show("Found these: " + keywords[i] + " keywords."); And I need to see this: Found these: Item1, Item2 keywords. There may be 1 keyword there may be 4, how should I do this? Many thanks.
2009/04/01
[ "https://Stackoverflow.com/questions/704815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You could use [string.Join](http://msdn.microsoft.com/en-us/library/57a79xd0.aspx): ``` MessageBox.Show("Found these: " + string.Join(", ", keywords) + " keywords."); ```
Jon Skeet has a good answer with string.Join. your other option for more complicated formatting would be to use a string builder ``` StringBuilder sb = new StringBuilder(); seperator = ""; foreach(string current in keywords){ sb.Append(seperator); sb.Append(current); seperator = ", "; } MessageBox.Show("Found thes...
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
Definitely, Crimea ([Chersonesos](https://en.wikipedia.org/wiki/Chersonesus)) or some place in its surrounding. Crimea's south coast was part of Roman Empire in 47 BC - 330 AD, and also a part of the Byzantine Empire later. Greek colonists settled the area much before Rome. --- Update. I have found some more relevant...
This Map of [Greek Colonies in the Adriatic](http://starogradsko-polje.net/UserFiles/Image/Grcka_kolonizacija/grcka_kolonizacija_jadrana.jpg) shows that the most northerly posts were Pharos and Issos halfway up the coast. These were secondary settlements from Syracuse and Ionian cities, though. If you eliminate those y...
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
This Map of [Greek Colonies in the Adriatic](http://starogradsko-polje.net/UserFiles/Image/Grcka_kolonizacija/grcka_kolonizacija_jadrana.jpg) shows that the most northerly posts were Pharos and Issos halfway up the coast. These were secondary settlements from Syracuse and Ionian cities, though. If you eliminate those y...
The town of [Novigrad](https://en.wikipedia.org/wiki/Novigrad,_Istria_County) may be the most northern town of Greek origin. Reputedly it was originally founded by the Greeks as Neapolis (new city).
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
This Map of [Greek Colonies in the Adriatic](http://starogradsko-polje.net/UserFiles/Image/Grcka_kolonizacija/grcka_kolonizacija_jadrana.jpg) shows that the most northerly posts were Pharos and Issos halfway up the coast. These were secondary settlements from Syracuse and Ionian cities, though. If you eliminate those y...
The Romanian Black Sea coastal site of Istria, was probably the most Northern most Greek speaking territory within the Roman Empire. The Greeks settled throughout many parts of the Black Sea region and even during Roman times, Greek was widely spoken in the greater Balkan and Black Sea regions as the primary language. ...
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
Definitely, Crimea ([Chersonesos](https://en.wikipedia.org/wiki/Chersonesus)) or some place in its surrounding. Crimea's south coast was part of Roman Empire in 47 BC - 330 AD, and also a part of the Byzantine Empire later. Greek colonists settled the area much before Rome. --- Update. I have found some more relevant...
The town of [Novigrad](https://en.wikipedia.org/wiki/Novigrad,_Istria_County) may be the most northern town of Greek origin. Reputedly it was originally founded by the Greeks as Neapolis (new city).
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
Definitely, Crimea ([Chersonesos](https://en.wikipedia.org/wiki/Chersonesus)) or some place in its surrounding. Crimea's south coast was part of Roman Empire in 47 BC - 330 AD, and also a part of the Byzantine Empire later. Greek colonists settled the area much before Rome. --- Update. I have found some more relevant...
The Romanian Black Sea coastal site of Istria, was probably the most Northern most Greek speaking territory within the Roman Empire. The Greeks settled throughout many parts of the Black Sea region and even during Roman times, Greek was widely spoken in the greater Balkan and Black Sea regions as the primary language. ...
23,554
My understanding is that prior to the migrations/invasions of the Goths, Huns and Sklavenoi into the Balkan peninsula, Greek and Latin where the most common native languages, alongside other steadily declining languages such as Thracian and Illyrian. Also, I'm aware of the "Jireček Line" which is the theoretical line t...
2015/07/20
[ "https://history.stackexchange.com/questions/23554", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12979/" ]
The town of [Novigrad](https://en.wikipedia.org/wiki/Novigrad,_Istria_County) may be the most northern town of Greek origin. Reputedly it was originally founded by the Greeks as Neapolis (new city).
The Romanian Black Sea coastal site of Istria, was probably the most Northern most Greek speaking territory within the Roman Empire. The Greeks settled throughout many parts of the Black Sea region and even during Roman times, Greek was widely spoken in the greater Balkan and Black Sea regions as the primary language. ...
21,986
My guess is around 4 or 5, but I don't know if it's right because she looked a bit older. So how old was Korra when she was discovered she was the Avatar?
2012/08/13
[ "https://scifi.stackexchange.com/questions/21986", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/8268/" ]
Korra is confirmed to have been aged four when she demonstrated her multi-element bending skills to the judges in the first episode, according to the [*Legend of Korra: Book 1 – Air, The Art of the Animated Series*](https://www.parkablogs.com/content/book-review-legend-of-korra-book-1-%E2%80%93-air-art-of-animated-seri...
[![Youthful Korra, earthbending and using her strength](https://i.stack.imgur.com/CSxtp.jpg)](https://i.stack.imgur.com/CSxtp.jpg) *Youthful Korra, earthbending and using her strength* > > Korra: "I'm the Avatar. You gotta deal with it!" > > > Given her apparent age, her sentence syntax and structure, I would pu...
43,476,826
I am running an ols model and I need to know all the coefficients so I can use them in my analysis. How can I display/save the coefficients in a different format than scientific notation? ``` model = sm.ols(formula="sales ~ product_category + quantity_bought + quantity_ordered + quantity_returned + season", data=final...
2017/04/18
[ "https://Stackoverflow.com/questions/43476826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5187157/" ]
So that is something that is hardcoded into the statsmodels source. But the best way to get the coefficients out would be with `model.params`. Take a look at the source for [`RegressionResults`](http://statsmodels.sourceforge.net/devel/_modules/statsmodels/regression/linear_model.html#RegressionResults), specifically a...
You cannot make it by now with the statsmodels `version 0.8.0`, because `RegressionResultsWrapper.summary()` method haven't got a good support for this feature. Only `xname, yname, alpha, title` are available. So, there is a experiental function called `RegressionResultsWrapper.summary()` which has a parameter `float_...
43,476,826
I am running an ols model and I need to know all the coefficients so I can use them in my analysis. How can I display/save the coefficients in a different format than scientific notation? ``` model = sm.ols(formula="sales ~ product_category + quantity_bought + quantity_ordered + quantity_returned + season", data=final...
2017/04/18
[ "https://Stackoverflow.com/questions/43476826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5187157/" ]
So that is something that is hardcoded into the statsmodels source. But the best way to get the coefficients out would be with `model.params`. Take a look at the source for [`RegressionResults`](http://statsmodels.sourceforge.net/devel/_modules/statsmodels/regression/linear_model.html#RegressionResults), specifically a...
As of version 0.10.2, there is an experimental function `summary2()` which takes a `float_format`. Here is the docstring of that function from the [source code](https://github.com/statsmodels/statsmodels/blob/988699f797d8f02a6caa2cc31317c7e7d49d2c92/statsmodels/regression/linear_model.py#L2553): ``` def summary2...
69,629,849
I want to get data back from an API but when I want to put the data in an object (model) and log it in the console it gives back undefined. The same thing when I use it in my HTML with databinding, there its then also undefined. But when I log it to the console on complete in the `subscribe` function it does log in th...
2021/10/19
[ "https://Stackoverflow.com/questions/69629849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12491626/" ]
So slices are sometimes referred to as *reference types*. You can read more about the differences between arrays and slices [here](https://golangdocs.com/slices-in-golang), for example (first page I found). What a slice basically is, as you can see from the source in the `runtime` package ([slice.go file](https://cs.o...
When you assign one slice to a another you get a shallow copy. They will both refer to the same underlying array of data. If you want to modify one and keep the original, you would need to copy the content of the slice, then modify it. ``` package main import ( "fmt" "sort" ) func copySlice(slice []string) ...
71,456
Why do we say: > > Ihre Mutter Julia ist *brasilianischer* Herkunft. > > > I think we should say instead: > > Ihre Mutter Julia ist *brasilianische* Herkunft. > > > Is that right? We say *die Herkunft* not *der Herkunft*. So, why was the ending *-er* instead of just *-e* used here?
2022/08/21
[ "https://german.stackexchange.com/questions/71456", "https://german.stackexchange.com", "https://german.stackexchange.com/users/53858/" ]
The grammar is slightly subtle here. Normally a genitive noun attaches itself to another noun; it usually doesn't use a copulative verb like *sein*. But *Herkunft* and similar words, for example *Ursprung*, seem to be exceptions. So while *sein* almost always uses the nominative case, you have to be careful to take mea...
The [copula](https://en.wikipedia.org/wiki/Copula_(linguistics)) *sein* usually combines with a nominative, either expressing an identity or a subsumption: > > Markus Söder ist d**er** *(nom. sg. masc.)* bayerische Ministerpräsident. *(identity)* > > > Joseph ist ein echt**er** Bayer. *(subsumption: Joseph belong t...
71,456
Why do we say: > > Ihre Mutter Julia ist *brasilianischer* Herkunft. > > > I think we should say instead: > > Ihre Mutter Julia ist *brasilianische* Herkunft. > > > Is that right? We say *die Herkunft* not *der Herkunft*. So, why was the ending *-er* instead of just *-e* used here?
2022/08/21
[ "https://german.stackexchange.com/questions/71456", "https://german.stackexchange.com", "https://german.stackexchange.com/users/53858/" ]
The grammar is slightly subtle here. Normally a genitive noun attaches itself to another noun; it usually doesn't use a copulative verb like *sein*. But *Herkunft* and similar words, for example *Ursprung*, seem to be exceptions. So while *sein* almost always uses the nominative case, you have to be careful to take mea...
A little declension changes everything. **Ihre Mutter Julia ist brasilianische Herkunft.** This means: Her mother Julia is Brazilian origin. (A female person (Julia) IS an abstract thing (origin)). That obviously doesn't make any sense. You used 2 times the nominative declensions, that means you describe what the subj...
71,456
Why do we say: > > Ihre Mutter Julia ist *brasilianischer* Herkunft. > > > I think we should say instead: > > Ihre Mutter Julia ist *brasilianische* Herkunft. > > > Is that right? We say *die Herkunft* not *der Herkunft*. So, why was the ending *-er* instead of just *-e* used here?
2022/08/21
[ "https://german.stackexchange.com/questions/71456", "https://german.stackexchange.com", "https://german.stackexchange.com/users/53858/" ]
The [copula](https://en.wikipedia.org/wiki/Copula_(linguistics)) *sein* usually combines with a nominative, either expressing an identity or a subsumption: > > Markus Söder ist d**er** *(nom. sg. masc.)* bayerische Ministerpräsident. *(identity)* > > > Joseph ist ein echt**er** Bayer. *(subsumption: Joseph belong t...
A little declension changes everything. **Ihre Mutter Julia ist brasilianische Herkunft.** This means: Her mother Julia is Brazilian origin. (A female person (Julia) IS an abstract thing (origin)). That obviously doesn't make any sense. You used 2 times the nominative declensions, that means you describe what the subj...
3,678,180
> > **Possible Duplicate:** > > [How to tell if UIViewController's view is visible](https://stackoverflow.com/questions/2777438/how-to-tell-if-uiviewcontrollers-view-is-visible) > > > I'm developing an app that processes a constant stream of incoming data from the network and provides a number of different UIV...
2010/09/09
[ "https://Stackoverflow.com/questions/3678180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352344/" ]
After doing some research, I found this answer in a different question posted on here...This seems to be the best way... The view's window property is non-nil if a view is currently visible, so check the main view in the view controller: ``` if (viewController.isViewLoaded && viewController.view.window){ // viewC...
Add this to your controllers, or to a subclass of UIViewController that you can then subclass further. Access it using a property or the variable: ``` - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; visible = YES; } - (void)viewWillDisappear:(BOOL)animated { visible = NO; [super viewWillDis...
3,678,180
> > **Possible Duplicate:** > > [How to tell if UIViewController's view is visible](https://stackoverflow.com/questions/2777438/how-to-tell-if-uiviewcontrollers-view-is-visible) > > > I'm developing an app that processes a constant stream of incoming data from the network and provides a number of different UIV...
2010/09/09
[ "https://Stackoverflow.com/questions/3678180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352344/" ]
Add this to your controllers, or to a subclass of UIViewController that you can then subclass further. Access it using a property or the variable: ``` - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; visible = YES; } - (void)viewWillDisappear:(BOOL)animated { visible = NO; [super viewWillDis...
Just for completeness, I thought I'd add in how to determine if the view controller is being displayed in a tab based app: ``` +(BOOL) isSelectedViewController:(UIViewController *)someVC; { myAppDelegate *appD = [[UIApplication sharedApplication] delegate]; UIViewController *selectedVC = [appD.TabBarControll...
3,678,180
> > **Possible Duplicate:** > > [How to tell if UIViewController's view is visible](https://stackoverflow.com/questions/2777438/how-to-tell-if-uiviewcontrollers-view-is-visible) > > > I'm developing an app that processes a constant stream of incoming data from the network and provides a number of different UIV...
2010/09/09
[ "https://Stackoverflow.com/questions/3678180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/352344/" ]
After doing some research, I found this answer in a different question posted on here...This seems to be the best way... The view's window property is non-nil if a view is currently visible, so check the main view in the view controller: ``` if (viewController.isViewLoaded && viewController.view.window){ // viewC...
Just for completeness, I thought I'd add in how to determine if the view controller is being displayed in a tab based app: ``` +(BOOL) isSelectedViewController:(UIViewController *)someVC; { myAppDelegate *appD = [[UIApplication sharedApplication] delegate]; UIViewController *selectedVC = [appD.TabBarControll...
16,420,618
I have made a simple form with textfields, when i submit a button it wrties all textfield values into a .txt file. Here is an example of the .txt file content: ``` ----------------------------- How much is 1+1 3 4 5 1 ----------------------------- ``` The 1st and last line `----` is there to just seperate data. The ...
2013/05/07
[ "https://Stackoverflow.com/questions/16420618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2178681/" ]
You may try this: ``` $file = fopen("test.txt","r"); $response = array(); while(! feof($file)) { $response[] = fgets($file); } fclose($file); ``` This way you will get response array like: ``` Array( [0]=>'--------------', [1]=>'How much is 1+1', [2]=>'3', [3]=>'4', [4]=>'2', [5]=>'1', ...
You could try something like this: ``` $lines = file_get_contents('quiz.txt'); $newline = "\n"; //May need to be "\r\n". $delimiter = "-----------------------------". $newline; $question_blocks = explode($delimiter, $lines); $questions = array(); foreach ($question_blocks as $qb) { $items = explode ($newline, $qb...
48,342,589
Is there a way to default "hide" an element in Nativescript? I have in my component ``` export class HouseholdContactComponent{ private isLoading = true } ``` and in my xml ``` <StackLayout [visibility]="isLoading ? 'collapse' : 'visible'"> <Label text="Hi there"></Label> </StackLayout> ``` With this code, t...
2018/01/19
[ "https://Stackoverflow.com/questions/48342589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1394981/" ]
Rather than using the [visibility] property, you should use the Angular `*ngIf` directive. ```html <StackLayout *ngIf="!isLoading"> <Label text="Hi there"></Label> </StackLayout> ``` On a side note, in order to bind to a attribute property and bind it to interpolation Angular is doing you need to prefix it with ...
Use the [\*ngIf directive](https://docs.nativescript.org/angular/ui/ng-ui-widgets/ng-directives#ngif-directive). It will render if the variable value is `true`. Ex: ``` //HTML <Button text="Show/hide block" (tap)="onTap()" class="btn btn-primary btn-active"></Button> <GridLayout *ngIf="isVisible" class="bg-primary" b...
356,423
For a vector field, is path independence of line integral a necessary and sufficient condition for the field to be [conservative](https://en.wikipedia.org/wiki/Conservative_vector_field) or is it just a necessary condition? Please provide proof if possible.
2017/09/10
[ "https://physics.stackexchange.com/questions/356423", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/87439/" ]
A conservative field is one in which the line integral does not depend on the path, but depends only on the initial and final position. Hence the line integral in a closed path is zero. Mathematically, the line integral of a vector field $F$ from the point $a$ to $b$ is given by $\int \_{ a }^{ b }{ \overrightarrow {...
Yes.the path independence of tangential line integral of a vector field is the necessary and sufficient condition for a vector field to be conservative. We may prove it in following way. [![1st page](https://i.stack.imgur.com/qf4Pn.jpg)](https://i.stack.imgur.com/qf4Pn.jpg) [![2nd page](https://i.stack.imgur.com/Rodom...
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
We can use `str_detect` from `stringr` : ``` colSums(sapply(list_of_patterns, stringr::str_detect, string = tolower(df$sentences))) # apple banana # 4 3 ```
You can use `grepl` with `sum` in `sapply`. ``` sapply(list_of_patterns, function(x) sum(grepl(x, tolower(df$sentences)))) # apple banana # 4 3 ``` Or store the result of `tolower` ``` y <- tolower(df$sentences) sapply(list_of_patterns, function(x) sum(grepl(x, y))) ``` Or using `colSums` like already ...
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
Here is a base R solution. ``` sapply(list_of_patterns, function(x) length(grep(x, df$sentences, ignore.case = TRUE))) # apple banana # 4 3 ``` Tests ===== With large data sets my solution seems to be the fastest of the solutions posted ([1](https://stackoverflow.com/a/62260148/8245406), [2](https://stac...
We can use `str_detect` from `stringr` : ``` colSums(sapply(list_of_patterns, stringr::str_detect, string = tolower(df$sentences))) # apple banana # 4 3 ```
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
We can use `str_detect` from `stringr` : ``` colSums(sapply(list_of_patterns, stringr::str_detect, string = tolower(df$sentences))) # apple banana # 4 3 ```
additional options ``` df <- df %>% mutate(sentences = tolower(sentences)) list_of_patterns <- tolower(c("Apple", "Banana")) %>% purrr::set_names() map_dbl(list_of_patterns, ~ sum(str_detect(df$sentences, .x))) ```
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
Here is a base R solution. ``` sapply(list_of_patterns, function(x) length(grep(x, df$sentences, ignore.case = TRUE))) # apple banana # 4 3 ``` Tests ===== With large data sets my solution seems to be the fastest of the solutions posted ([1](https://stackoverflow.com/a/62260148/8245406), [2](https://stac...
You can use `grepl` with `sum` in `sapply`. ``` sapply(list_of_patterns, function(x) sum(grepl(x, tolower(df$sentences)))) # apple banana # 4 3 ``` Or store the result of `tolower` ``` y <- tolower(df$sentences) sapply(list_of_patterns, function(x) sum(grepl(x, y))) ``` Or using `colSums` like already ...
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
You can use `grepl` with `sum` in `sapply`. ``` sapply(list_of_patterns, function(x) sum(grepl(x, tolower(df$sentences)))) # apple banana # 4 3 ``` Or store the result of `tolower` ``` y <- tolower(df$sentences) sapply(list_of_patterns, function(x) sum(grepl(x, y))) ``` Or using `colSums` like already ...
additional options ``` df <- df %>% mutate(sentences = tolower(sentences)) list_of_patterns <- tolower(c("Apple", "Banana")) %>% purrr::set_names() map_dbl(list_of_patterns, ~ sum(str_detect(df$sentences, .x))) ```
62,260,054
I Have a data frame : ``` df <- data.frame(sentences = c("An apple hangs on an apple tree", "Bananas are yellow and tasty", " Bananas and apples", "The apple is tasty","Apples are healthy. Apples are juicy.", ...
2020/06/08
[ "https://Stackoverflow.com/questions/62260054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4887832/" ]
Here is a base R solution. ``` sapply(list_of_patterns, function(x) length(grep(x, df$sentences, ignore.case = TRUE))) # apple banana # 4 3 ``` Tests ===== With large data sets my solution seems to be the fastest of the solutions posted ([1](https://stackoverflow.com/a/62260148/8245406), [2](https://stac...
additional options ``` df <- df %>% mutate(sentences = tolower(sentences)) list_of_patterns <- tolower(c("Apple", "Banana")) %>% purrr::set_names() map_dbl(list_of_patterns, ~ sum(str_detect(df$sentences, .x))) ```
71,919,416
I am new to React and I am trying to display Header and Footer in other pages, except home page. I have an intro/loading page used "/" and home page used "/home". Can anyone help me? ```html import { BrowserRouter, Routes, Route } from 'react-router-dom'; import Header from '../components/Header'; import Footer from '...
2022/04/19
[ "https://Stackoverflow.com/questions/71919416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18857183/" ]
Instead of writing only `<Footer/>` and `<Header/>` Make This change: ``` <header><Header /></header> <footer><Footer/></footer> ```
try to use `exact` attribute for `<Route>` components like this: ``` <Routes> <Route exact path="/" element={<PageIntro />} /> <Route exact path="/home" element={<PageHome />} /> <Route exact path="/about" element={<PageAbout />} /> <Route exact path="/work" e...
71,919,416
I am new to React and I am trying to display Header and Footer in other pages, except home page. I have an intro/loading page used "/" and home page used "/home". Can anyone help me? ```html import { BrowserRouter, Routes, Route } from 'react-router-dom'; import Header from '../components/Header'; import Footer from '...
2022/04/19
[ "https://Stackoverflow.com/questions/71919416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18857183/" ]
You can split your router configuration code into two components one has routes with a header and the other has no routes with a header. For example, > > App.js > > > ``` <Router> <Routes> <Route path="/*" element={<Layout />} /> <Route path="/dashboard/*" element={<DashboardMain ...
try to use `exact` attribute for `<Route>` components like this: ``` <Routes> <Route exact path="/" element={<PageIntro />} /> <Route exact path="/home" element={<PageHome />} /> <Route exact path="/about" element={<PageAbout />} /> <Route exact path="/work" e...
71,919,416
I am new to React and I am trying to display Header and Footer in other pages, except home page. I have an intro/loading page used "/" and home page used "/home". Can anyone help me? ```html import { BrowserRouter, Routes, Route } from 'react-router-dom'; import Header from '../components/Header'; import Footer from '...
2022/04/19
[ "https://Stackoverflow.com/questions/71919416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18857183/" ]
Your idea should work fine. Format your code to resemble the one below. Beware that CSS styles like `position: absolute` could affect how your browser serves your components - in my case, a login form had position of the parent `div` set to absolute so it was hindering the `footer` from being displayed even though it w...
try to use `exact` attribute for `<Route>` components like this: ``` <Routes> <Route exact path="/" element={<PageIntro />} /> <Route exact path="/home" element={<PageHome />} /> <Route exact path="/about" element={<PageAbout />} /> <Route exact path="/work" e...
62,211,066
I have 6 time series values as follows. ``` import numpy as np series = np.array([ [0., 0, 1, 2, 1, 0, 1, 0, 0], [0., 1, 2, 0, 0, 0, 0, 0, 0], [1., 2, 0, 0, 0, 0, 0, 1, 1], [0., 0, 1, 2, 1, 0, 1, 0, 0], [0., 1, 2, 0, 0, 0, 0, 0, 0], [1., 2, 0, 0, 0, 0, 0, 1, 1]]) ``` Suppose, I want to ...
2020/06/05
[ "https://Stackoverflow.com/questions/62211066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10704050/" ]
Everything is correct. As per [the docs](https://dtaidistance.readthedocs.io/en/latest/usage/dtw.html#dtw-between-set-of-series): > > The result is stored in a matrix representation. **Since only the upper > triangular matrix is required** this representation uses more memory then > necessary. > > > All diagon...
In `dtw.py` the default value for elements of the distance matrix are specified to be `np.inf`. As the matrix returns the pairwise distance between different sequences, this will not be filled in in the matrix, resulting in `np.inf` values. Try running with `dtw.distance_matrix_fast(series, compact=True)` to prevent s...
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
"The Round Table" (as in King Arthur's Court)
The Ban, the Hammer, and the Mod
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Proposed Name: The Ban Hammer.
"The Round Table" (as in King Arthur's Court)
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Proposed Name: The Ban Hammer.
"The [Janitors'](http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/) Closet"
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Quis custodiet ipsos custodes?
The Ban, the Hammer, and the Mod
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Quis custodiet ipsos custodes?
The mod hole ------------ As long as the site is called “moderators”, this name fits. If the site is renamed to “Community”, we could rename the chatroom to The comm center ---------------
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Fight the System! call it: The Free For all
"The [Janitors'](http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/) Closet"
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Proposed Name: The Ban Hammer.
The Ban, the Hammer, and the Mod
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
Quis custodiet ipsos custodes?
Fight the System! call it: The Free For all
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
"The Round Table" (as in King Arthur's Court)
Fight the System! call it: The Free For all
12
Right now the [chat room](http://chat.stackexchange.com/rooms/16046/moderators) is just called "Moderators". Can we come up with something a little more clever than that?
2014/07/29
[ "https://moderators.meta.stackexchange.com/questions/12", "https://moderators.meta.stackexchange.com", "https://moderators.meta.stackexchange.com/users/51/" ]
The mod hole ------------ As long as the site is called “moderators”, this name fits. If the site is renamed to “Community”, we could rename the chatroom to The comm center ---------------
"The Round Table" (as in King Arthur's Court)
59,115,719
I need to use multiple disposable resources with Rx. This is how I have nested the `Observable.Using` statements (the inner source is just for testing). ```cs var obs = Observable.Using( () => new FileStream("file.txt", FileMode.Open), fs => Observable.Using( () => new StreamReader(fs), sr => O...
2019/11/30
[ "https://Stackoverflow.com/questions/59115719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6180031/" ]
I can't think of a general way to `use` unlimited number of resources, but at least you could make helper methods for the common cases of 2-3 resources. Here is an implementation for two: ``` public static IObservable<TResult> Using<TResult, TResource1, TResource2>( Func<TResource1> resourceFactory1, Func<TRes...
I'd just continue to use the double `Using` pattern, but I'd clean up the internals of how you're reading the lines. Try this: ``` var obs = Observable.Using(() => new FileStream("file.txt", FileMode.Open), fs => Observable.Using(() => new StreamReader(fs), sr => Observable ...
59,115,719
I need to use multiple disposable resources with Rx. This is how I have nested the `Observable.Using` statements (the inner source is just for testing). ```cs var obs = Observable.Using( () => new FileStream("file.txt", FileMode.Open), fs => Observable.Using( () => new StreamReader(fs), sr => O...
2019/11/30
[ "https://Stackoverflow.com/questions/59115719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6180031/" ]
Usually when I have a set of resources to be used in a cold observable, I stick with the create pattern which is much easier to read. ``` var obs = Observable.Create<string>(observer => { var fs = new FileStream("file.txt", FileMode.Open); var sr = new StreamReader(fs); var task = TaskPoolScheduler.Defaul...
I'd just continue to use the double `Using` pattern, but I'd clean up the internals of how you're reading the lines. Try this: ``` var obs = Observable.Using(() => new FileStream("file.txt", FileMode.Open), fs => Observable.Using(() => new StreamReader(fs), sr => Observable ...
1,249,692
Whenever I use Microsoft Word's "insert hyperlink" tool, it automatically switches my text to a hyperlink font style. (blue, underlined text) [![Hyperlinked vs non-hyperlinked](https://i.stack.imgur.com/8POuD.png)](https://i.stack.imgur.com/8POuD.png) While I usually find this helpful, sometimes I want to add a hyper...
2017/09/12
[ "https://superuser.com/questions/1249692", "https://superuser.com", "https://superuser.com/users/358766/" ]
I solved this as follows: On the VPS server, I use the following command on the PREROUTING chain. It takes all the packets that arrive on port 555 of the eth0 interface (WAN), and changes its destination to the IP address of the VPN client on the DD-WRT router: ``` iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp ...
Right click on "Network" then click properties, click change adapter settings, right click on your Local Area connection, make sure Obtain IP address automatically is selected and obtain DNS automatically. Restart your machine and try to reconnect.
119,156
I decided to help @Matt out a bit and ask a PowerShell question. This is a simple guess-the-number game learning how to use functions with and without parameters, and use the input and output functions. All comments are welcome. ``` Function GetNumber([int]$min, [int]$max) { Return Get-Random -minimum $min -maximu...
2016/02/07
[ "https://codereview.stackexchange.com/questions/119156", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/-1/" ]
### Remove unnecessary imports > > > ``` > import java.util.ArrayList; > > ``` > > It won't hurt anything really, but it doesn't look like you need `ArrayList` in `Book`. ### Be consistent > > > ``` > //All articles, coordinate conjunctions, and prepositions are lower case in titles, > //per...
### Constructor chaining ``` public Book(String title, int pages, String author, String genre) { setTitle(title); setPages(pages); setAuthor(author); setGenre(genre); } Book(String title, int pages, String author) { setTitle(title); setPages(pages); setAuthor(author); setGenre(DEFAULT_...
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
There's [this](http://arcscripts.esri.com/details.asp?dbid=15375), though it's based and a different algorithm (and though it's on the ESRI site, it doesn't require ArcGIS). Of course, once you have the cartogram you can plot it in matplotlib.
[Here](http://www.limn.co.za/2013/10/making-a-cartogram/) is a Javascript plugin to make cartograms using D3. It is a good, simple solution if you are not too concerned about the regions being sized accurately. If accuracy is important, there are other options available that give you more freedom to play with the algor...
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
There's [this](http://arcscripts.esri.com/details.asp?dbid=15375), though it's based and a different algorithm (and though it's on the ESRI site, it doesn't require ArcGIS). Of course, once you have the cartogram you can plot it in matplotlib.
In short, no. But Newman has an excellent little implementation of his and Gastner's method [on his website](http://www-personal.umich.edu/~mejn/cart/doc/). Installing it is easy and it works from the command line. Here's an example of a workflow using this software that worked for me. 1. Compute a grid of density est...
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
There's [this](http://arcscripts.esri.com/details.asp?dbid=15375), though it's based and a different algorithm (and though it's on the ESRI site, it doesn't require ArcGIS). Of course, once you have the cartogram you can plot it in matplotlib.
The [geoplot.cartogram](https://residentmario.github.io/geoplot/cartogram.html) function in [Geoplot: geospatial data visualization — geoplot 0.2.0](https://residentmario.github.io/geoplot/index.html) says it is a high-level Python geospatial plotting library, and an extension to cartopy and matplotlib.
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
There's [this](http://arcscripts.esri.com/details.asp?dbid=15375), though it's based and a different algorithm (and though it's on the ESRI site, it doesn't require ArcGIS). Of course, once you have the cartogram you can plot it in matplotlib.
Try this library if you are using geopandas, it is quick and doesnt require much customization. <https://github.com/mthh/cartogram_geopandas>
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
[Here](http://www.limn.co.za/2013/10/making-a-cartogram/) is a Javascript plugin to make cartograms using D3. It is a good, simple solution if you are not too concerned about the regions being sized accurately. If accuracy is important, there are other options available that give you more freedom to play with the algor...
In short, no. But Newman has an excellent little implementation of his and Gastner's method [on his website](http://www-personal.umich.edu/~mejn/cart/doc/). Installing it is easy and it works from the command line. Here's an example of a workflow using this software that worked for me. 1. Compute a grid of density est...
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
[Here](http://www.limn.co.za/2013/10/making-a-cartogram/) is a Javascript plugin to make cartograms using D3. It is a good, simple solution if you are not too concerned about the regions being sized accurately. If accuracy is important, there are other options available that give you more freedom to play with the algor...
The [geoplot.cartogram](https://residentmario.github.io/geoplot/cartogram.html) function in [Geoplot: geospatial data visualization — geoplot 0.2.0](https://residentmario.github.io/geoplot/index.html) says it is a high-level Python geospatial plotting library, and an extension to cartopy and matplotlib.
4,217,304
In case somebody doesn't know: A [cartogram](http://en.wikipedia.org/wiki/Cartogram) is a type of map where some country/region-dependent numeric property scales the respective regions so that that property's density is (close to) constant. An example is ![Example cartogram](https://i.stack.imgur.com/p8O3c.png) from ...
2010/11/18
[ "https://Stackoverflow.com/questions/4217304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453616/" ]
[Here](http://www.limn.co.za/2013/10/making-a-cartogram/) is a Javascript plugin to make cartograms using D3. It is a good, simple solution if you are not too concerned about the regions being sized accurately. If accuracy is important, there are other options available that give you more freedom to play with the algor...
Try this library if you are using geopandas, it is quick and doesnt require much customization. <https://github.com/mthh/cartogram_geopandas>
10,612,086
My HTML is as follow. ``` <div class="box w-25 h-25"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> ``` and my css ``` .test { width:100% height:100% z-index: 999 } .box { .... } .w-25{ width: 25%; } .w-30{ width: 30%; } .w-40{ width: 40%; } .h-...
2012/05/16
[ "https://Stackoverflow.com/questions/10612086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080123/" ]
### Remove/Replace Classes There are a few ways to remove all classes, and leave only one. You could use `$.attr`: ``` $(".box").on("click", function(){ $(this).attr("class", "test"); }); ``` This sets the full value of `class` to a single classname. Alternatively, you could set the `className` on the element its...
If you want to remove all classes from a a div, all you would have to do is : `$('.box').attr('class', 'test');` this will replace the entire class attribute with whatever you want. or you can just empty out the class attribute : `$('.box').attr('class', '');` and then do addClass for any classes you would need pro...
10,612,086
My HTML is as follow. ``` <div class="box w-25 h-25"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> ``` and my css ``` .test { width:100% height:100% z-index: 999 } .box { .... } .w-25{ width: 25%; } .w-30{ width: 30%; } .w-40{ width: 40%; } .h-...
2012/05/16
[ "https://Stackoverflow.com/questions/10612086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080123/" ]
### Remove/Replace Classes There are a few ways to remove all classes, and leave only one. You could use `$.attr`: ``` $(".box").on("click", function(){ $(this).attr("class", "test"); }); ``` This sets the full value of `class` to a single classname. Alternatively, you could set the `className` on the element its...
``` $(".box").on("click", function(){ $(this).removeClass(). // remove all class addClass("test"); }); ```
10,612,086
My HTML is as follow. ``` <div class="box w-25 h-25"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> <div class="box w-30 h-30"> <p>test</p> </div> ``` and my css ``` .test { width:100% height:100% z-index: 999 } .box { .... } .w-25{ width: 25%; } .w-30{ width: 30%; } .w-40{ width: 40%; } .h-...
2012/05/16
[ "https://Stackoverflow.com/questions/10612086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080123/" ]
### Remove/Replace Classes There are a few ways to remove all classes, and leave only one. You could use `$.attr`: ``` $(".box").on("click", function(){ $(this).attr("class", "test"); }); ``` This sets the full value of `class` to a single classname. Alternatively, you could set the `className` on the element its...
This will keep on toggling the `box` class with `test`. Also, I have added the check wherein class will be changed only if div have other class i.e. w-xx and h-xx too. @Jonathan , Please see how can we improve this one. I have create the demo here: <http://jsbin.com/ucotot/> ``` $(function() { $('div.box').click ( ...
93,125
I'm sure there have been many people wanting someone to recommend them a wiki engine for whatever purpose, but I have yet to see anyone with my specific requirements. We currently have one Linux server that hosts every service in our (small) office. One of its duties is to run an apache server that ONLY allows connect...
2009/12/10
[ "https://serverfault.com/questions/93125", "https://serverfault.com", "https://serverfault.com/users/8297/" ]
It seems like you have two choices here: 1. find a wiki tool that supports PAM authentication directly. A quick scan of the web didn't reveal any that currently do, although it is mentioned as a future feature for pmwiki for example. 2. convert your authentication on the linux server to ldap, and then also point your ...
Have a look at [moinmoin](http://moinmo.in/) I've used it at a few places with similar requirements. It can be [integrated with PAM](http://moinmo.in/FeatureRequests/AuthenticationWithPAM) but it's not built in. LDAP is really a better method of centralizing users and groups. But it does offer a decent but not perfect ...
93,125
I'm sure there have been many people wanting someone to recommend them a wiki engine for whatever purpose, but I have yet to see anyone with my specific requirements. We currently have one Linux server that hosts every service in our (small) office. One of its duties is to run an apache server that ONLY allows connect...
2009/12/10
[ "https://serverfault.com/questions/93125", "https://serverfault.com", "https://serverfault.com/users/8297/" ]
It seems like you have two choices here: 1. find a wiki tool that supports PAM authentication directly. A quick scan of the web didn't reveal any that currently do, although it is mentioned as a future feature for pmwiki for example. 2. convert your authentication on the linux server to ldap, and then also point your ...
Try "Dokuwiki" I found it very good.
93,125
I'm sure there have been many people wanting someone to recommend them a wiki engine for whatever purpose, but I have yet to see anyone with my specific requirements. We currently have one Linux server that hosts every service in our (small) office. One of its duties is to run an apache server that ONLY allows connect...
2009/12/10
[ "https://serverfault.com/questions/93125", "https://serverfault.com", "https://serverfault.com/users/8297/" ]
MediaWiki isn't too hard to integrate with Apache if you're already going over HTTPS with authentication. I used the techniques on the following page to get it to pickup credentials we already have running through mod\_ssl. I think it was here that I found code to auto-build new Wiki accounts if necessary too. [http:...
Have a look at [moinmoin](http://moinmo.in/) I've used it at a few places with similar requirements. It can be [integrated with PAM](http://moinmo.in/FeatureRequests/AuthenticationWithPAM) but it's not built in. LDAP is really a better method of centralizing users and groups. But it does offer a decent but not perfect ...
93,125
I'm sure there have been many people wanting someone to recommend them a wiki engine for whatever purpose, but I have yet to see anyone with my specific requirements. We currently have one Linux server that hosts every service in our (small) office. One of its duties is to run an apache server that ONLY allows connect...
2009/12/10
[ "https://serverfault.com/questions/93125", "https://serverfault.com", "https://serverfault.com/users/8297/" ]
MediaWiki isn't too hard to integrate with Apache if you're already going over HTTPS with authentication. I used the techniques on the following page to get it to pickup credentials we already have running through mod\_ssl. I think it was here that I found code to auto-build new Wiki accounts if necessary too. [http:...
Try "Dokuwiki" I found it very good.
62,384,022
I'm following the Spring tutorial on the JetBrains [website](https://www.jetbrains.com/help/idea/your-first-spring-application.html) and when I try to build and run after adding the `sayHello()` method, it tells me it cannot find symbol `RequestParam` and `GetMapping`: ``` @GetMapping("/hello") public String sayHe...
2020/06/15
[ "https://Stackoverflow.com/questions/62384022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6378530/" ]
I forgot to import the annotations. Silly me
Have you included spring-starter-web dependency?? If yes try to import those dependencies sometimes it is not imported by default you need to build project or click on import dependencies in IntelliJ.
13,137,805
Is there a way to make an Ajax call from a hyperlink? I'd like to change the inner html of a div element when someone clicks on a hyperlink using javascript.
2012/10/30
[ "https://Stackoverflow.com/questions/13137805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1568362/" ]
Ajax is just "something you can do with JavaScript" Hyperlinks can have event handlers bound on them like any other HTML element. ``` var links_in_document = document.getElementsByTagName('a'); var a_link = links_in_document[0]; a_link.addEventListener('click', a_function_that_does_something_ajaxy); function a_funct...
``` <a href="javascript:yourAjaxFunctionName();">click</a> ```
9,177,072
i need a little bit of help with some jquery thing that i'm sure is stupid but has got me stuck. in the first dropdown is a list of products. in the second is a list of content associated with the products. i need to show/hide the corrent contents in the second dropdown according to what is selected in the first. for ...
2012/02/07
[ "https://Stackoverflow.com/questions/9177072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/152018/" ]
Unfortunately hiding or disabling options in a select in not supported cross browser. See [this question](https://stackoverflow.com/questions/1275383/jquery-remove-select-options-based-on-another-select-selected-need-support-for). I think your best option would be something similar to [this answer](https://stackoverf...
Well, the path you've selected is a bit error prone. Select raises some problems in IE. You cannot just show hide your options in IE. [Proof](http://jsbin.com/ecapib/edit#javascript,html). Further, doing all those complex id's is quite tricky. Finally if there are a lot of complex relationships between your inputs, at ...
3,184,094
i am trying to use the password recovery control provided by asp.net 3.5 and i get this error when the user presses submit : ``` Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The specified string is not in the form required for an e-mail address. ``` i am sure that the emai...
2010/07/06
[ "https://Stackoverflow.com/questions/3184094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384247/" ]
If you mean like: ``` var elementArray = document.getElementsByName("/regexhere/"); ``` then no that would not be possible. To do what you want to do you would have to get all the elements, then go through each one and check the name of it. Heres a function that will go through all the elements and add all the ele...
Use a [custom selector](http://jquery-howto.blogspot.com/2009/06/custom-jquery-selectors.html) in jQuery. You probably want an [example with parameters](http://jquery-howto.blogspot.com/2009/06/jquery-custom-selectors-with-parameters.html).
38,773,128
I read that `Oracle 9i` has `spfile.ora` by default, but I don't understand: why that file isn't in `Oracle 9i` by default. I want to know how to create `spfile.ora` correctly in `Oracle 11g`?
2016/08/04
[ "https://Stackoverflow.com/questions/38773128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6388634/" ]
You must be connected to your Oracle instance as `SYS`. Then use the following to create your `spfile` ``` CREATE SPFILE='/u01/oracle/dbs/spfile.ora' FROM PFILE='/u01/oracle/dbs/init.ora'; ```
Where do you want to create? RAC or standalone database. In RAC follow the steps. **Stop the database** srvctl stop database -d test Startup any one instance using existing pfile. SQL> startup nomount pfile='/scratch/u01/app/oracle/product/12.1.0/dbhome\_1/dbs/inittest.ora'; Create spfile from pfile. SQL> create spf...
108,802
This is Gentoo Linux with OpenRC (updated to systemd later on), and [ACPI](http://wiki.gentoo.org/wiki/ACPI) + some power management features in the kernel for Intel. ACPId is up and running. I can suspend to ram [using](http://www.gentoo-wiki.info/Power_Management): ``` echo -n "mem" > /sys/power/state ``` This wor...
2014/01/10
[ "https://unix.stackexchange.com/questions/108802", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
``` file="B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar" ``` with GNU `grep` when built with PCRE support (and with `zsh` or recent versions of `ksh93` or `bash` for `<<<`): ``` grep -oP '(?<=Z).{6}' <<< "$file" > file ``` with `ksh93`, `bash` or recent versions of `zsh`: ``` tmp=...
``` >>echo \ B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar | sed 's/.*Z\(.\{6\}\).*/\1/' >>NHN691 ``` Adding a `>file` will put it in a file.
108,802
This is Gentoo Linux with OpenRC (updated to systemd later on), and [ACPI](http://wiki.gentoo.org/wiki/ACPI) + some power management features in the kernel for Intel. ACPId is up and running. I can suspend to ram [using](http://www.gentoo-wiki.info/Power_Management): ``` echo -n "mem" > /sys/power/state ``` This wor...
2014/01/10
[ "https://unix.stackexchange.com/questions/108802", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/-1/" ]
``` expr B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar : '.*Z\(.\{6\}\)' > file ``` Or just with the shell ``` string=B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar printf '%.6s\n' "${string#*Z}" > file ``` (the first one will consider the last Z fol...
``` >>echo \ B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar | sed 's/.*Z\(.\{6\}\).*/\1/' >>NHN691 ``` Adding a `>file` will put it in a file.
50,063
I'm having some difficulty understanding the payment fees of a possible home equity line of credit (HELOC). The HELOC is for $270k, with a stated repayment period of 15 years at 2.75% APR. The credit union, however, insists that the minimum payment per month is $14 per $1000 dollars borrowed. Assuming the 2.75 intere...
2015/07/21
[ "https://money.stackexchange.com/questions/50063", "https://money.stackexchange.com", "https://money.stackexchange.com/users/25851/" ]
There are various exchanges around the world that handle spot precious metal trading; for the most part these are also the primary spot foreign exchange markets, like [EBS](http://www.ebs.com/markets/precious-metals.aspx), [Thomson Reuters](https://www.fxall.com/solutions--capabilities/choice-in-execution/choice-in-exe...
The futures market allows you to take delivery at the lowest cost. Most people don't deal in 100oz gold bars and 5000oz of 1000oz silver bars though, especially at the retail level. That said, when you are at the retail level, often times you will find reputable Internet dealers offering the lowest cost of ownership. K...
69,506,449
Here I have a dataframe named **all\_data**. It has a column named **'Order Date'**, which is of the format datetime. I want to create a new dataframe named **'aug4'**, which contains all the rows from the **'all\_data'** dataframe having the date August 4 (year is 2019 for all entries). How do I go about doing the sam...
2021/10/09
[ "https://Stackoverflow.com/questions/69506449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13738155/" ]
``` def fingersUp(self): fingers = [] if len(self.lmList): if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0]-1][1]: fingers.append(1) else: fingers.append(0) for id in range(1,5): if self.lmList[self.tipIds[id]][2]< self.lmList[self.tipI...
I had this same issue. Once adding Try: Except: around the if else statements in the fingersUp function I had no issue. The error is there because the fuction is being run even when your hands are off the screen. ``` Try: if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0] - 1][1]: ...
69,506,449
Here I have a dataframe named **all\_data**. It has a column named **'Order Date'**, which is of the format datetime. I want to create a new dataframe named **'aug4'**, which contains all the rows from the **'all\_data'** dataframe having the date August 4 (year is 2019 for all entries). How do I go about doing the sam...
2021/10/09
[ "https://Stackoverflow.com/questions/69506449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13738155/" ]
``` def fingersUp(self): fingers = [] if len(self.lmList): if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0]-1][1]: fingers.append(1) else: fingers.append(0) for id in range(1,5): if self.lmList[self.tipIds[id]][2]< self.lmList[self.tipI...
[enter image description here](https://i.stack.imgur.com/3iwD4.png) 1.Indentation 2. Missing "\_ "
69,506,449
Here I have a dataframe named **all\_data**. It has a column named **'Order Date'**, which is of the format datetime. I want to create a new dataframe named **'aug4'**, which contains all the rows from the **'all\_data'** dataframe having the date August 4 (year is 2019 for all entries). How do I go about doing the sam...
2021/10/09
[ "https://Stackoverflow.com/questions/69506449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13738155/" ]
``` def fingersUp(self): fingers = [] if len(self.lmList): if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0]-1][1]: fingers.append(1) else: fingers.append(0) for id in range(1,5): if self.lmList[self.tipIds[id]][2]< self.lmList[self.tipI...
**Try, this line:** * the brackets aren't placed right that is why it shows the error. ``` if (self.lmList[self.tipIds[0][1]] ```
8,280,205
I need to execute code in a class definition in C++. I have a macro to add a method to a function pointer after the definition of the method. It expands to a call to std::map.insert that it needs to execute in the definition (think of how Ruby executes code in class definitions). The class definition might look somethi...
2011/11/26
[ "https://Stackoverflow.com/questions/8280205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008938/" ]
You need to use a global, its constructor will then execute during program initialization. See for example [these questions](https://stackoverflow.com/search?q=%5Bc%2B%2B%5D+global+initialization+order) and [these](https://stackoverflow.com/questions/tagged/static-order-fiasco) for how to make sure that `map.insert` d...
No, you can't have executable code outside function body in class declaration. (if I understand you correctly). At which point do you expect it to be executed?
8,280,205
I need to execute code in a class definition in C++. I have a macro to add a method to a function pointer after the definition of the method. It expands to a call to std::map.insert that it needs to execute in the definition (think of how Ruby executes code in class definitions). The class definition might look somethi...
2011/11/26
[ "https://Stackoverflow.com/questions/8280205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008938/" ]
You need to use a global, its constructor will then execute during program initialization. See for example [these questions](https://stackoverflow.com/search?q=%5Bc%2B%2B%5D+global+initialization+order) and [these](https://stackoverflow.com/questions/tagged/static-order-fiasco) for how to make sure that `map.insert` d...
You can put this in the constructor.
1,757,452
First off, I found the solution to the exception. I'm more curious *why* it generated the specific exception it did. In my scenario I'm adding a [POCO](http://en.wikipedia.org/wiki/Plain_Old_CLR_Object) to a ListBox like so: ``` myListBox.Items.Add(myPOCO); ``` This was generating an `OutOfMemoryException`. The pro...
2009/11/18
[ "https://Stackoverflow.com/questions/1757452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
This is because of the way `System.Windows.Forms.ListBox.NativeAdd` method is implemented: ``` private int NativeAdd(object item) { int num = (int) base.SendMessage(0x180, 0, base.GetItemText(item)); switch (num) { case -2: throw new OutOfMemoryException(); case -1: ...
When the underlying [`LB_ADDSTRING`](http://msdn.microsoft.com/en-us/library/bb775181(VS.85).aspx) Windows API call fails, WinForms always returns an `OutOfMemoryException`. A comment in the .NET Framework Reference Source explains why: ``` // On some platforms (e.g. Win98), the ListBox control // appears to return LB...
1,757,452
First off, I found the solution to the exception. I'm more curious *why* it generated the specific exception it did. In my scenario I'm adding a [POCO](http://en.wikipedia.org/wiki/Plain_Old_CLR_Object) to a ListBox like so: ``` myListBox.Items.Add(myPOCO); ``` This was generating an `OutOfMemoryException`. The pro...
2009/11/18
[ "https://Stackoverflow.com/questions/1757452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
When the underlying [`LB_ADDSTRING`](http://msdn.microsoft.com/en-us/library/bb775181(VS.85).aspx) Windows API call fails, WinForms always returns an `OutOfMemoryException`. A comment in the .NET Framework Reference Source explains why: ``` // On some platforms (e.g. Win98), the ListBox control // appears to return LB...
If you get such error then carefully check your code where you are calling `listbox.Items.Add` or `listbox.DataSource = xxxxx`. Whatever `Object` Type is added or bound to list box must return non Null in `ToString()` method. By default .net returns Type name if you do not override `ToString()` method. If you have imp...
1,757,452
First off, I found the solution to the exception. I'm more curious *why* it generated the specific exception it did. In my scenario I'm adding a [POCO](http://en.wikipedia.org/wiki/Plain_Old_CLR_Object) to a ListBox like so: ``` myListBox.Items.Add(myPOCO); ``` This was generating an `OutOfMemoryException`. The pro...
2009/11/18
[ "https://Stackoverflow.com/questions/1757452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068/" ]
This is because of the way `System.Windows.Forms.ListBox.NativeAdd` method is implemented: ``` private int NativeAdd(object item) { int num = (int) base.SendMessage(0x180, 0, base.GetItemText(item)); switch (num) { case -2: throw new OutOfMemoryException(); case -1: ...
If you get such error then carefully check your code where you are calling `listbox.Items.Add` or `listbox.DataSource = xxxxx`. Whatever `Object` Type is added or bound to list box must return non Null in `ToString()` method. By default .net returns Type name if you do not override `ToString()` method. If you have imp...
97,113
I have created several content types and unfortunately, I made a mistake on some of the fields. The fields are field\_image and field\_screenshot. Under manage fields, I use field\_image and sometimes field\_screenshot. Now I want to use one field only for featured image on my node content. So, how can I transfer the ...
2013/12/13
[ "https://drupal.stackexchange.com/questions/97113", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/4452/" ]
No, this is not easily possible through the Drupal interface. You will need to execute a custom SQL query to move your data from one field to another. The following two queries will copy all field data from field\_image to field\_screenshot **for each entity where field\_screenshot is empty**. ``` INSERT INTO field_d...
Here is how you can do it in a module with COMBO of [db\_query](https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_query/7) and [db\_insert](https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_insert/7) ``` $result = db_query('SELECT a.* FROM {field_data_field_imag...
4,010,297
If I drop in to irb and do `require 'atom'` I can successfully include the gem but if I try to include it in my controller in rails I get `no such file to load -- atom` when I visit the page in the browser. What's going on here? Here's the complete stack trace: ``` C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_requi...
2010/10/24
[ "https://Stackoverflow.com/questions/4010297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/176645/" ]
irb is the interactive Ruby shell which is not rails. when you do gem install you are making it available for your installed version of Ruby, however Rails is slightly different. Rails only interacts with the gems you have listed in your Gemfile. Assuming you are using Rails 3, you would edit your Gemfile to include to...
Did you include it in your gemfile?
45,948,373
I have an array, what Is like this: ``` $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi...
2017/08/29
[ "https://Stackoverflow.com/questions/45948373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8270637/" ]
you need to remove the line, the link will change once followed and change back once the doc is reopened. ``` Selection.Range.Hyperlinks(1).Range.Fields(1).Result.Style = Word.WdBuiltinStyle.wdStyleHyperlinkFollowed ```
``` Option Explicit Sub test() Dim HL As Hyperlink For Each HL In Sheet1.Hyperlinks HL.Range.Style.Font.Color = vbBlue Next End Sub ``` Can't you simply make it any colour you want without invoking it. As others have stated above whatever you you I think will be a work around as it's not an intended functi...
45,948,373
I have an array, what Is like this: ``` $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi...
2017/08/29
[ "https://Stackoverflow.com/questions/45948373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8270637/" ]
this does it for me ``` Sub resetHyperlinks() Dim hLink As Hyperlink For Each hLink In ActiveDocument.Hyperlinks hLink.Address = hLink.Address ' this works ' hLink.ScreenTip = hLink.ScreenTip ' this works also Next hLink End Sub ```
``` Option Explicit Sub test() Dim HL As Hyperlink For Each HL In Sheet1.Hyperlinks HL.Range.Style.Font.Color = vbBlue Next End Sub ``` Can't you simply make it any colour you want without invoking it. As others have stated above whatever you you I think will be a work around as it's not an intended functi...
45,948,373
I have an array, what Is like this: ``` $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi...
2017/08/29
[ "https://Stackoverflow.com/questions/45948373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8270637/" ]
You don't need to change the style with code to make the link purple. Just use the `Follow` method. This will click the link and turn it purple and then it will be reset to blue upon opening the document again. ``` Sub Test1() Selection.Range.Hyperlinks(1).Follow End Sub ```
``` Option Explicit Sub test() Dim HL As Hyperlink For Each HL In Sheet1.Hyperlinks HL.Range.Style.Font.Color = vbBlue Next End Sub ``` Can't you simply make it any colour you want without invoking it. As others have stated above whatever you you I think will be a work around as it's not an intended functi...
45,948,373
I have an array, what Is like this: ``` $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi...
2017/08/29
[ "https://Stackoverflow.com/questions/45948373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8270637/" ]
You can reset link styles with VBA code that runs at startup, i.e. is a part of [`Document_Open()` routine](https://msdn.microsoft.com/en-us/library/office/aa211897%28v=office.11%29.aspx) in [`ThisDocument` VBA module](https://msdn.microsoft.com/en-us/library/aa189914(v=office.10).aspx). The [`Hyperlink` class](https:...
``` Option Explicit Sub test() Dim HL As Hyperlink For Each HL In Sheet1.Hyperlinks HL.Range.Style.Font.Color = vbBlue Next End Sub ``` Can't you simply make it any colour you want without invoking it. As others have stated above whatever you you I think will be a work around as it's not an intended functi...
45,948,373
I have an array, what Is like this: ``` $itemx= [ 'Weapons'=>[ 'Sword'=> [ 'ID' => '1', 'Name' => 'Lurker', 'Value' => '12', 'Made' => 'Acient' ], 'Shield'=> [ 'ID' => '2', 'Name' => 'Obi...
2017/08/29
[ "https://Stackoverflow.com/questions/45948373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8270637/" ]
The "temporary" color of a followed hyperlink is an embedded (and not directly accessible) feature of the built-in Hyperlink character style. It is not exposed through the normal UI's Style tools, nor through the object model. You can readily compare all formatting between two selections using the Reveal Formatting pa...
``` Option Explicit Sub test() Dim HL As Hyperlink For Each HL In Sheet1.Hyperlinks HL.Range.Style.Font.Color = vbBlue Next End Sub ``` Can't you simply make it any colour you want without invoking it. As others have stated above whatever you you I think will be a work around as it's not an intended functi...
3,693,490
This is just for my weekend project/study, I am very new to Sinatra and MongoDB. I've installed the gems for mongoDB, such as: mongo, mongo\_mapper and mongoid. When I tried connecting to my database on MongoHQ from localhost, it encountered such an error: ``` Mongo::ConnectionFailure at / failed to connect to any g...
2010/09/12
[ "https://Stackoverflow.com/questions/3693490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175296/" ]
I use ``` uri = URI.parse(ENV['MONGOHQ_URL']) @mongo_connection = Mongo::Connection.from_uri( uri ) @mongo_db = @mongo_connection.db(uri.path.gsub(/^\//, '')) @mongo_db.authenticate(uri.user, uri.password) ``` You can look up your mongo url using the `heroku config --long` command
Just gave this another try, this time, I was using the ip address taken from ping: So, if I change : ``` db = Mongo::Connection.new('flame.mongohq.com', 27060).db("notes") db.authenticate('fake', 'info') ``` To: ``` db = Mongo::Connection.new('184.73.224.5', 27060).db("notes") db.authenticate('fake', 'info') ``` ...
36,679,167
I have a php script that gets called from a upload form, the script puts entries into a database. I would like to see the results on my browser as the script is running. I am using the code below, but the output shows up after the whole script has finished executing. My server is Apache2 running on Ubuntu. I thought by...
2016/04/17
[ "https://Stackoverflow.com/questions/36679167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492015/" ]
You don't need ob\_start : ``` <?php for($i=0;$i<100;$i++) { echo $i; flush(); ob_flush(); sleep(1); } echo 'done.'; ob_end_flush(); ?> ``` From Comment: > > php flush : Flushes the system write buffers of PHP and whatever > backend PHP is using (CGI, a web server, etc). This attempts to push > c...
Try with this use ob\_get\_contents() to get data ``` ob_start(); foreach ($csvAsArray as $value) { $username = $value[0]; $password = $value[1]; $db->insert($username, $password, $machine); echo $username . " Inserted into database! <br />"; } $data = ob_get_contents(); ob_end_clea...
1,208,508
Alyssa writes 101 distinct positive integers on a blackboard, in a row, so that the sum of any two consecutive integers is divisible by 5. Let N be the smallest possible sum of all 101 integers. Find N. I started with 1, then 4, then 6.... How do I find the sum? What will be the 101th term? Is there an easier way? Than...
2015/03/27
[ "https://math.stackexchange.com/questions/1208508", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223949/" ]
Assume $x$ is the remainder of the first number when divided by $5$, then it follows that the second number must have $5-x$ as the remainder when divided by $5$. Then the third number must have $x$ as the remainder, and the fourth number must have $5-x$ as the remainder when divided by $5$ ... Hence, the $i$-th number...
A fairly brute force approach works quite nicely. HINT: Let the numbers be $a\_0,a\_1,\ldots,a\_{100}$. Since $5$ divides both $a\_{k-1}+a\_k$ and $a\_k+a\_{k+1}$, it’s clear that $a\_{k+1}\equiv a\_{k-1}\pmod5$ for $k=1,\ldots,99$. In particular, $a\_{2k}\equiv a\_0\pmod5$ for $k=0,\ldots,50$, and $a\_{2k+1}\equiv a\...
50,256,960
I'd like to sample without replacement from MU, MG, PU, PG 70 times to create a matrix (ncol=4, nrow=70) e.g. ``` sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) #etc ``` So far I have:...
2018/05/09
[ "https://Stackoverflow.com/questions/50256960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134241/" ]
The `replicate` function might be what you're looking for. I'll only do 10 replicates to not overflow the screen. ``` > sample(c("MU","MG","PU","PG"), 4,F) [1] "MG" "MU" "PU" "PG" > replicate(10, sample(c("MU","MG","PU","PG"), 4,F)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "MG" "PG" "MU" "MU" "PU" ...
A quick solution would be a loop: ``` mat <- matrix(NA_character_, nrow = 70, ncol = 4) for (i in 1:70) { mat[i, ] <- sample(c("MU","MG","PU","PG"), 4, replace = FALSE) } ``` And for those allergic to loops: ``` t(sapply(1:70, function(x) sample(c("MU","MG","PU","PG"), 4, replace = FALSE))) ```
50,256,960
I'd like to sample without replacement from MU, MG, PU, PG 70 times to create a matrix (ncol=4, nrow=70) e.g. ``` sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) #etc ``` So far I have:...
2018/05/09
[ "https://Stackoverflow.com/questions/50256960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134241/" ]
The `replicate` function might be what you're looking for. I'll only do 10 replicates to not overflow the screen. ``` > sample(c("MU","MG","PU","PG"), 4,F) [1] "MG" "MU" "PU" "PG" > replicate(10, sample(c("MU","MG","PU","PG"), 4,F)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "MG" "PG" "MU" "MU" "PU" ...
You can try this also: ``` lyst <- lapply( 1:70, function(x) {set.seed(x); sample(c("PU", "MU", "MG", "PG"), 4, replace=F)}) do.call("rbind", lyst) ``` **Sample of some rows as an output**: ``` #[,1] [,2] [,3] [,4] #[1,] "MU" "PG" "MG" "PU" #[2,] "PU" "MG" "MU" "PG" #[3,] "PU" "MG" "PG" "MU" #[4,] "MG" "PU" "P...
50,256,960
I'd like to sample without replacement from MU, MG, PU, PG 70 times to create a matrix (ncol=4, nrow=70) e.g. ``` sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) sample(c("MU","MG","PU","PG"), 4,F) #etc ``` So far I have:...
2018/05/09
[ "https://Stackoverflow.com/questions/50256960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134241/" ]
A quick solution would be a loop: ``` mat <- matrix(NA_character_, nrow = 70, ncol = 4) for (i in 1:70) { mat[i, ] <- sample(c("MU","MG","PU","PG"), 4, replace = FALSE) } ``` And for those allergic to loops: ``` t(sapply(1:70, function(x) sample(c("MU","MG","PU","PG"), 4, replace = FALSE))) ```
You can try this also: ``` lyst <- lapply( 1:70, function(x) {set.seed(x); sample(c("PU", "MU", "MG", "PG"), 4, replace=F)}) do.call("rbind", lyst) ``` **Sample of some rows as an output**: ``` #[,1] [,2] [,3] [,4] #[1,] "MU" "PG" "MG" "PU" #[2,] "PU" "MG" "MU" "PG" #[3,] "PU" "MG" "PG" "MU" #[4,] "MG" "PU" "P...
2,306,145
Consider the polynomial $$ f = 2x+1 $$ I need to determine whether this polynomial is a unit (invertible element) in the polynomial ring $\mathbb{Z}\_{5}[x]$. If it were a unit in this ring, then there would have to exist a polynomial of the form $ax+b$ with $a,b \in \mathbb{Z}\_{5}$ such that $$ \displaystyle (2x+1)...
2017/06/01
[ "https://math.stackexchange.com/questions/2306145", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
$\mathbb{Z}\_5$ is a field, so if $q(x)=a\_0+...+a\_nx^n\neq 0, a\_n\neq 0$, the leading coefficient of $(2x+1)q(x)=2a\_n\neq 0$ and is associated to $x^{n+1}$. So the degree of $(2x+1)q(x)$ is strictly superior to $0$ and $2x+1$ is not a unit.
$Z\_5$ is a field therefore $Z\_5[x]$ is an integral domain. Hence, $\deg fg = \deg f + \deg g$. What can you conclude from here?
217,831
I am trying to understand a step in the math given a scientific paper. They differentiate an objective function of the form: $$snr = \frac{\sum\_{i=1}^n x\_it\_i}{\sum\_{i=1}^n x\_id\_i} $$ To maximize this function they partially differentiate this function with respect to $x\_i$. $$\frac{\partial{snr} }{\partial{...
2012/10/21
[ "https://math.stackexchange.com/questions/217831", "https://math.stackexchange.com", "https://math.stackexchange.com/users/45446/" ]
Here's a hint. Suppose we're differentiating with respect to $x\_1$. We know that $snr = \frac{t\_1x\_1 + s}{d\_1x\_1 + e}$ where $s = \sum\_{j>2} t\_jx\_j, e =\sum\_{j>2} d\_jx\_j$. Now we can differentiate with respect to $x\_1$ by the quotient rule, pretending that the other terms are constants: $$ \frac{\partial...
I think there's a mistake in the denominator of the differntiated formula in the science paper. Please check and correct me if I am wrong.