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
39,729,102
Assuming I have Angular 2 App, routing with RouterLink, Google can read it as a follow link and index it? In other words: Can google bot recognize the routerlinks normally as links?
2016/09/27
[ "https://Stackoverflow.com/questions/39729102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3669981/" ]
This is the argument in Angular Universal: > > Optimized for Search Engines: Although Googlebot crawls and renders > most dynamic sites, many search engines expect plain HTML > > > **So for google not needed** --- **but for other crawlers** you might need.. Angular Univeral
It cannot, but you should take a look at [Angular Universal](https://universal.angular.io/). With it, you can pre-render your app on the server side and Google is able to understand it.
39,729,102
Assuming I have Angular 2 App, routing with RouterLink, Google can read it as a follow link and index it? In other words: Can google bot recognize the routerlinks normally as links?
2016/09/27
[ "https://Stackoverflow.com/questions/39729102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3669981/" ]
According to Google [documentation](https://developers.google.com/search/docs/crawling-indexing/links-crawlable) **googlebot can't navigate through pages using routerLink**. You can try and **add both attributes - href and routerLink**. In my tests the **interactivity for the user didn't change** and it still worked l...
It cannot, but you should take a look at [Angular Universal](https://universal.angular.io/). With it, you can pre-render your app on the server side and Google is able to understand it.
39,729,102
Assuming I have Angular 2 App, routing with RouterLink, Google can read it as a follow link and index it? In other words: Can google bot recognize the routerlinks normally as links?
2016/09/27
[ "https://Stackoverflow.com/questions/39729102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3669981/" ]
This is the argument in Angular Universal: > > Optimized for Search Engines: Although Googlebot crawls and renders > most dynamic sites, many search engines expect plain HTML > > > **So for google not needed** --- **but for other crawlers** you might need.. Angular Univeral
According to Google [documentation](https://developers.google.com/search/docs/crawling-indexing/links-crawlable) **googlebot can't navigate through pages using routerLink**. You can try and **add both attributes - href and routerLink**. In my tests the **interactivity for the user didn't change** and it still worked l...
49,495,404
I have the following setup: I want to list all holidays of a specific year. That's why I leave out the default list view and implement my own like this: ``` class HolidayViewSet(mixins.RetrieveModelMixin, GenericViewSet): @list_route() def year(self, request, year=get_today().year): public_holidays = self.get_que...
2018/03/26
[ "https://Stackoverflow.com/questions/49495404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1331671/" ]
Ok, my workaround is using `django-filter`. **My filter:** ``` class HolidayFilter(filters.FilterSet): """ This filter can be used to filter holidays by different values in API views or viewsets. See http://django-filter.readthedocs.io/en/1.1.0/guide/rest_framework.html """ year = filters.NumberFi...
DRF differentiates `list` and `detail` requests. `list` request is not expected to have additional path parameter(i.e. `/{id}`), while `detail` request, in opposite, defined by it. What it means is `@list_route` decorator creates `/holiday/year` endpoint, and `@detail_route` will create `/holiday/{id}/year` endpoint.
49,495,404
I have the following setup: I want to list all holidays of a specific year. That's why I leave out the default list view and implement my own like this: ``` class HolidayViewSet(mixins.RetrieveModelMixin, GenericViewSet): @list_route() def year(self, request, year=get_today().year): public_holidays = self.get_que...
2018/03/26
[ "https://Stackoverflow.com/questions/49495404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1331671/" ]
Ok, my workaround is using `django-filter`. **My filter:** ``` class HolidayFilter(filters.FilterSet): """ This filter can be used to filter holidays by different values in API views or viewsets. See http://django-filter.readthedocs.io/en/1.1.0/guide/rest_framework.html """ year = filters.NumberFi...
I think my approach is so simple but its useful. just determine your Router like below: ``` urlpatterns += [ path(r'holiday/<int:year>/', TestListView.as_view()), ] ``` **The URL:** api/v1/holiday/2016/ Then create your view like this: ``` class TestListView(generics.ListAPIView): serializer_class = Test...
113,059
I am planing on running Paranoia (2017 edition) to give my D&D DM a rest for a few weeks. My players love social engineering boardgames such as Resistance and Secret Hitler but also would prefer to have an adventure run over a couple of weeks rather then 1 session. Reading the rules and online it seems that generally...
2018/01/09
[ "https://rpg.stackexchange.com/questions/113059", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39623/" ]
Either will work fine. ---------------------- First, I hope it's obvious that creating L4 second PCs for each player and starting during chapter 2 poses neither narrative nor mechanical problems--it's basically exactly what's intended. As for starting at chapter 1 with new first-level characters, *Storm King's Thunde...
Don't start them at level 1 =========================== It seems you want to add some meat shields to the squishies. Starting them on first level, with fewer hit points than the casters kind of defeats the purpose. Keeping them alive would be an extra burden on the casters for the first few levels. Assuming a quite r...
113,059
I am planing on running Paranoia (2017 edition) to give my D&D DM a rest for a few weeks. My players love social engineering boardgames such as Resistance and Secret Hitler but also would prefer to have an adventure run over a couple of weeks rather then 1 session. Reading the rules and online it seems that generally...
2018/01/09
[ "https://rpg.stackexchange.com/questions/113059", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39623/" ]
Start them at level 1 ===================== While it seems clear that the point is to help supplement the issues present with the current adventuring duo, you also mention that these are fairly new players. As such, having the time to learn how to control the new characters would likely prove very beneficial to them. ...
Don't start them at level 1 =========================== It seems you want to add some meat shields to the squishies. Starting them on first level, with fewer hit points than the casters kind of defeats the purpose. Keeping them alive would be an extra burden on the casters for the first few levels. Assuming a quite r...
113,059
I am planing on running Paranoia (2017 edition) to give my D&D DM a rest for a few weeks. My players love social engineering boardgames such as Resistance and Secret Hitler but also would prefer to have an adventure run over a couple of weeks rather then 1 session. Reading the rules and online it seems that generally...
2018/01/09
[ "https://rpg.stackexchange.com/questions/113059", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/39623/" ]
Either will work fine. ---------------------- First, I hope it's obvious that creating L4 second PCs for each player and starting during chapter 2 poses neither narrative nor mechanical problems--it's basically exactly what's intended. As for starting at chapter 1 with new first-level characters, *Storm King's Thunde...
Start them at level 1 ===================== While it seems clear that the point is to help supplement the issues present with the current adventuring duo, you also mention that these are fairly new players. As such, having the time to learn how to control the new characters would likely prove very beneficial to them. ...
44,222,820
I created a website that uses buttons to move to the next page and everything works fine. Except on the homepage where there is a lot of white space under all of the content. I tried making the overflow hidden but that blocks the button that you have to click to go to the next page. I would like the height of the first...
2017/05/28
[ "https://Stackoverflow.com/questions/44222820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7798094/" ]
This is because you working with `visibility` ... change it to `display : block` and `display : none` you can take a look at [What is the difference between visibility:hidden and display:none?](https://stackoverflow.com/questions/133051/what-is-the-difference-between-visibilityhidden-and-displaynone)
you must use `display` attribute on this.. try this website for further studies on display property.. <https://www.w3schools.com/cssref/pr_class_display.asp> your Code.. ``` .content { //along with other codes display : none; } ```
22,971,521
whenever I switch directory in my terminal, I have to run the command "/bin/bash --login" before I can run rails/rake related commands. If I don't, I get an error saying "the program "rails" can be found in the following packages: ..." Any advice?
2014/04/09
[ "https://Stackoverflow.com/questions/22971521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2938939/" ]
By default some servers do not allow this due to permissions reason. You can place this in `~/.bashrc` and it will automatically work when you open a new terminal As per bash man page. > > When an interactive shell that is not a login shell is started, bash > reads and executes commands from ~/.bashrc, if that fil...
Easy solution: Just open terminal. GO to Edit menu from terminal navigation bar, Select "Profile Preferences", It will open "edit profile pop-up". Select "Title and Command" button and "check Run Command as login shell" ctrl + alt + t -> Edit -> Profile Preferences -> Title and Command -> Check Run command as login s...
69,490,468
Once i upgraded to Flutter 2.5.1 my project stops build and run, giving this error: > > /Users/admin/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator\_android-2.0.0/android/src/main/java/com/baseflow/geolocator/location/LocationMapper.java:29: error: cannot find symbol > if (Build.VERSION.SDK\_INT >= Bui...
2021/10/08
[ "https://Stackoverflow.com/questions/69490468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7360275/" ]
You must have upgraded `Geolocator` to version 7.7.0, which means you will also need to update your `android/app/build.gradle` file and set the `compileSdkVersion` to 31 (it's mentioned in the [CHANGELOG](https://pub.dev/packages/geolocator/changelog#770)). If you don't want to upgrade the Android `compileSdkVersion` ...
Maybe your version is not upgraded with your packages The following command will help you for that: `flutter pub get`
69,490,468
Once i upgraded to Flutter 2.5.1 my project stops build and run, giving this error: > > /Users/admin/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator\_android-2.0.0/android/src/main/java/com/baseflow/geolocator/location/LocationMapper.java:29: error: cannot find symbol > if (Build.VERSION.SDK\_INT >= Bui...
2021/10/08
[ "https://Stackoverflow.com/questions/69490468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7360275/" ]
You must have upgraded `Geolocator` to version 7.7.0, which means you will also need to update your `android/app/build.gradle` file and set the `compileSdkVersion` to 31 (it's mentioned in the [CHANGELOG](https://pub.dev/packages/geolocator/changelog#770)). If you don't want to upgrade the Android `compileSdkVersion` ...
I just Upgraded my project and got this issue: Maybe this will work for you: **Run These commands in your terminal:** ``` dart pub downgrade geolocator_android ``` ``` dart pub downgrade geolocator ``` Another way is to set Compile and Target Android version to 31. But I will not recommend it for now coz this wi...
69,490,468
Once i upgraded to Flutter 2.5.1 my project stops build and run, giving this error: > > /Users/admin/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator\_android-2.0.0/android/src/main/java/com/baseflow/geolocator/location/LocationMapper.java:29: error: cannot find symbol > if (Build.VERSION.SDK\_INT >= Bui...
2021/10/08
[ "https://Stackoverflow.com/questions/69490468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7360275/" ]
The error is because the compileSdkVersion needs to be changed to 31 for Geolocator 7.7.0 and higher. You could either do that in android/app/build.gradle file. But I wouldn't recommend it as it will cause more errors with other packages. Instead, you could downgrade the Geolocator to 7.6.2 in the pubspec.yaml Or us...
Maybe your version is not upgraded with your packages The following command will help you for that: `flutter pub get`
69,490,468
Once i upgraded to Flutter 2.5.1 my project stops build and run, giving this error: > > /Users/admin/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator\_android-2.0.0/android/src/main/java/com/baseflow/geolocator/location/LocationMapper.java:29: error: cannot find symbol > if (Build.VERSION.SDK\_INT >= Bui...
2021/10/08
[ "https://Stackoverflow.com/questions/69490468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7360275/" ]
The error is because the compileSdkVersion needs to be changed to 31 for Geolocator 7.7.0 and higher. You could either do that in android/app/build.gradle file. But I wouldn't recommend it as it will cause more errors with other packages. Instead, you could downgrade the Geolocator to 7.6.2 in the pubspec.yaml Or us...
I just Upgraded my project and got this issue: Maybe this will work for you: **Run These commands in your terminal:** ``` dart pub downgrade geolocator_android ``` ``` dart pub downgrade geolocator ``` Another way is to set Compile and Target Android version to 31. But I will not recommend it for now coz this wi...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
If you have features `[a, b, c]` the default polynomial features(in `sklearn` the degree is 2) should be `[1, a, b, c, a^2, b^2, c^2, ab, bc, ca]`. `2.61576000e+03` is `37.8x62.2=2615,76` (`2615,76 = 2.61576000 x 10^3`) In a simple way with the `PolynomialFeatures` you can create new features. There is a good referen...
You have 3-dimensional data and the following code generates all poly features of degree 2: ``` X=np.array([[230.1,37.8,69.2]]) from sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures() X_poly=poly.fit_transform(X) X_poly #array([[ 1.00000000e+00, 2.30100000e+02, 3.78000000e+01, # 6.92...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
PolynomialFeatures generates a new matrix with all polynomial combinations of features with given degree. Like [a] will be converted into [1,a,a^2] for degree 2. You can visualize input being transformed into matrix generated by PolynomialFeatures. ``` from sklearn.preprocessing import PolynomialFeatures a = np.arra...
You have 3-dimensional data and the following code generates all poly features of degree 2: ``` X=np.array([[230.1,37.8,69.2]]) from sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures() X_poly=poly.fit_transform(X) X_poly #array([[ 1.00000000e+00, 2.30100000e+02, 3.78000000e+01, # 6.92...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
You have 3-dimensional data and the following code generates all poly features of degree 2: ``` X=np.array([[230.1,37.8,69.2]]) from sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures() X_poly=poly.fit_transform(X) X_poly #array([[ 1.00000000e+00, 2.30100000e+02, 3.78000000e+01, # 6.92...
According scikit's [0.23 docs](https://scikit-learn.org/0.23/modules/generated/sklearn.preprocessing.PolynomialFeatures.html) (and as far back as [0.15](https://scikit-learn.org/0.15/modules/generated/sklearn.preprocessing.PolynomialFeatures.html)), `PolynomialFeatures` will > > [generate] a new feature matrix consis...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
The general way to check the features is with [`poly.get_feature_names()`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html#sklearn.preprocessing.PolynomialFeatures.get_feature_names). In this case, it would be ```py In [15]: poly.get_feature_names(['a','b','c']) Out[15]:...
You have 3-dimensional data and the following code generates all poly features of degree 2: ``` X=np.array([[230.1,37.8,69.2]]) from sklearn.preprocessing import PolynomialFeatures poly = PolynomialFeatures() X_poly=poly.fit_transform(X) X_poly #array([[ 1.00000000e+00, 2.30100000e+02, 3.78000000e+01, # 6.92...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
If you have features `[a, b, c]` the default polynomial features(in `sklearn` the degree is 2) should be `[1, a, b, c, a^2, b^2, c^2, ab, bc, ca]`. `2.61576000e+03` is `37.8x62.2=2615,76` (`2615,76 = 2.61576000 x 10^3`) In a simple way with the `PolynomialFeatures` you can create new features. There is a good referen...
PolynomialFeatures generates a new matrix with all polynomial combinations of features with given degree. Like [a] will be converted into [1,a,a^2] for degree 2. You can visualize input being transformed into matrix generated by PolynomialFeatures. ``` from sklearn.preprocessing import PolynomialFeatures a = np.arra...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
If you have features `[a, b, c]` the default polynomial features(in `sklearn` the degree is 2) should be `[1, a, b, c, a^2, b^2, c^2, ab, bc, ca]`. `2.61576000e+03` is `37.8x62.2=2615,76` (`2615,76 = 2.61576000 x 10^3`) In a simple way with the `PolynomialFeatures` you can create new features. There is a good referen...
According scikit's [0.23 docs](https://scikit-learn.org/0.23/modules/generated/sklearn.preprocessing.PolynomialFeatures.html) (and as far back as [0.15](https://scikit-learn.org/0.15/modules/generated/sklearn.preprocessing.PolynomialFeatures.html)), `PolynomialFeatures` will > > [generate] a new feature matrix consis...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
If you have features `[a, b, c]` the default polynomial features(in `sklearn` the degree is 2) should be `[1, a, b, c, a^2, b^2, c^2, ab, bc, ca]`. `2.61576000e+03` is `37.8x62.2=2615,76` (`2615,76 = 2.61576000 x 10^3`) In a simple way with the `PolynomialFeatures` you can create new features. There is a good referen...
The general way to check the features is with [`poly.get_feature_names()`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html#sklearn.preprocessing.PolynomialFeatures.get_feature_names). In this case, it would be ```py In [15]: poly.get_feature_names(['a','b','c']) Out[15]:...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
PolynomialFeatures generates a new matrix with all polynomial combinations of features with given degree. Like [a] will be converted into [1,a,a^2] for degree 2. You can visualize input being transformed into matrix generated by PolynomialFeatures. ``` from sklearn.preprocessing import PolynomialFeatures a = np.arra...
According scikit's [0.23 docs](https://scikit-learn.org/0.23/modules/generated/sklearn.preprocessing.PolynomialFeatures.html) (and as far back as [0.15](https://scikit-learn.org/0.15/modules/generated/sklearn.preprocessing.PolynomialFeatures.html)), `PolynomialFeatures` will > > [generate] a new feature matrix consis...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
PolynomialFeatures generates a new matrix with all polynomial combinations of features with given degree. Like [a] will be converted into [1,a,a^2] for degree 2. You can visualize input being transformed into matrix generated by PolynomialFeatures. ``` from sklearn.preprocessing import PolynomialFeatures a = np.arra...
The general way to check the features is with [`poly.get_feature_names()`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html#sklearn.preprocessing.PolynomialFeatures.get_feature_names). In this case, it would be ```py In [15]: poly.get_feature_names(['a','b','c']) Out[15]:...
51,906,321
I've added some loading animation to my Angular application between `<app-root> HERE </app-root>` tag. I need to delay start to show and check this animation. I know about JS `setTimeout()` but where to possibly place it?
2018/08/18
[ "https://Stackoverflow.com/questions/51906321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9355797/" ]
The general way to check the features is with [`poly.get_feature_names()`](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html#sklearn.preprocessing.PolynomialFeatures.get_feature_names). In this case, it would be ```py In [15]: poly.get_feature_names(['a','b','c']) Out[15]:...
According scikit's [0.23 docs](https://scikit-learn.org/0.23/modules/generated/sklearn.preprocessing.PolynomialFeatures.html) (and as far back as [0.15](https://scikit-learn.org/0.15/modules/generated/sklearn.preprocessing.PolynomialFeatures.html)), `PolynomialFeatures` will > > [generate] a new feature matrix consis...
5,173,860
I have a layouting problem with my android application: I have a Listview consiting of items which are using the following layout: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" ...
2011/03/02
[ "https://Stackoverflow.com/questions/5173860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/638344/" ]
Try using `android:layout_centerVertical="true"` for the track\_position TextView. **EDIT:** In light of Maaalte correctly pointing out that the above is for RelativeLayout, I found my layout I was thinking of which achieves what is needed... ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andro...
I'm not familiar with this, just web styling. But if there is always 1 line for the track and the band, can't you just set a paddingTop value to the second LinearLayout block?
5,173,860
I have a layouting problem with my android application: I have a Listview consiting of items which are using the following layout: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" ...
2011/03/02
[ "https://Stackoverflow.com/questions/5173860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/638344/" ]
You need ``` android:gravity="center_vertical" ``` On the LinearLayout containing the two textViews, like this: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:minHeight...
Try using `android:layout_centerVertical="true"` for the track\_position TextView. **EDIT:** In light of Maaalte correctly pointing out that the above is for RelativeLayout, I found my layout I was thinking of which achieves what is needed... ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/andro...
5,173,860
I have a layouting problem with my android application: I have a Listview consiting of items which are using the following layout: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" ...
2011/03/02
[ "https://Stackoverflow.com/questions/5173860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/638344/" ]
You need ``` android:gravity="center_vertical" ``` On the LinearLayout containing the two textViews, like this: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:minHeight...
I'm not familiar with this, just web styling. But if there is always 1 line for the track and the band, can't you just set a paddingTop value to the second LinearLayout block?
60,140,906
Hello and Thanks in advance. I am trying to install a package with composer but at first it gave me an error about requiring ext-dom and ext-mbstring extensions, I solved that but now it's giving me this error: ``` Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion...
2020/02/09
[ "https://Stackoverflow.com/questions/60140906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12520496/" ]
After further searching I found out that This package is no longer supported by laravel v6 and in **packagist** I found this: > > This package is abandoned and no longer maintained. The author suggests using the laravelcollective/html package instead. > > >
[Link](https://stackoverflow.com/questions/29318709/how-can-i-resolve-your-requirements-could-not-be-resolved-to-an-installable-set) Your software dependencies have an incompatible version conflict. At the same time you want to install any Laravel 4.2.x version, and "zizaco/entrust" from its master branch. And that ma...
72,098,404
``` fun toggleSpeaker(context: Context) { isSpeakerPhoneSelected.value?.let { val audioManager: AudioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager audioManager.setSpeakerphoneOn = !it isSpeakerPhoneSelected.value = !it logDebug(context,...
2022/05/03
[ "https://Stackoverflow.com/questions/72098404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16681187/" ]
I've come across the same issue earlier when I set the targetSDKLevel to android 12. I'd a call screen over which I provided a speaker button through which user can turn on/off the speaker. I used **AudioDeviceInfo** API for android 12 to set the communication device on audioManager. ``` public void switchSpeakerStat...
Boiling it down to kotlin (since the question was asked in kotlin): ``` val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { audioManager.availableCommunicationDevices.firstOrNull { it.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER ...
54,948,738
I'm really confused with the architecture of yolov3. I've read the documentation and paper about it. Some people say that it has 103 convolutional layers, some others say that it has 53 layers. But when you count the convolutional layers in the .cfg file (after downloading it) it comes to about 75! ...What is missed he...
2019/03/01
[ "https://Stackoverflow.com/questions/54948738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8808347/" ]
According to AlexeyAB (creator of very popular forked Darknet version and creator of YOLO v4) <https://groups.google.com/forum/?nomobile=true#!topic/darknet/9WppEzRouMU> Yolo has 75 cnn-layers (convolutional layers) + 31 other layers (shortcut, route, upsample, yolo) = 106 layers in total. Remember that Yolo V3 d...
It [looks like](https://github.com/ultralytics/yolov3/blob/master/models.py) in this case there can be a variable number of layers in this model. In the [paper](https://pjreddie.com/media/files/papers/YOLOv3.pdf) it says that Darknet53 has 53 layers. But in their [train.py](https://github.com/ultralytics/yolov3/blob/ma...
54,948,738
I'm really confused with the architecture of yolov3. I've read the documentation and paper about it. Some people say that it has 103 convolutional layers, some others say that it has 53 layers. But when you count the convolutional layers in the .cfg file (after downloading it) it comes to about 75! ...What is missed he...
2019/03/01
[ "https://Stackoverflow.com/questions/54948738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8808347/" ]
It [looks like](https://github.com/ultralytics/yolov3/blob/master/models.py) in this case there can be a variable number of layers in this model. In the [paper](https://pjreddie.com/media/files/papers/YOLOv3.pdf) it says that Darknet53 has 53 layers. But in their [train.py](https://github.com/ultralytics/yolov3/blob/ma...
**YOLO v3** has 107 *layers* in total, you should also count *shortcut layers*, *route layers*, *upsample layers*, and *YOLO layers*(32 in total). So, there are 75+32=107 *layers* in total. When you see indexes in shortcut or *route layers*, you will find that we count from 0. Therefore, *yolo layers* are in 82,94,106 ...
54,948,738
I'm really confused with the architecture of yolov3. I've read the documentation and paper about it. Some people say that it has 103 convolutional layers, some others say that it has 53 layers. But when you count the convolutional layers in the .cfg file (after downloading it) it comes to about 75! ...What is missed he...
2019/03/01
[ "https://Stackoverflow.com/questions/54948738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8808347/" ]
According to AlexeyAB (creator of very popular forked Darknet version and creator of YOLO v4) <https://groups.google.com/forum/?nomobile=true#!topic/darknet/9WppEzRouMU> Yolo has 75 cnn-layers (convolutional layers) + 31 other layers (shortcut, route, upsample, yolo) = 106 layers in total. Remember that Yolo V3 d...
**YOLO v3** has 107 *layers* in total, you should also count *shortcut layers*, *route layers*, *upsample layers*, and *YOLO layers*(32 in total). So, there are 75+32=107 *layers* in total. When you see indexes in shortcut or *route layers*, you will find that we count from 0. Therefore, *yolo layers* are in 82,94,106 ...
9,501,158
I have a textbox that displays a placeholder text when the textbox is not in focus. When the focus is shifted to this textbox (by placing the cursor in the textbox), the placeholder text disappears and the cursor appears in the textbox. I am trying to automate a scenario which confirms this behavior. Has anybody ever t...
2012/02/29
[ "https://Stackoverflow.com/questions/9501158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1240434/" ]
You can get the placeholder text using the `getAttribute` method of webdriver. The HTML: ``` <input id="<ur id>" class="<ur class name>" type="password" lang="en" maxlength="30" placeholder="Enter Password" data-label="passwordPlaceholder" tabindex="5"> ``` The Java code: ``` String password=driver.findElement(By....
I've done similar tests. For our fields with placeholder text, the text appears in a placeholder attribute on the element. In Ruby, we use code like this: ``` element = @driver.find_element(*<locator string>*) expected_placeholder_text = element.attribute('placeholder') ``` That gives us a string that we compare ju...
9,501,158
I have a textbox that displays a placeholder text when the textbox is not in focus. When the focus is shifted to this textbox (by placing the cursor in the textbox), the placeholder text disappears and the cursor appears in the textbox. I am trying to automate a scenario which confirms this behavior. Has anybody ever t...
2012/02/29
[ "https://Stackoverflow.com/questions/9501158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1240434/" ]
I've done similar tests. For our fields with placeholder text, the text appears in a placeholder attribute on the element. In Ruby, we use code like this: ``` element = @driver.find_element(*<locator string>*) expected_placeholder_text = element.attribute('placeholder') ``` That gives us a string that we compare ju...
```java String Hinttext=Name.getAttribute("placeholder"); if(Hinttext.equals("Enter Your Name")) System.out.println("Correct Hinttext is shown ......PASSED"); else System.out.println("Correct Hinttext NOT is shown ......PASSED"); ```
9,501,158
I have a textbox that displays a placeholder text when the textbox is not in focus. When the focus is shifted to this textbox (by placing the cursor in the textbox), the placeholder text disappears and the cursor appears in the textbox. I am trying to automate a scenario which confirms this behavior. Has anybody ever t...
2012/02/29
[ "https://Stackoverflow.com/questions/9501158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1240434/" ]
You can get the placeholder text using the `getAttribute` method of webdriver. The HTML: ``` <input id="<ur id>" class="<ur class name>" type="password" lang="en" maxlength="30" placeholder="Enter Password" data-label="passwordPlaceholder" tabindex="5"> ``` The Java code: ``` String password=driver.findElement(By....
```java String Hinttext=Name.getAttribute("placeholder"); if(Hinttext.equals("Enter Your Name")) System.out.println("Correct Hinttext is shown ......PASSED"); else System.out.println("Correct Hinttext NOT is shown ......PASSED"); ```
45,974,279
I have this structure: ``` \ MySolution.sln Directory.Build.props (1) \src Directory.Build.props (2-src) \Project1 \Project2 \test Directory.Build.props (2-test) \Project1Tests \Project2Tests ``` I have common properties for all projects (1), common properties for src projects...
2017/08/31
[ "https://Stackoverflow.com/questions/45974279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7059613/" ]
You can work around it by using the folder name of the current file (`$(MSBuildThisFileDirectory)`): ``` <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" /> ``` This is required because relative paths are interpreted as relative to the project so just us...
Worked for me, with a minor improvement: ``` <PropertyGroup> <ParentDirectoryBuildPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))</ParentDirectoryBuildPropsPath> </PropertyGroup> <ImportGroup> <Import Project="$(ParentDirectoryBuildPropsPath)" /> </ImportGroup...
62,802,253
What is the best way to subtract or add values ​​from identical objects? ``` const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10, }; const obj2 = { 1: 30, 2: 30, 3: 30, 4: 30, }; const result = obj2 - obj1; console.log(result); /* the expected output is: { 1:20, 2: 20, 3: 20, 4: 20, }; */ `...
2020/07/08
[ "https://Stackoverflow.com/questions/62802253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12996445/" ]
You can [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) over [`Object.keys`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which provides the object's own property names and will not find keys from the prototype cha...
```js const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10, }; const obj2 = { 1: 30, 2: 30, 3: 30, 4: 30, }; const diff = (obj1, obj2) => { const result = Object.assign({}, obj1); Object.keys(result).forEach((key) => { result[key] -= obj2[key]; }); return result; } const result = diff(obj2, obj1); ...
62,802,253
What is the best way to subtract or add values ​​from identical objects? ``` const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10, }; const obj2 = { 1: 30, 2: 30, 3: 30, 4: 30, }; const result = obj2 - obj1; console.log(result); /* the expected output is: { 1:20, 2: 20, 3: 20, 4: 20, }; */ `...
2020/07/08
[ "https://Stackoverflow.com/questions/62802253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12996445/" ]
ESLint's warning means that with `in` you will also iterate properties on the object's prototype chain, not only the properties owned by the object. You could use `Object.entries` which only visits owned properties, and `Object.fromEntries` to build the result: ```js const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10 }; const...
```js const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10, }; const obj2 = { 1: 30, 2: 30, 3: 30, 4: 30, }; const diff = (obj1, obj2) => { const result = Object.assign({}, obj1); Object.keys(result).forEach((key) => { result[key] -= obj2[key]; }); return result; } const result = diff(obj2, obj1); ...
62,802,253
What is the best way to subtract or add values ​​from identical objects? ``` const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10, }; const obj2 = { 1: 30, 2: 30, 3: 30, 4: 30, }; const result = obj2 - obj1; console.log(result); /* the expected output is: { 1:20, 2: 20, 3: 20, 4: 20, }; */ `...
2020/07/08
[ "https://Stackoverflow.com/questions/62802253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12996445/" ]
ESLint's warning means that with `in` you will also iterate properties on the object's prototype chain, not only the properties owned by the object. You could use `Object.entries` which only visits owned properties, and `Object.fromEntries` to build the result: ```js const obj1 = { 1: 10, 2: 10, 3: 10, 4: 10 }; const...
You can [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) over [`Object.keys`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which provides the object's own property names and will not find keys from the prototype cha...
14,223,133
I have a web application on .NET4 and MVC3 (razor) . I want to handle my application errors in Global.asax. I have created application\_error function. I have noticed and found some errors. one of them returns this string in Application\_Error when I am trying to add break point on line `Response.Clear();` and that ...
2013/01/08
[ "https://Stackoverflow.com/questions/14223133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/966691/" ]
According to various information I have found [here](http://www.kenthouse.com/blog/2009/07/fun-with-flexigrids/) and a couple of other locations, flexigrid requires the XML to have specific format: ``` rows - the row definition page - the current page number total - the total count of rows in this collection row...
Guys have a look of this demo of flexiuigrid <http://flexidemo.ranjitjena.com/>
33,016,322
I have this simple LINQ query, which executes for 8395 ms: ``` var _context = new SurveyContext(); _context.Database.Log = Console.WriteLine; (from p in _context.Participants join row in _context.ListAnswerSelections on new {p.Id, QuestionId = 434} equals new {Id = row.RelatedParticipantId, QuestionId ...
2015/10/08
[ "https://Stackoverflow.com/questions/33016322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1242332/" ]
It looks like the delay is actually introduced by a double conversion (integer -> string -> integer). The property on your domain object is strongly typed as an integer (I assume). When the Linq query executes with the `.ToString` the field is converted from an integer to a string on the SQL server, that introduces a s...
### Update If you want it to be faster just cast it using (you may have to create a view model for that query) ``` select new { V = row.NumericValue as string}) ``` Instead of ``` select new { V = row.NumericValue.ToString() }) ``` When you call **Int32.ToString()** it calls Number.FormatInt32 from mscorlib. Ho...
33,016,322
I have this simple LINQ query, which executes for 8395 ms: ``` var _context = new SurveyContext(); _context.Database.Log = Console.WriteLine; (from p in _context.Participants join row in _context.ListAnswerSelections on new {p.Id, QuestionId = 434} equals new {Id = row.RelatedParticipantId, QuestionId ...
2015/10/08
[ "https://Stackoverflow.com/questions/33016322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1242332/" ]
So I ran the following two expressions through LINQPad on AdventureWorks to test out a theory: ``` from p in Persons join row in BusinessEntityAddresses on new {p.BusinessEntityID} equals new {row.BusinessEntityID} select new { V = row.ModifiedDate } ``` and ``` from p in Persons join row in BusinessEntityAddr...
### Update If you want it to be faster just cast it using (you may have to create a view model for that query) ``` select new { V = row.NumericValue as string}) ``` Instead of ``` select new { V = row.NumericValue.ToString() }) ``` When you call **Int32.ToString()** it calls Number.FormatInt32 from mscorlib. Ho...
33,016,322
I have this simple LINQ query, which executes for 8395 ms: ``` var _context = new SurveyContext(); _context.Database.Log = Console.WriteLine; (from p in _context.Participants join row in _context.ListAnswerSelections on new {p.Id, QuestionId = 434} equals new {Id = row.RelatedParticipantId, QuestionId ...
2015/10/08
[ "https://Stackoverflow.com/questions/33016322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1242332/" ]
So I ran the following two expressions through LINQPad on AdventureWorks to test out a theory: ``` from p in Persons join row in BusinessEntityAddresses on new {p.BusinessEntityID} equals new {row.BusinessEntityID} select new { V = row.ModifiedDate } ``` and ``` from p in Persons join row in BusinessEntityAddr...
It looks like the delay is actually introduced by a double conversion (integer -> string -> integer). The property on your domain object is strongly typed as an integer (I assume). When the Linq query executes with the `.ToString` the field is converted from an integer to a string on the SQL server, that introduces a s...
30,267,454
``` scala Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_79). Type in expressions to have them evaluated. Type :help for more information. scala> 300 to 1000 toSet warning: there were 1 feature warning(s); re-run with -feature for details res0: scala.collection.immutable.Set[Int] = Set(...
2015/05/15
[ "https://Stackoverflow.com/questions/30267454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1332911/" ]
Static blocks are executed when the class is loaded - if the class is reloaded for some reason (for example when it has been updated) it will be executed again. In your case it means that the `URLStreamHandlerFactory` you set the previous time it was loaded will remain. This isn't really an issue unless you've update...
AFAIK you can/should not restart the JVM. Furthermore, as you've already found out, you can't set `URLStreamHandlerFactory` twice in a JVM for a single application. Your application should try to set the factory only when it isn't: ``` try { URL.setURLStreamHandlerFactory(factory); } catch (Error e) { e.print...
19,317,148
If I had a better idea how to do this, I would have been more specific in the topic ;) I have a list of repetivite sequencial dates in column A, and the profit in column B. I'd like to analyse which sequencial 7 days have been the most profitable. ``` 01/01/2013 10 04/01/2013 15 08/01/2013 12 08/01/2013 ...
2013/10/11
[ "https://Stackoverflow.com/questions/19317148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2870775/" ]
Add two more columns `YEAR` and `WEEKNUM` in the same sheet and do a pivot ![enter image description here](https://i.stack.imgur.com/izxAr.jpg) Pivot : ![enter image description here](https://i.stack.imgur.com/gN94W.jpg)
I would start by getting rid of duplicate days from the left column by adding their profits together. Then perhaps you can apply some of the answers to this question: [How to find maximum of each subarray of some fixed given length in a given array](https://stackoverflow.com/questions/7065926/how-to-find-maximum-of-ea...
19,317,148
If I had a better idea how to do this, I would have been more specific in the topic ;) I have a list of repetivite sequencial dates in column A, and the profit in column B. I'd like to analyse which sequencial 7 days have been the most profitable. ``` 01/01/2013 10 04/01/2013 15 08/01/2013 12 08/01/2013 ...
2013/10/11
[ "https://Stackoverflow.com/questions/19317148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2870775/" ]
I found the solution was possible using the following code: =SUM(INDIRECT("$B$"&MATCH(A1,$A$1:$A$10,0)):INDIRECT("$B$"&MATCH(A1+6,$A$1:$A$10,1))) Using the MATCH function I was able to find the first CELL for the sale of the day (01/01/13), and then the CELL of the final sale of the day +6 days in (04/01/13) Then us...
I would start by getting rid of duplicate days from the left column by adding their profits together. Then perhaps you can apply some of the answers to this question: [How to find maximum of each subarray of some fixed given length in a given array](https://stackoverflow.com/questions/7065926/how-to-find-maximum-of-ea...
19,317,148
If I had a better idea how to do this, I would have been more specific in the topic ;) I have a list of repetivite sequencial dates in column A, and the profit in column B. I'd like to analyse which sequencial 7 days have been the most profitable. ``` 01/01/2013 10 04/01/2013 15 08/01/2013 12 08/01/2013 ...
2013/10/11
[ "https://Stackoverflow.com/questions/19317148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2870775/" ]
Add two more columns `YEAR` and `WEEKNUM` in the same sheet and do a pivot ![enter image description here](https://i.stack.imgur.com/izxAr.jpg) Pivot : ![enter image description here](https://i.stack.imgur.com/gN94W.jpg)
I found the solution was possible using the following code: =SUM(INDIRECT("$B$"&MATCH(A1,$A$1:$A$10,0)):INDIRECT("$B$"&MATCH(A1+6,$A$1:$A$10,1))) Using the MATCH function I was able to find the first CELL for the sale of the day (01/01/13), and then the CELL of the final sale of the day +6 days in (04/01/13) Then us...
63,388,179
Languages like Java, let you concatenate Strings using '+" operator. But as strings are immutable, they advise one to use StringBuilder for efficiency if one is going to repeatedly concatenate a string. What is the most efficient way to concatenate Strings in Dart ? <https://api.dart.dev/stable/2.9.1/dart-core/Strin...
2020/08/13
[ "https://Stackoverflow.com/questions/63388179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1266109/" ]
There are a number of ways to concatenate strings: * `String.operator +`: `string1 + string2`. This is the most straightforward. However, if you need to concatenate a lot of strings, using `+` repeatedly will create a lot of temporary objects, which is inefficient. (Also note that unlike other concatenation methods, `...
Here is what I understood: It appears that performance will vary depending on your use case. If you use StringBuffer, and intend to concatenate a very large string, then as the concatenation occurs only when you call toString, it is at that point where you get the "performance hit". But if you use "+", then each time...
16,093,255
``` #include <iostream> #include <string> #include "HashTable.h" using namespace std; struct MyStruct { string str; int num; bool operator ==( const MyStruct & r ) { return str == r.str; } }; const int SIZE1 = 97; int hash1( const MyStruct & obj ); int main( ) { HashTable<MyStruct> ht1( hash1, SIZE1 ); MyStruct m...
2013/04/18
[ "https://Stackoverflow.com/questions/16093255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2296918/" ]
``` template <class DataType> Array<DataType>::Array( int Size ) { if ( Size < 1 ) { capacity = 1; errorCode = 1; } else { capacity = Size; errorCode = 0; }//This is missing elements = new DataType [capacity]; } ``` Also using namespaces in headers is a bad idea.
In the implementation of the `Array( int Size )` constructor, the `else` case is missing it's closing brace `}`.
35,514,581
I am struggling with reading in a datetime string and storing it as a variable. I have a block of data that looks like this: ``` 2011-11-01 05:20:00 00:10:00 # z speed dir W sigW bck error 30 4.76 238.9 0.01 0.13 7.56E+06 0 40 5.24 237.1 -0.05 0.12 5.99E+06 0 50 6.33...
2016/02/19
[ "https://Stackoverflow.com/questions/35514581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5586573/" ]
Don't reinvent the wheel by making your own date parsing function. Utilize the `datetime.datetime.strptime` function from the standard lib. Pass the date string and the format of the string to the `strptime` function. ``` import datetime date_string = '2011-11-01 05:20:00' date_object = datetime.datetime.strptime(da...
You could simply get the datetime string ``` thestring = "2011-11-01 05:20:00 00:10:00"` ``` then convert to time ``` aa = thestring.split(" ") t =datetime.datetime.strptime(aa[0]+" "+aa[1], "%Y-%m-%d %H:%M:%S") ``` and finally access the hour, minutes, etc. E.g., t.hour
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
Always consult the documentation. The [SmptClient](http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx) has three constructors. ``` SmtpClient() SmtpClient(String) SmtpClient(String, Int32) ``` If you choose the last one, then your code would look like the following, for gmail: ``` SmtpClient c...
This is your `host` and optional `port`. For example: ``` SmtpClient client = new SmtpClient("mail.domain.com", 123); ``` For more information, you should read the MSDN documentation for this class: <http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx>
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
This is your `host` and optional `port`. For example: ``` SmtpClient client = new SmtpClient("mail.domain.com", 123); ``` For more information, you should read the MSDN documentation for this class: <http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx>
``` public SmtpClient( string host, int port ) ``` Basically you need to pass ***host-name*** and ***port-number*** Please read more about [SmtpClient Constructor](http://msdn.microsoft.com/en-us/library/67w4as51.aspx)
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
This is your `host` and optional `port`. For example: ``` SmtpClient client = new SmtpClient("mail.domain.com", 123); ``` For more information, you should read the MSDN documentation for this class: <http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx>
This is slightly off-topic, but supports a best practices approach relating to modern email delivery over SMTP... I would recommend always using a service that supports TLS over SSL as it provides more secure transmissions. If you're unfamiliar with TLS, @gideon provided an example of using TLS with GMail and here is...
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
Always consult the documentation. The [SmptClient](http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx) has three constructors. ``` SmtpClient() SmtpClient(String) SmtpClient(String, Int32) ``` If you choose the last one, then your code would look like the following, for gmail: ``` SmtpClient c...
``` public SmtpClient( string host, int port ) ``` Basically you need to pass ***host-name*** and ***port-number*** Please read more about [SmtpClient Constructor](http://msdn.microsoft.com/en-us/library/67w4as51.aspx)
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
Always consult the documentation. The [SmptClient](http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx) has three constructors. ``` SmtpClient() SmtpClient(String) SmtpClient(String, Int32) ``` If you choose the last one, then your code would look like the following, for gmail: ``` SmtpClient c...
You can specify the SMTP host and port in code as others have suggested. But if you're always using the same host and port, it's probably easier and more flexible to use the default `SmtpClient` constructor, and specify the host and port in [the `<smtp>` element of your application configuration file](http://msdn.micr...
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
Always consult the documentation. The [SmptClient](http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx) has three constructors. ``` SmtpClient() SmtpClient(String) SmtpClient(String, Int32) ``` If you choose the last one, then your code would look like the following, for gmail: ``` SmtpClient c...
This is slightly off-topic, but supports a best practices approach relating to modern email delivery over SMTP... I would recommend always using a service that supports TLS over SSL as it provides more secure transmissions. If you're unfamiliar with TLS, @gideon provided an example of using TLS with GMail and here is...
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
You can specify the SMTP host and port in code as others have suggested. But if you're always using the same host and port, it's probably easier and more flexible to use the default `SmtpClient` constructor, and specify the host and port in [the `<smtp>` element of your application configuration file](http://msdn.micr...
``` public SmtpClient( string host, int port ) ``` Basically you need to pass ***host-name*** and ***port-number*** Please read more about [SmtpClient Constructor](http://msdn.microsoft.com/en-us/library/67w4as51.aspx)
11,844,428
This is my first time to write a program that sends mails. I don't know what to put in the SMTP client constructor : ``` SmtpClient client = new SmtpClient(????); ``` Can anybody help?
2012/08/07
[ "https://Stackoverflow.com/questions/11844428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1555147/" ]
You can specify the SMTP host and port in code as others have suggested. But if you're always using the same host and port, it's probably easier and more flexible to use the default `SmtpClient` constructor, and specify the host and port in [the `<smtp>` element of your application configuration file](http://msdn.micr...
This is slightly off-topic, but supports a best practices approach relating to modern email delivery over SMTP... I would recommend always using a service that supports TLS over SSL as it provides more secure transmissions. If you're unfamiliar with TLS, @gideon provided an example of using TLS with GMail and here is...
24,226,700
Let's say I have a list of strings like this: ``` list1 = [ "filename1.txt", "file2.py", "fileexample.tiff" ] ``` How would I be able to grab all characters after the '.', if it's not too much to ask, by using "`for i in`" and have them come back in a list, like this: `['.txt','.py','.tiff']`
2014/06/15
[ "https://Stackoverflow.com/questions/24226700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3543987/" ]
``` import os for i in list1: fileName, fileExtension = os.path.splitext(i) print fileExtension ``` second one : ``` [i.split('.')[1] for i in list1] ```
``` map(lambda s:s.rsplit(".",1)[-1],my_list) ``` is probably how I would do it which just splits from the right side exactly once on a period ... and gets whatever is on the right hand side for each item in the list
24,226,700
Let's say I have a list of strings like this: ``` list1 = [ "filename1.txt", "file2.py", "fileexample.tiff" ] ``` How would I be able to grab all characters after the '.', if it's not too much to ask, by using "`for i in`" and have them come back in a list, like this: `['.txt','.py','.tiff']`
2014/06/15
[ "https://Stackoverflow.com/questions/24226700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3543987/" ]
If you are dealing with filepaths, then you should use the `os.path` module ``` import os.path list1 = ["filename1.txt","file2.py","fileexample.tiff"] print [os.path.splitext(f)[1] for f in list1] ``` prints ``` ['.txt', '.py', '.tiff'] ```
``` map(lambda s:s.rsplit(".",1)[-1],my_list) ``` is probably how I would do it which just splits from the right side exactly once on a period ... and gets whatever is on the right hand side for each item in the list
7,671
I'm seeking a timeline of classic (Greek/Latin) grammarians/grammar books. The timeline could either be a graphical one or a textual listing (like [this one](https://en.wikipedia.org/wiki/History_of_English_grammars#Timeline_of_English_grammars) for the English language). Most favorable is an annotated bibliography wi...
2018/12/07
[ "https://latin.stackexchange.com/questions/7671", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/3178/" ]
You can compose your own from Wikipedia <https://en.wikipedia.org/wiki/Category:Grammarians_of_Latin> but it is as you say **a bit indigestible** even in chronological sequence: Antonius Rufus (grammarian) (Dionysius Thrax Τέχνη γραμματική 150 BC) Lucius Aelius Stilo Praeconinus Philologist 100BC Marcus Fabius **Quin...
To build your library of grammarians here is: **Alexandre de Villedieu** (born around 1175) Grammar Leonine (internally rhymed hexameter) grammar derived from Priscian (Priscianus caesariensis ( fl. AD 500)), and Donatus, Aelius Donatus (fl. mid-fourth century AD) *not Priscian of Lydia (Priscianus Lydus; fl. 6th ce...
41,532,331
For getting a `MediaControllerCompat` instance I'm using `getSupportMediaController()` in `FragmentActivity`. But this method is deprecated. Which method do I have to use instead of this method?
2017/01/08
[ "https://Stackoverflow.com/questions/41532331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2976830/" ]
Just check the Android official docs .. <https://developer.android.com/reference/android/support/v4/app/FragmentActivity.html> It tells you everything. According to Android Developer documentation : > > This method is deprecated.Use getMediaController() instead. > This API will be removed in a future release. >...
If you still want a MediaControllerCompat instance there is a way to get it since `getMediaController()` doesn't return the compatibility version of this class: ``` MediaControllerCompat.getMediaController(activity) ``` I found this info in the Revision 26.0.0 Beta 1 of Support Library changelog: > > FragmentActiv...
36,475,345
I have this Layout. ``` <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_paren...
2016/04/07
[ "https://Stackoverflow.com/questions/36475345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6064672/" ]
Tell me if you have any question, ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:tools="http://...
Use RecyclerView and set Layout Manager as GridLayoutManager. Here's the xml ``` <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Though this question is a bit old, I ran into this problem too. First of all, Tomcat's behavior is absolutely correct. This is per Servlet Spec. One should not alter Tomcat's behavior against the spec. As Heikki Vesalainen and mrCoder mentioned, use `setStatus` and `setStatus` only. To whom it may concern, I have rais...
Why not just configure the `<error-page>` element with an empty HTML page?
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Although it's Servlet spec compliant, for security reasons I don't want tomcat or any other Servlet container to send error details. I struggled with this as well a bit. After searching and trying, the solution can be summed up as: 1. as others mentioned, don't use `sendError()`, use `setStatus()` instead ([in Jersey ...
### Configure `<error-page>` Elements in `web.xml` Edit `$CATALINA_HOME/conf/web.xml`, add at the end the following `<error-page>`, save and restart tomcat ``` <web-app> ... ... ... <error-page> <error-code>404</error-code> <location>/404.html</location> </error-page> <error-page> ...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Although this doesn't respond exactly to the "not send anything" statement on the question, and on the wave of [Clive Evans' answer](https://stackoverflow.com/a/8166149/1504300), I found out that in tomcat you can make those too much verbose texts go away from error pages without creating a custom ErrorReportValve. Yo...
The quick, slightly dirty, but easy way of stopping Tomcat from sending any error body is to call setErrorReportValveClass against the tomcat host, with a custom error report valve which overrides report to do nothing. ie: ``` public class SecureErrorReportValve extends ErrorReportValve { @Override protected void rep...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Although this doesn't respond exactly to the "not send anything" statement on the question, and on the wave of [Clive Evans' answer](https://stackoverflow.com/a/8166149/1504300), I found out that in tomcat you can make those too much verbose texts go away from error pages without creating a custom ErrorReportValve. Yo...
As Heikki said, setting the status instead of `sendError()` causes the Tomcat not touch the response entity/body/payload. If you only want to send the response headers without any entity, like in my case, ``` response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.setContentLength(0); ``` does the trick. ...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Although it's Servlet spec compliant, for security reasons I don't want tomcat or any other Servlet container to send error details. I struggled with this as well a bit. After searching and trying, the solution can be summed up as: 1. as others mentioned, don't use `sendError()`, use `setStatus()` instead ([in Jersey ...
Though this question is a bit old, I ran into this problem too. First of all, Tomcat's behavior is absolutely correct. This is per Servlet Spec. One should not alter Tomcat's behavior against the spec. As Heikki Vesalainen and mrCoder mentioned, use `setStatus` and `setStatus` only. To whom it may concern, I have rais...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
Although this doesn't respond exactly to the "not send anything" statement on the question, and on the wave of [Clive Evans' answer](https://stackoverflow.com/a/8166149/1504300), I found out that in tomcat you can make those too much verbose texts go away from error pages without creating a custom ErrorReportValve. Yo...
### Configure `<error-page>` Elements in `web.xml` Edit `$CATALINA_HOME/conf/web.xml`, add at the end the following `<error-page>`, save and restart tomcat ``` <web-app> ... ... ... <error-page> <error-code>404</error-code> <location>/404.html</location> </error-page> <error-page> ...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
If you do not want tomcat to show an error page, then do not use sendError(...). Instead use setStatus(...). e.g. if you want to give a 405 response, then you do ``` response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); response.getWriter().println("The method " + request.getMethod() + " is not su...
Though this question is a bit old, I ran into this problem too. First of all, Tomcat's behavior is absolutely correct. This is per Servlet Spec. One should not alter Tomcat's behavior against the spec. As Heikki Vesalainen and mrCoder mentioned, use `setStatus` and `setStatus` only. To whom it may concern, I have rais...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
The quick, slightly dirty, but easy way of stopping Tomcat from sending any error body is to call setErrorReportValveClass against the tomcat host, with a custom error report valve which overrides report to do nothing. ie: ``` public class SecureErrorReportValve extends ErrorReportValve { @Override protected void rep...
Although it's Servlet spec compliant, for security reasons I don't want tomcat or any other Servlet container to send error details. I struggled with this as well a bit. After searching and trying, the solution can be summed up as: 1. as others mentioned, don't use `sendError()`, use `setStatus()` instead ([in Jersey ...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
If you do not want tomcat to show an error page, then do not use sendError(...). Instead use setStatus(...). e.g. if you want to give a 405 response, then you do ``` response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); response.getWriter().println("The method " + request.getMethod() + " is not su...
### Configure `<error-page>` Elements in `web.xml` Edit `$CATALINA_HOME/conf/web.xml`, add at the end the following `<error-page>`, save and restart tomcat ``` <web-app> ... ... ... <error-page> <error-code>404</error-code> <location>/404.html</location> </error-page> <error-page> ...
794,329
By default, Tomcat sends some HTML content back to the client if it encounters something like an HTTP 404. I know that via `web.xml` an `<error-page>` [can be configured](http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6) to customize this content. However, I'd just like for Tomcat to **not send anything** in terms o...
2009/04/27
[ "https://Stackoverflow.com/questions/794329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29995/" ]
The quick, slightly dirty, but easy way of stopping Tomcat from sending any error body is to call setErrorReportValveClass against the tomcat host, with a custom error report valve which overrides report to do nothing. ie: ``` public class SecureErrorReportValve extends ErrorReportValve { @Override protected void rep...
Why not just configure the `<error-page>` element with an empty HTML page?
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
**Update** This problem can now be solved by simply updating to OpenCV v4.5 and above. If upgrading is a problem follow the old answer, below. --- For anyone still looking into this, I was just stuck on the same problem. Turns out some Android phones and iPhones take images/frames in landscape and convert them on t...
The rotate tag is optional so the check\_rotation will fail, This code fix it: ``` def check_rotation(path_video_file): # this returns meta-data of the video file in form of a dictionary meta_dict = ffmpeg.probe(path_video_file) # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key ...
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
**Update** This problem can now be solved by simply updating to OpenCV v4.5 and above. If upgrading is a problem follow the old answer, below. --- For anyone still looking into this, I was just stuck on the same problem. Turns out some Android phones and iPhones take images/frames in landscape and convert them on t...
I would just do this in your frame processing loop: ``` frame = cv2.flip(frame,0) ``` The 0 flips vertically, see Open CV documentation for more info.
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
**Update** This problem can now be solved by simply updating to OpenCV v4.5 and above. If upgrading is a problem follow the old answer, below. --- For anyone still looking into this, I was just stuck on the same problem. Turns out some Android phones and iPhones take images/frames in landscape and convert them on t...
Sometimes the following will solve the problem of opening some videos upside-down. ``` cap = cv2.VideoCapture(path, apiPreference=cv2.CAP_MSMF) ```
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
**Update** This problem can now be solved by simply updating to OpenCV v4.5 and above. If upgrading is a problem follow the old answer, below. --- For anyone still looking into this, I was just stuck on the same problem. Turns out some Android phones and iPhones take images/frames in landscape and convert them on t...
When I recently ran into this issue, I found that all that was required was to update to OpenCV v4.5: * This is the related Github issue: <https://github.com/opencv/opencv/issues/15499> * Here is the commit: <https://github.com/opencv/opencv/commit/f0271e54d90b3af62301f531f5f00995b00d7cd6>
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
The rotate tag is optional so the check\_rotation will fail, This code fix it: ``` def check_rotation(path_video_file): # this returns meta-data of the video file in form of a dictionary meta_dict = ffmpeg.probe(path_video_file) # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key ...
I would just do this in your frame processing loop: ``` frame = cv2.flip(frame,0) ``` The 0 flips vertically, see Open CV documentation for more info.
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
Sometimes the following will solve the problem of opening some videos upside-down. ``` cap = cv2.VideoCapture(path, apiPreference=cv2.CAP_MSMF) ```
The rotate tag is optional so the check\_rotation will fail, This code fix it: ``` def check_rotation(path_video_file): # this returns meta-data of the video file in form of a dictionary meta_dict = ffmpeg.probe(path_video_file) # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key ...
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
When I recently ran into this issue, I found that all that was required was to update to OpenCV v4.5: * This is the related Github issue: <https://github.com/opencv/opencv/issues/15499> * Here is the commit: <https://github.com/opencv/opencv/commit/f0271e54d90b3af62301f531f5f00995b00d7cd6>
The rotate tag is optional so the check\_rotation will fail, This code fix it: ``` def check_rotation(path_video_file): # this returns meta-data of the video file in form of a dictionary meta_dict = ffmpeg.probe(path_video_file) # from the dictionary, meta_dict['streams'][0]['tags']['rotate'] is the key ...
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
Sometimes the following will solve the problem of opening some videos upside-down. ``` cap = cv2.VideoCapture(path, apiPreference=cv2.CAP_MSMF) ```
I would just do this in your frame processing loop: ``` frame = cv2.flip(frame,0) ``` The 0 flips vertically, see Open CV documentation for more info.
53,097,093
I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1. I checked the network, and people say I can just change the **Target Framework** value in the project's properties page. But on my computer, I cannot see options for NetCore. [![enter image description here](h...
2018/11/01
[ "https://Stackoverflow.com/questions/53097093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309830/" ]
When I recently ran into this issue, I found that all that was required was to update to OpenCV v4.5: * This is the related Github issue: <https://github.com/opencv/opencv/issues/15499> * Here is the commit: <https://github.com/opencv/opencv/commit/f0271e54d90b3af62301f531f5f00995b00d7cd6>
I would just do this in your frame processing loop: ``` frame = cv2.flip(frame,0) ``` The 0 flips vertically, see Open CV documentation for more info.
37,011,446
My goal is to use a Hash with a default value as a class constant. To do this it seems to me that I must initialise a Hash in one line as a constant with pre-defined value and a default value. According to the Ruby documentation, I can set a default value in two way : * In the constructor then by adding value as foll...
2016/05/03
[ "https://Stackoverflow.com/questions/37011446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2519059/" ]
You can use `update`: ``` MY_HASH = Hash.new(-1).update(1 => 0, 2 => 42) MY_HASH[1] #=> 0 MY_HASH[52] #=> -1 ``` Or you can use `Hash#merge`.
Here are two other solutions. ``` MY_HASH = { 1=>0, 2=>42 }.tap { |h| h.default = -1 } ``` ``` MY_HASH[1] #=> 0 MY_HASH[529326] #=> -1 ``` --- ``` MY_HASH = ->(key) { { 1=>0, 2=>42 }.fetch(key, -1) } ``` ``` MY_HASH[1] #=> 0 MY_HASH[529326] #=> -1 ```
59,877,721
In the Clarity Components documentation there is a working example for "Dimissing labels", but unfortunately there is no example code for this case. See <https://v2.clarity.design/labels> The documentation says - A label can be dismissed. Use a close icon at the right-most side of a label to dismiss it. How do I cre...
2020/01/23
[ "https://Stackoverflow.com/questions/59877721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12764377/" ]
> > I am trying to run **activator clean compile** command to setup play framework project on my local machine > > > I [EOLed](https://www.lightbend.com/blog/introducing-a-new-way-to-get-started-with-lightbend-technologies-and-saying-goodbye-to-activator) Activator in 2017. Please use the latest distribution of [s...
This is happening because the maven.org repository is no longer accepting http requests (as of 15th Jan) and unfortunately play 2.3.0 is configured to use http. The solution would be to replace the http call with a https variant, but I have no idea where that call is or how to change it. I've also tried adding resolv...
59,877,721
In the Clarity Components documentation there is a working example for "Dimissing labels", but unfortunately there is no example code for this case. See <https://v2.clarity.design/labels> The documentation says - A label can be dismissed. Use a close icon at the right-most side of a label to dismiss it. How do I cre...
2020/01/23
[ "https://Stackoverflow.com/questions/59877721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12764377/" ]
Looks like it was the version of sbt I was running (0.13.0) which contained the problematic `http` maven repository reference. Try changing the following line in your build.properties: ``` sbt.version=0.13.18 ``` If you're just starting out, I'd also recommend starting on a later version of Play Framework. The cur...
This is happening because the maven.org repository is no longer accepting http requests (as of 15th Jan) and unfortunately play 2.3.0 is configured to use http. The solution would be to replace the http call with a https variant, but I have no idea where that call is or how to change it. I've also tried adding resolv...
59,877,721
In the Clarity Components documentation there is a working example for "Dimissing labels", but unfortunately there is no example code for this case. See <https://v2.clarity.design/labels> The documentation says - A label can be dismissed. Use a close icon at the right-most side of a label to dismiss it. How do I cre...
2020/01/23
[ "https://Stackoverflow.com/questions/59877721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12764377/" ]
Looks like it was the version of sbt I was running (0.13.0) which contained the problematic `http` maven repository reference. Try changing the following line in your build.properties: ``` sbt.version=0.13.18 ``` If you're just starting out, I'd also recommend starting on a later version of Play Framework. The cur...
> > I am trying to run **activator clean compile** command to setup play framework project on my local machine > > > I [EOLed](https://www.lightbend.com/blog/introducing-a-new-way-to-get-started-with-lightbend-technologies-and-saying-goodbye-to-activator) Activator in 2017. Please use the latest distribution of [s...
50,898,930
I'm trying to create a ruby script but I'm struggling on how to proceed. The goal of my script is, from 2 subtitles files, I want to make a 3rd file by combining the time of the first file with the subtitles of the 2nd. I don't know if I'm clear, basically, my 2 subtitles files are **the same**, but the version is di...
2018/06/17
[ "https://Stackoverflow.com/questions/50898930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9213377/" ]
You have a couple problems. 1. Your regex doesn't match the whole line, you need to add `(\D+)` to account for the phrase coming after the numbers. 2. You want to loop through both files concurrently; this is easily accomplished using `loop do` with [`gets`](http://ruby-doc.org/core-2.5.1/IO.html#method-i-gets). With...
This is a more Ruby-like way to perform the desired substitutions. **Code** ``` def substitute(french_fname, english_fname) r = /^\d{2}:\d{2}:\d{2},\d{3} --> \d{2}:\d{2}:\d{2},\d{3}$/ english_lines = File.read(ENGLISH_FNAME).scan(r) File.read(FRENCH_FNAME).gsub(r) { english_lines.shift } end ``` **Example** ...
113,222
We are planning for a penetration testing for our network and application. What should be shared with the penetration tester? For example, should we share the topology of our network? Should we provide descriptions of our servers? Will the testers need to have remote access to any of our servers? Will they need to vi...
2016/02/09
[ "https://security.stackexchange.com/questions/113222", "https://security.stackexchange.com", "https://security.stackexchange.com/users/99799/" ]
I'm guessing given that you've asked this question twice you're not able/planning to provide the additional details, but a comments too short to explain the problem with your question, so here's some more information untill this one gets closed :) Your question is essentially unanswerable. The reason for this is that ...
This could be opinion based and up to the agreed upon scope of work. If you don't want to share information just make sure both parties know that before a contract or scope is defined and signed. However here are a few scenarios that I see my company doing. White Hat --------- This is a full assessment with access to...
988
My question: [Is it possible to permanently turn off YouTube annotations?](https://webapps.stackexchange.com/questions/20469/is-it-possible-to-permanently-turn-off-youtube-annotations) Supposed dupe: [How can I permanently disable video annotations on YouTube?](https://webapps.stackexchange.com/questions/9020/how-to...
2011/11/07
[ "https://webapps.meta.stackexchange.com/questions/988", "https://webapps.meta.stackexchange.com", "https://webapps.meta.stackexchange.com/users/121/" ]
I could see how users may have thought that it was a duplicate. But in reality, this is a bug so in the end you may end up having to get an extension to fix this until YouTube actually addresses it. I have reopened the question. **Edit:** After discussing with another mod, it was decided that there is nothing that sup...
Your post has been reopened. These things do happen from time to time. Someone will propose the duplicate and others will agree (possibly without reading either question properly). You need to bring this to our attention by commenting on the question, flagging it or asking a question here on meta - as you have done. ...
17,078,864
I have a Label and a Progess Indicator in my Vaadin indicator. It is dynamically made visible in the UI. There is a Tree below this Progress Indicator. When the program dynamically sets the visibility of the Progress Indicator to true, the tree shifts down and the UI shakes due to the shifting. Is there any way to m...
2013/06/13
[ "https://Stackoverflow.com/questions/17078864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1014830/" ]
Finally I got an answer to my question. I just replaced the invisible components with a dummy visible label with no text. And used it alternatively to switch between visible and invisible. I [asked the question in the Vaadin forum](https://vaadin.com/forum#!/thread/3398357), and here's the response I got, from [Kim L...
Use this following example to the component you want set invisible but keeping its occupied space: ``` Image home = new Image(); home.setSource(HOME); home.addStyleName("visibility: hidden"); ``` OR ``` home.addStyleName("visibility: collapse"); ```
9,067,819
Already declared is an array such as: ``` char ma[10][20]; ``` The address of a specific element is gotten using: ``` p = &ma[1][18]; ``` Which element will `p` point to after `p++;` ?
2012/01/30
[ "https://Stackoverflow.com/questions/9067819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058653/" ]
Adding 1 to a address of member of array, get the address of the next member. since p is the address of `ma[1][18]`, which is member of the array `ma[1]`, `p+1` is the address of `ma[1][19]`. (And of course, `p++;` is like `p=p+1;`) Edit: I assumed, of course, that p is `char*`. If it's something else, the answer can ...
`p++` yields `&ma[1][19]` Here is the explanation: ``` char ma[10][20]; char *p = &ma[1][18]; ``` `p` value is `&ma[1][18]` which is equal to `*(ma + 1) + 18`. So `p++` value which is equal to `p + 1` is equal to `(*(ma + 1) + 18) + 1` equal to `*(ma + 1) + 19` which is equal to `&ma[1][19]`.
9,067,819
Already declared is an array such as: ``` char ma[10][20]; ``` The address of a specific element is gotten using: ``` p = &ma[1][18]; ``` Which element will `p` point to after `p++;` ?
2012/01/30
[ "https://Stackoverflow.com/questions/9067819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058653/" ]
Adding 1 to a address of member of array, get the address of the next member. since p is the address of `ma[1][18]`, which is member of the array `ma[1]`, `p+1` is the address of `ma[1][19]`. (And of course, `p++;` is like `p=p+1;`) Edit: I assumed, of course, that p is `char*`. If it's something else, the answer can ...
You don't specify the type of `p`; assuming it's `char *`, then `p++` will advance it to `ma[1][19]` (1 char). Here are a couple of variations: ``` char (*p)[20] = &ma[1]; ``` In this case, `p` is a pointer to a 20-element array of `char`, initialized to point to `ma[1]`; executing `p++` will advance `p` to point ...
9,067,819
Already declared is an array such as: ``` char ma[10][20]; ``` The address of a specific element is gotten using: ``` p = &ma[1][18]; ``` Which element will `p` point to after `p++;` ?
2012/01/30
[ "https://Stackoverflow.com/questions/9067819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058653/" ]
`p++` yields `&ma[1][19]` Here is the explanation: ``` char ma[10][20]; char *p = &ma[1][18]; ``` `p` value is `&ma[1][18]` which is equal to `*(ma + 1) + 18`. So `p++` value which is equal to `p + 1` is equal to `(*(ma + 1) + 18) + 1` equal to `*(ma + 1) + 19` which is equal to `&ma[1][19]`.
You don't specify the type of `p`; assuming it's `char *`, then `p++` will advance it to `ma[1][19]` (1 char). Here are a couple of variations: ``` char (*p)[20] = &ma[1]; ``` In this case, `p` is a pointer to a 20-element array of `char`, initialized to point to `ma[1]`; executing `p++` will advance `p` to point ...
20,739,000
split string only when two or more spaces occurs. ``` string="Talk Talk Walk Walk sell sell"; ``` Expected Result after split: ``` string[0]='Talk Talk'; string[1]='Walk Walk'; string[2]='sell sell'; ``` Thanks
2013/12/23
[ "https://Stackoverflow.com/questions/20739000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1027302/" ]
You can use the regular expression `/\s{2,}/`, which means that, if there are 2 or more white space characters, split the string there. ``` myString="Talk Talk Walk Walk sell sell"; console.log(myString.split(/\s{2,}/)); ``` **Output** ``` [ 'Talk Talk', 'Walk Walk', 'sell sell' ] ```
Try this if not using RegEx. ``` var myString = "Talk Talk Walk Walk sell sell"; var result = myString.split(" "); for (var i = result.length - 1; i >= 0; i--) { if (result[i] === "") { result.splice(i, 1); } } ``` The result variable will have an array of split values.
20,739,000
split string only when two or more spaces occurs. ``` string="Talk Talk Walk Walk sell sell"; ``` Expected Result after split: ``` string[0]='Talk Talk'; string[1]='Walk Walk'; string[2]='sell sell'; ``` Thanks
2013/12/23
[ "https://Stackoverflow.com/questions/20739000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1027302/" ]
You can use the regular expression `/\s{2,}/`, which means that, if there are 2 or more white space characters, split the string there. ``` myString="Talk Talk Walk Walk sell sell"; console.log(myString.split(/\s{2,}/)); ``` **Output** ``` [ 'Talk Talk', 'Walk Walk', 'sell sell' ] ```
Try this: ``` var str="Talk Talk Walk Walk sell sell"; var s = str.replace(/ {2,}/g,";").split(';'); ```
20,739,000
split string only when two or more spaces occurs. ``` string="Talk Talk Walk Walk sell sell"; ``` Expected Result after split: ``` string[0]='Talk Talk'; string[1]='Walk Walk'; string[2]='sell sell'; ``` Thanks
2013/12/23
[ "https://Stackoverflow.com/questions/20739000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1027302/" ]
You can use the regular expression `/\s{2,}/`, which means that, if there are 2 or more white space characters, split the string there. ``` myString="Talk Talk Walk Walk sell sell"; console.log(myString.split(/\s{2,}/)); ``` **Output** ``` [ 'Talk Talk', 'Walk Walk', 'sell sell' ] ```
**Try this simple way:** ``` var x = str.split(" +"); ```
142,189
My 2-years old CO detector (small, wall-mounted device with battery, no other power source) started beeping every morning for at least few minutes, sending sharp chirps once every 10 sec. It starts around 6am. I don't see any visible fire or cooking in my apartment or outside. [I've read](https://arstechnica.com/civis...
2018/07/13
[ "https://diy.stackexchange.com/questions/142189", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/87726/" ]
If your CO detector were actually detecting CO, it would not chirp. It would sound a continuous, and very, VERY loud alarm you would definitely recognize. The chirping is a universal (as far as I know) method for indicating that it's time to change the battery. This is true for CO and smoke detectors.
It's normal for gas and smoke detector batteries to indicate impending failure during the coolest part of the day. The chemical reaction that produces the electrical current is reduced by low temperatures. It's a common occurrence in cold climates, especially in the case of vacation homes that are kept at lower tempera...
142,189
My 2-years old CO detector (small, wall-mounted device with battery, no other power source) started beeping every morning for at least few minutes, sending sharp chirps once every 10 sec. It starts around 6am. I don't see any visible fire or cooking in my apartment or outside. [I've read](https://arstechnica.com/civis...
2018/07/13
[ "https://diy.stackexchange.com/questions/142189", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/87726/" ]
It's normal for gas and smoke detector batteries to indicate impending failure during the coolest part of the day. The chemical reaction that produces the electrical current is reduced by low temperatures. It's a common occurrence in cold climates, especially in the case of vacation homes that are kept at lower tempera...
A low battery is the most common cause of seemingly-random chirps in smoke and CO detectors. Detector end of life is probably the second most common cause. How old is the CO detector? Their lifetime is somewhere in the range of 5-10 years, depending on the make/model ([source](https://www.kidde.com/home-safety/en/us/s...
142,189
My 2-years old CO detector (small, wall-mounted device with battery, no other power source) started beeping every morning for at least few minutes, sending sharp chirps once every 10 sec. It starts around 6am. I don't see any visible fire or cooking in my apartment or outside. [I've read](https://arstechnica.com/civis...
2018/07/13
[ "https://diy.stackexchange.com/questions/142189", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/87726/" ]
It's normal for gas and smoke detector batteries to indicate impending failure during the coolest part of the day. The chemical reaction that produces the electrical current is reduced by low temperatures. It's a common occurrence in cold climates, especially in the case of vacation homes that are kept at lower tempera...
If the battery were failing, it would not chirp at the same time every day, it would chirp and continue chirping all day. Having said that, if it's easy, and it should be, replace the battery. If it still chirps - at the same time every day- you can rule out battery. this is the first step. The next step is to look o...
142,189
My 2-years old CO detector (small, wall-mounted device with battery, no other power source) started beeping every morning for at least few minutes, sending sharp chirps once every 10 sec. It starts around 6am. I don't see any visible fire or cooking in my apartment or outside. [I've read](https://arstechnica.com/civis...
2018/07/13
[ "https://diy.stackexchange.com/questions/142189", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/87726/" ]
It's normal for gas and smoke detector batteries to indicate impending failure during the coolest part of the day. The chemical reaction that produces the electrical current is reduced by low temperatures. It's a common occurrence in cold climates, especially in the case of vacation homes that are kept at lower tempera...
Volunteer firefighter here who has seen many a CO detector malfunction.. I think the answers here are spot on but I'll just add on: 1. Some CO detectors, when set off, sounds like a BEEP-BEEP-BEEP then a pause and it continues with the series of beeps, etc. They're loud but not as loud as a commercial fire alarm in s...