qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
26,310,036 | I have a following format of data
```
....
16 4 2 5 23 0 0 0 0
17 3 2 270 6 0 0 0 0
18 3 2 52 332 0 0 0 0
19 3 2 125 159 0 0 0 0
20 3 2 156 56 ... | 2014/10/11 | [
"https://Stackoverflow.com/questions/26310036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1798797/"
] | `count` is a method for an iterable. I suspect you want:
```
In [46]: B = [1,2,3,4,5]
In [47]: B.count(2)
Out[47]: 1
```
This is assuming that `B` is the column you are looking for. If you have something like this:
```
In [48]: B = [[1,2,3,4], [4,3,2,1], [7,8,9,10]]
```
Then, indexing that will give you a row n... | So apparently B is a list of numbers. So you don't want to loop at all. Just do:
```
B.count(7)
``` |
509,905 | I have a .NET web service which is publically accessible since it needs to be accessible via [Flex](http://www.adobe.com/products/flex/). It currently only has read operations.
>
> <http://www.example.com/webservices/weather.asmx?wsdl>
>
>
>
I want to add some admin only web methods to the same webservice such as... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16940/"
] | One thing you could do is expose another endpoint for the admin contract. Then turn off the WSDL publisher on that admin endpoint. Eventually you could configure security just on the administrative endpoint if you wanted.
This is assuming you are using WCF.
**Update:** Check out this [WCF getting started tutorial](ht... | why won't you just create another web service? Seems simpler |
509,905 | I have a .NET web service which is publically accessible since it needs to be accessible via [Flex](http://www.adobe.com/products/flex/). It currently only has read operations.
>
> <http://www.example.com/webservices/weather.asmx?wsdl>
>
>
>
I want to add some admin only web methods to the same webservice such as... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16940/"
] | why won't you just create another web service? Seems simpler | For update references, you could use your development server.
The production server cannot expose wsdl docs unless you provide public access.
Or, if you have access to the wcf assembly, you can use svcutil against the wcf assembly. This will generate language code to be used in your application.
If you really, really... |
509,905 | I have a .NET web service which is publically accessible since it needs to be accessible via [Flex](http://www.adobe.com/products/flex/). It currently only has read operations.
>
> <http://www.example.com/webservices/weather.asmx?wsdl>
>
>
>
I want to add some admin only web methods to the same webservice such as... | 2009/02/04 | [
"https://Stackoverflow.com/questions/509905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16940/"
] | One thing you could do is expose another endpoint for the admin contract. Then turn off the WSDL publisher on that admin endpoint. Eventually you could configure security just on the administrative endpoint if you wanted.
This is assuming you are using WCF.
**Update:** Check out this [WCF getting started tutorial](ht... | For update references, you could use your development server.
The production server cannot expose wsdl docs unless you provide public access.
Or, if you have access to the wcf assembly, you can use svcutil against the wcf assembly. This will generate language code to be used in your application.
If you really, really... |
4,781,139 | I want to fetch the places of 20 meters using current latitude and longitude and display in list(without showing in google map).
Please help me. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4781139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/437833/"
] | This is a typical application for a [quadtree](http://en.wikipedia.org/wiki/Quadtree). The quadtree facilitates lookup of the m points lying in your rectangle in O(log(n) + m), where n is the total number of points.
Edit: Your approach using the map is not nearly as efficient. For randomly distributed points, it would... | How about you store the points as a simple 2 dimensional array of pointers to those structs, and when you need to find a point x,y it's a simple index operation. The same goes for any other points (x+a,y+b). |
4,781,139 | I want to fetch the places of 20 meters using current latitude and longitude and display in list(without showing in google map).
Please help me. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4781139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/437833/"
] | This is a typical application for a [quadtree](http://en.wikipedia.org/wiki/Quadtree). The quadtree facilitates lookup of the m points lying in your rectangle in O(log(n) + m), where n is the total number of points.
Edit: Your approach using the map is not nearly as efficient. For randomly distributed points, it would... | If you use a std::map of points the lookup will always be O(log N) where N is the number of points you have.
Your other option would be to divide your search space into buckets and put your point into buckets. You then calculate in your rectangle:
* any buckets for which all the points are inside your rectangle
* any... |
4,781,139 | I want to fetch the places of 20 meters using current latitude and longitude and display in list(without showing in google map).
Please help me. | 2011/01/24 | [
"https://Stackoverflow.com/questions/4781139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/437833/"
] | This is a typical application for a [quadtree](http://en.wikipedia.org/wiki/Quadtree). The quadtree facilitates lookup of the m points lying in your rectangle in O(log(n) + m), where n is the total number of points.
Edit: Your approach using the map is not nearly as efficient. For randomly distributed points, it would... | The first observation would be that `std::map` wouldn't be the most efficient structure in any case. Your input is pretty much fixed, apparently (from the comments). In that case, `std::binary_search` on a sorted `std::vector` is more efficient. The main benefit of `std::map` over a sorted `std::vector` is that inserti... |
21,632,453 | I have a table with data that is updated every 5 minutes.
```
| TimeStamp | Data |
| 1 | 2 |
| 2 | 8 |
| 3 | 16 |
```
How can I select this data in such a way that it does not show the data, but the difference between the last timestamp, like this:
```
| TimeStamp | Data |
| 1 ... | 2014/02/07 | [
"https://Stackoverflow.com/questions/21632453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/492538/"
] | As of version 1.4.13 FabricJs support image resize filters.
The resize filter can be used in 2 ways:
>
> -Static resize on load with fixed scale
>
>
> -Dynamic resize on scaling the image object by code o by mouse drags.
>
>
>
There are 4 filters implemented as of now:
>
> -SliceHack , not really a filter bu... | If you want to set the width to 1500, then below code can be used for rezise. It worked for me. Image looks normal.
```
var scale = 1500 / oImg.getWidth();
var newWidth = oImg.getWidth() * scale;
var newHeight = oImg.getHeight() * scale;
oImg.set({width : newWidth, height : newHeight});
``` |
58,344,401 | I am working with IntHeap exmaple from [Package Heap](https://golang.org/pkg/container/heap/). Every thing looks very simple for a minHEAP. Take a Look how to get the minimum value: we just require the `(*h)[0]` value. And as like as in the description of heap the root node returns minimum value
```
fmt.Printf("minimu... | 2019/10/11 | [
"https://Stackoverflow.com/questions/58344401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8574922/"
] | When you initialize a heap from a slice using `Init`, it establishes heap invariants by rearranging the slice. This operation is `O(n)` and only happens once, on init, not on every pop!
Then, when you `Pop`, each `Pop` takes only `O(log n)`. Performing the init is essential to ensure we could pop in `O(log n)`.
Read ... | This is not reversing. It's an algorithm of removing minimum element from a MinHeap.
1. Swap root element with last element.
2. Remove lest element
3. Heapify the structure.
In current case package delegate to developer step #2. And implementing step #1 and step #3 for all Heap except the last element.
<https://yout... |
15,133,228 | ```
<asp:Label ID="lblDriving" runat="server" CssClass="lblDriving">Driving (y/n)</asp:Label>
<asp:TextBox ID="tbDriving" runat="server" CssClass="tbDriving"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvDriving" runat="server" CssClass="errorAsterik" ErrorMessage="Please enter y or n in lowercase only" ControlToV... | 2013/02/28 | [
"https://Stackoverflow.com/questions/15133228",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/998939/"
] | You could use a RegularExpressionValidator:
```
<asp:RegularExpressionValidator ID="rvDriving" runat="server"
CssClass="errorAsterik" ErrorMessage="Please enter n or y"
ControlToValidate="tbDriving"
ValidationExpression="[yYnN]">*</asp:RegularExpressionValidator>
``` | You will have to use a [`CustomValidator`](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator.aspx) because the `CompareValidator` with `Type=String` compares case-sensitive.
```
<asp:CustomValidator id="ValidDriving"
ControlToValidate="tbDriving"
ErrorMessage="Enter y/Y or... |
25,758,399 | I started working and installing Sitecore ......Created new Site ...Publish it on IIS ...and want to map it in Sitecore explorer
on opening the Site in Sitecore Explorer .it gives following error
```
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvoc... | 2014/09/10 | [
"https://Stackoverflow.com/questions/25758399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3767164/"
] | try to add permission read, execute and Modify to IUSR and IIS\_IUSRS | For all those still having above error:
Try selecting "good old web service" rather than "hard rock web service", if you are able to connect successfully, then the most obvious reason is incompatibility of Sitecore rocks with your visual studio.
[](h... |
42,580,729 | I am appending an array to a div using jquery, I want to show a small loading indicator while this happens, so I threw a call back function onto my append logic. This works, however, my loader will fire off it's `.hide()` before my array is painted into the div.
Is there a way I can only run the `.hide()` after the ar... | 2017/03/03 | [
"https://Stackoverflow.com/questions/42580729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3307806/"
] | The rules have not changed. However all global/static objects are constructed in the order they appear in the translation unit. It is just the order of initialization of multiple translation units that is unspecified.
Do note that function local static objects are constructed in a specified manner. They are constructe... | Yes: Global objects will be constructed in order within a compilation unit. Ando No: Nothing changed with C++11/14. |
24,059,536 | Below is the code I am using in my html to send an array of userids(numbers). On click of the checkboxes I am sending the array (checkIds):-
```
var checkIds = []
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var check... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24059536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3710945/"
] | You should be able to use the following:
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
checkIds.push($('.h... | `jsonText` is the the name of the variable you use in the js file to describe the JSON. It is not the name of the key to some data in the JSON structure. In the line below replace `jsonText` with the actual key name.
```
request.POST.get('jsonText')
``` |
24,059,536 | Below is the code I am using in my html to send an array of userids(numbers). On click of the checkboxes I am sending the array (checkIds):-
```
var checkIds = []
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var check... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24059536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3710945/"
] | This worked for me :
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
... | `jsonText` is the the name of the variable you use in the js file to describe the JSON. It is not the name of the key to some data in the JSON structure. In the line below replace `jsonText` with the actual key name.
```
request.POST.get('jsonText')
``` |
24,059,536 | Below is the code I am using in my html to send an array of userids(numbers). On click of the checkboxes I am sending the array (checkIds):-
```
var checkIds = []
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var check... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24059536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3710945/"
] | You should be able to use the following:
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
checkIds.push($('.h... | The `request.POST` dict is for form-encoded values. You're not sending those: you're sending a single JSON blob. You can use `request.body` to get that JSON, and then parse it to get a Python dict.
```
usersV = json.loads(request.body)
``` |
24,059,536 | Below is the code I am using in my html to send an array of userids(numbers). On click of the checkboxes I am sending the array (checkIds):-
```
var checkIds = []
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var check... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24059536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3710945/"
] | This worked for me :
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
... | You should be able to use the following:
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
checkIds.push($('.h... |
24,059,536 | Below is the code I am using in my html to send an array of userids(numbers). On click of the checkboxes I am sending the array (checkIds):-
```
var checkIds = []
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var check... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24059536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3710945/"
] | This worked for me :
```
var checkIds = [];
$(document).on("click","#group_save",function(){
$("#candidate-data tr").each(function(index,rowhtml){
var checked= $('input[id="groups"]:checked',rowhtml).length;
checkIds = jQuery.unique(checkIds)
if (checked==1){
... | The `request.POST` dict is for form-encoded values. You're not sending those: you're sending a single JSON blob. You can use `request.body` to get that JSON, and then parse it to get a Python dict.
```
usersV = json.loads(request.body)
``` |
520,219 | I have installed ubuntu 14.04 and it seems like I cannot actually create a VPN connectionor manage the network devices.
When I am accessing the network connection using the network icon at the gnome bar I enter the "Edit Connections" -> Add -> PPTP -> Create -> I cannot edit any property of the window.
It states "E... | 2014/09/04 | [
"https://askubuntu.com/questions/520219",
"https://askubuntu.com",
"https://askubuntu.com/users/322661/"
] | You need to modify the privileges of the user account which will set up the VPN.
I'm using Xubuntu 14.04.1 LTS (running in VirtualBox 4.3.20 on 64-bit Windows 7), so the instructions may differ slightly for you if you're using stock Ubuntu.
Find the "Users and Groups" tool in 'Settings'. Click "Advanced Settings" on... | If the VPN configuration tab is greyed out it's because the required plugins are not installed for Gnome NetworkManager. The following plugin should be installed:
**network-manager-pptp** and **network-manager-pptp-gnome** - network management framework PPTP plugin GNOME GUI
To install the above plugin use the apt-ge... |
520,219 | I have installed ubuntu 14.04 and it seems like I cannot actually create a VPN connectionor manage the network devices.
When I am accessing the network connection using the network icon at the gnome bar I enter the "Edit Connections" -> Add -> PPTP -> Create -> I cannot edit any property of the window.
It states "E... | 2014/09/04 | [
"https://askubuntu.com/questions/520219",
"https://askubuntu.com",
"https://askubuntu.com/users/322661/"
] | I had encountered the same problem - dialog was disabled.
**The solution that worked for me was:**
1. Installing network-manager-gnome: `sudo apt-get install network-manager-gnome`
2. Starting network-manager: `sudo start network-manager` (In case it is already running might need to stop it and then start again)
Aft... | If the VPN configuration tab is greyed out it's because the required plugins are not installed for Gnome NetworkManager. The following plugin should be installed:
**network-manager-pptp** and **network-manager-pptp-gnome** - network management framework PPTP plugin GNOME GUI
To install the above plugin use the apt-ge... |
2,354,664 | Would anybody know why the following code results in the first label being wider than the second one? The first box (shorter text) measures 21 pixels in width, the second box 19 pixels.
```
<mx:VBox>
<mx:HBox id="lbl1" backgroundColor="#6789ad">
<mx:Label fontWeight="bold" color="white" text="0" />
</... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2354664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/109795/"
] | The culprit may be the `getMinimumText` function in `mx.controls.Label`--essentially it enforces a 2 character minimum width on labels (specifically, measures any 0 or 1 character labels as if they contained "Wj").
To see if that's it, try replacing your "12" text with "Wj" and see if they come out the same size.
`ge... | If you don't set a width on a container, it is only going to be as big as the contents need it to be. Trying setting a width on each of the `HBox` containers - explicit, as in `width="50"`, or percentage, as in `width="100%"`. A percentage width will make the `HBox` fill the width of the parent `VBox`.
```
<mx:VBox>
... |
607,410 | How do i copy text that includes tab characters from a text editor, let's say gedit into a terminal session on ubuntu/gnome? I am on ubuntu 12.0.4 using gnome classic.
**UPDATE** This same issue happens in CentOs - basically seems to apply to any gnome. | 2013/06/13 | [
"https://superuser.com/questions/607410",
"https://superuser.com",
"https://superuser.com/users/212970/"
] | There does not appear to be any solution to this. | Just select the text you want to copy, and then middle click on the terminal. On most \*nix systems, selecting copies and middle click pastes.
Alternatively, you can select => right click=>copy => terminal => right click=> paste
Or, simply `Ctrl`+`C`,`Ctrl`+`V`
Have a look [here](http://www.pixelbeat.org/docs/xclipb... |
607,410 | How do i copy text that includes tab characters from a text editor, let's say gedit into a terminal session on ubuntu/gnome? I am on ubuntu 12.0.4 using gnome classic.
**UPDATE** This same issue happens in CentOs - basically seems to apply to any gnome. | 2013/06/13 | [
"https://superuser.com/questions/607410",
"https://superuser.com",
"https://superuser.com/users/212970/"
] | As I mentioned on the [OS X version of this question](https://superuser.com/a/1577258/54690), pasting tabs works fine. But **copying** them in the first place is tricky on Linux. | Just select the text you want to copy, and then middle click on the terminal. On most \*nix systems, selecting copies and middle click pastes.
Alternatively, you can select => right click=>copy => terminal => right click=> paste
Or, simply `Ctrl`+`C`,`Ctrl`+`V`
Have a look [here](http://www.pixelbeat.org/docs/xclipb... |
31,516,928 | I am working with Node, Angular & Mongo. And was able to successfully save and retrieve a user from the db. I have in my user model the following -> name: String. This is basically where the user inputs his first and last name.
Now i want to retrieve the name from the database and split the first and lastname up to re... | 2015/07/20 | [
"https://Stackoverflow.com/questions/31516928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1550402/"
] | I don't think you need to be creating alias or such for this. You can also further utilise the criteria builder DSL to specify the restrictions. For example,
```
def userList = UserRole.createCriteria().list(max: params.max,offset: params.offset){
eq("role",Role.findByAuthority("ROLE_CANDIDATE"))
user {
ilike... | You are invoking the static methods on `Restrictions` that return expression instances which aren't used anywhere.
Invoke the instance methods (omit `Restrictions.`) so that they take effect in the `Criteria` being built. |
5,847,532 | I have been working with Android SDK for a while & just came across an requirement to use the NDK
So, I downloaded the Android NDK for Windows. Jumping on the first example, when I am trying to build the library using the process defined in the NDK example
<http://developer.android.com/sdk/ndk/overview.html>
Specifi... | 2011/05/01 | [
"https://Stackoverflow.com/questions/5847532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/669231/"
] | Guess that should have been an answer instead of a comment.
You must use Cygwin as your shell in order to run ndk-build.
See <http://www.cygwin.com/> | Once you have Cygwin installed you can have Eclipse automatically build your project for you by:
1. Right click on your project, pick properties.
2. Select "builders" from the left-hand list.
3. Click "New..." on the right side.
4. Select "Program" as the configuration type. I name mine "Native Builder"
Location - c:... |
5,847,532 | I have been working with Android SDK for a while & just came across an requirement to use the NDK
So, I downloaded the Android NDK for Windows. Jumping on the first example, when I am trying to build the library using the process defined in the NDK example
<http://developer.android.com/sdk/ndk/overview.html>
Specifi... | 2011/05/01 | [
"https://Stackoverflow.com/questions/5847532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/669231/"
] | Guess that should have been an answer instead of a comment.
You must use Cygwin as your shell in order to run ndk-build.
See <http://www.cygwin.com/> | Maybe, your development IDE hides system PATH and uses it's own PATH. I had same problem with MOTODEV Eclipse for Android 3.1. Detailed solution is here: [How to solve problem with Motodev Eclipse for Android 3.1: wrong PATH](http://serpents-iz.blogspot.com/2012/02/how-to-solve-problem-with-motodev.html) It is for MOT... |
5,847,532 | I have been working with Android SDK for a while & just came across an requirement to use the NDK
So, I downloaded the Android NDK for Windows. Jumping on the first example, when I am trying to build the library using the process defined in the NDK example
<http://developer.android.com/sdk/ndk/overview.html>
Specifi... | 2011/05/01 | [
"https://Stackoverflow.com/questions/5847532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/669231/"
] | Once you have Cygwin installed you can have Eclipse automatically build your project for you by:
1. Right click on your project, pick properties.
2. Select "builders" from the left-hand list.
3. Click "New..." on the right side.
4. Select "Program" as the configuration type. I name mine "Native Builder"
Location - c:... | Maybe, your development IDE hides system PATH and uses it's own PATH. I had same problem with MOTODEV Eclipse for Android 3.1. Detailed solution is here: [How to solve problem with Motodev Eclipse for Android 3.1: wrong PATH](http://serpents-iz.blogspot.com/2012/02/how-to-solve-problem-with-motodev.html) It is for MOT... |
18,828,334 | I've got a program that checks whether a list is sorted or not. How do I print the answer? (i.e "The list is sorted", "The list is not sorted").
```
public class CheckList {
public static void main(String[] args) {
int[] myList = new int[10];
// Read in ten numbers
Scanner input = new Scanner(System.in);... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18828334",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2783940/"
] | Just call the method inside a `if`:
```
if(isSorted(myList)) {
System.out.println("Array is sorted");
} else {
System.out.println("Array is not sorted");
}
```
Anyway, your `isSorted` method won't work, i would make something like this:
```
//checks if array is sorted in ascending order
public static boolea... | *Just call the method after your `for loop`*
```
for (int i = 0; i < myList.length; i++) {
myList[i] = input.nextInt();
}
if(isSorted(myList)) {
System.out.println("The list is sorted");
} else {
System.out.println("The list is not sorted");
}
``` |
10,603 | I often mark useful post as a favorite for future reference. Are questions and answers on the site permanent or are the old ones deleted after a certain amount of time? | 2009/07/29 | [
"https://meta.stackexchange.com/questions/10603",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/132558/"
] | Questions are not automatically pruned. However, users with over 10k reputation can vote to delete closed questions, which removes them from the view of anyone under 10k reputation (those with over 10k can still see them, and all\*, deleted posts). So nothing is ever really gone from the system, even if it's marked del... | Questions and answers are permanent unless deleted deliberately. |
42,218,402 | ```
double getDistance(int rssi, int txPower) {
return Math.pow(10d, ((double) txPower - rssi) / (10 * 2));
}
```
I tried calculating distance between the Bluetooth devices using the above equation. But it returns wrong results. The results are in the format "3.4565216E9". But the results varies from "3.4565216E9... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42218402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5681276/"
] | I ran into this issue as well. The environment we work in requires the STRICT\_SERVLET\_COMPLIANCE be set to true, but the validation of the web.xml was not the driving force behind the requirement. To get around the issue try setting the xmlValidation to false in the conf/context.xml's tag:
```
<Context xmlValidation... | Below will address this issue
catalina.properties
org.apache.catalina.STRICT\_SERVLET\_COMPLIANCE=false |
21,787,371 | **Problem:**
IE8 only takes in account my Grid layout with **col-x** classes. I have found a related / similar problem [IE8 issue with Twitter Bootstrap 3](https://stackoverflow.com/questions/17947182/ie8-issue-with-twitter-bootstrap-3) wrt Respond.js and htm5shiv. I've tried all possible combinations, but IE8 still ig... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21787371",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2292376/"
] | I found the problem. Somehow my copy of respond.js was corrupt. With the latest version from Github everything works now as expected. | Try reverse the "direction" of cols in opposite way from:
```
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-3"></div>
```
to this:
```
<div class="col-xs-3 col-sm-1 col-md-1 col-lg-1"></div>
```
In the guideline of bootstrap griding, it state that staring to grid should begin at the smallest unit and work your... |
72,778,928 | So I need to select all the students, having the minimum grade for each prof. For example, if Augustinus had two students with grade 1.0, then I would like to see both in the result.
[Table of my data](https://i.stack.imgur.com/OnwT9.png)
[What the result could look like, if the LIMIT was set to 10](https://i.stack.i... | 2022/06/27 | [
"https://Stackoverflow.com/questions/72778928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19421293/"
] | The pattern you have provided to `gsub`, `%-%-[^\n\r]+`, will only remove "short" comments ("line" comments). It doesn't even attempt to deal with "long" comments and thus just treats their first line as a line comment, removing it.
Thus Piglet is right: You must remove the line comments after removing the long commen... | Why should `str:gsub("%-%-[^\n\r]+", "")` remove
```
print(4)
]]
```
?
This pattern matches `--` followed by anything but a linebreak or carriage return.
So it matches `--a` and `--[[`.
If there is an opening bracket immediately after `--` you need to match anything until and including the corresponding closing... |
58,922,311 | I need to constantly add and remove actions to the delegate, should I use a hashset instead of actions?
What I currently have:
```
System.Action _callbacks =null;
//...somewhere in code, from many different places (2000 places or so, every frame):
_callbacks -= anyFunction;
_callbacks += someOtherFunc;
```
What I... | 2019/11/18 | [
"https://Stackoverflow.com/questions/58922311",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9007125/"
] | Invocation lists of multicast delegates *are* arrays.
<https://referencesource.microsoft.com/#mscorlib/system/multicastdelegate.cs,284>
(The documentation is outdated (the delegates might have used linked-linsts in .Net 1.0, but not anymore) <https://learn.microsoft.com/en-us/dotnet/api/system.multicastdelegate?view=... | See <https://learn.microsoft.com/en-us/dotnet/api/system.multicastdelegate?view=netframework-4.8>
All delagates in . Net are in fact multicast delegates, as per that article they are implemented as a linked list. |
26,988,600 | I am new to work light. I want to create an application which shows me current available wifi network as a list and allow me to connect any of them and also it show the signal strength of the each network. I have studied the **WL.Device.Wifi** but it is not giving much help. Please provide your suggestions. I want to d... | 2014/11/18 | [
"https://Stackoverflow.com/questions/26988600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2210442/"
] | Try this, It will give the currently connected network but not the list of available networks. Apple not supporting that.
```
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs)
{
in... | There is limited support for what you're asking for, when using the WL.Device API in iOS.
You can see the following question&answer for more information about what is possible and any limitations: [How to list the available Wifi access point in worklight](https://stackoverflow.com/questions/25197173/how-to-list-the-av... |
73,882 | How do I get continuation indicators (a character indicator at the far right edge, normally `\`) in `visual-line mode` when I'm working in a `terminal emacs`. FYI, the `continuation` markers on `visual-line-fringe-indicators`, do NOT work in `terminal emacs`.
I would like to differentiate between `hard` and `soft` new... | 2022/09/30 | [
"https://emacs.stackexchange.com/questions/73882",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/39025/"
] | As mentioned by @db48x, indeed, reporting a bug would be a good thing to do, as I guess that docstring should say "DID cancel the call". Also, there might be a small chance that the function could be changed to make it do what you require.
That said. If you are not planning to publish your code, but just want to be pr... | The documentation of `perform-replace` says:
```
This function returns nil if and only if there were no matches to
make, or the user didn't cancel the call.
```
So maybe you have found a bug; probably best to use `M-x report-emacs-bug`.
That said, parsing the content of the `*Messages*` buffer should never be your ... |
233,767 | I wrote a function which picks a two different random elements from a closed range of ints and returns them as a tuple.
I would like to take a your feedback, if the solution is a "Clever", "Best practice" or "non of them"
```
func pickTwoRandomElementsFromRange(_ range: ClosedRange<Int>) -> (Int, Int)? {
guard ra... | 2019/12/10 | [
"https://codereview.stackexchange.com/questions/233767",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/214726/"
] | ### Naming
Swift naming conventions are listed in the [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/). With respect to “Omit needless words” and “Strive for Fluent Usage” I would suggest to call the function
```
func randomPair(from range: ClosedRange<Int>) -> (Int, Int)?
```
### Sim... | I think Martin’s answer (+1) checks most of the boxes.
First, that having been said, I wonder whether you’ve considered using this within non-countable ranges. For example, would you ever want to use it to generate a pair of floating point values (e.g. two angles whose values are between zero and 2π)? Is that part of ... |
45,103,037 | I want to delete a property object as if it never existed, the solution of void operator (void 0) and delete operator march but I would like another alternative using lodash for example.
My case :
```
//variable
this.project.monthlyRent = void 0
//Object
this.project.TypeChoose = void 0
``` | 2017/07/14 | [
"https://Stackoverflow.com/questions/45103037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7951032/"
] | You can use the [**delete** operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete), although I don't particular recommend using that alternative. If you do use it, you need to be aware of it's limitations and how it behaves if you're using strict mode.
If you instead want an imm... | Try this
**Example 1**
```
//variable
this.project.monthlyRent = undefined;
//Object
this.project.TypeChoose = {};
```
**Example 2**
```
//variable
delete this.project.monthlyRent;
//Object
delete this.project.TypeChoose;
``` |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | You should also try checking the error messages in curl\_error(). You might need to do this once after each curl\_\* function.
<http://www.php.net/curl_error> | Just had a very similar problem and solved it by adding
```
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
```
Apparently the site I'm fetching redirects to another location and php-curl doesn't follow redirects by default. |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | Just had a very similar problem and solved it by adding
```
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
```
Apparently the site I'm fetching redirects to another location and php-curl doesn't follow redirects by default. | Whenever I'm testing something with PHP/Curl, I try it from the command line first, figure out what works, and then port my options to PHP. |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | Just had a very similar problem and solved it by adding
```
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
```
Apparently the site I'm fetching redirects to another location and php-curl doesn't follow redirects by default. | The best way to use https and avoid security issues is to use Firefox (or another tool) and download the certificate to your server. [This webpage helped me a lot](http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/), and these were the steps that worked for me:
1) Open in Fir... |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | Note: This is strictly not production use. If you want to quickly debug, this may be useful. Otherwise, please use @SchizoDuckie's answer above.
```
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
```
Just add them. It works. | there might be a problem at your web hosting company from where you are testing the secure communication for gateway, that they might not allow you to do that.
also there might be a username, password that must be provided before connecting to remote host.
or your IP might need to be in the list of approved IP for th... |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | Sometimes you have to upgrade your Curl certificates to latest version not to have errors with https. | there might be a problem at your web hosting company from where you are testing the secure communication for gateway, that they might not allow you to do that.
also there might be a username, password that must be provided before connecting to remote host.
or your IP might need to be in the list of approved IP for th... |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | I had the same problem today.
Curl comes with an outdated file to authenticate HTTPS certificates from.
get the new one from:
<http://curl.haxx.se/ca/cacert.pem>
save it into some dir on your site
and add
```
curl_setopt ($curl_ch, CURLOPT_CAINFO, dirname(__FILE__)."/cacert.pem");
```
To every request :-)
IG... | Whenever I'm testing something with PHP/Curl, I try it from the command line first, figure out what works, and then port my options to PHP. |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | Just had a very similar problem and solved it by adding
```
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
```
Apparently the site I'm fetching redirects to another location and php-curl doesn't follow redirects by default. | You are using POST method, but are you providing an array of data? E.g.
```
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
``` |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | I had the same problem today.
Curl comes with an outdated file to authenticate HTTPS certificates from.
get the new one from:
<http://curl.haxx.se/ca/cacert.pem>
save it into some dir on your site
and add
```
curl_setopt ($curl_ch, CURLOPT_CAINFO, dirname(__FILE__)."/cacert.pem");
```
To every request :-)
IG... | You should also try checking the error messages in curl\_error(). You might need to do this once after each curl\_\* function.
<http://www.php.net/curl_error> |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | I used `file_get_contents` using `stream_create_context` and it works fine:
```
$postdataStr = http_build_query($postdataArr);
$context_options = array (
'http' => array ( <blink> // this will allways be http!!!</blink>
'method' => 'POST',
'header'=> "Content-type: application/x-www... | there might be a problem at your web hosting company from where you are testing the secure communication for gateway, that they might not allow you to do that.
also there might be a username, password that must be provided before connecting to remote host.
or your IP might need to be in the list of approved IP for th... |
316,099 | I have a site that connects using cURL (latest version) to a secure gateway for payment.
The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.
```
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURL... | 2008/11/25 | [
"https://Stackoverflow.com/questions/316099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31671/"
] | I used `file_get_contents` using `stream_create_context` and it works fine:
```
$postdataStr = http_build_query($postdataArr);
$context_options = array (
'http' => array ( <blink> // this will allways be http!!!</blink>
'method' => 'POST',
'header'=> "Content-type: application/x-www... | I discovered this error on a recent application project. I was writing to run from the command line or the browser window, so I was using server detection to get the relative URL of the document I was asking for. The trouble was, the site is https, and each time I attempted to access <http://(same> server), cURL helpfu... |
367,453 | >
> Is Stack overflow chat only for programming related topics or for others also?
>
>
>
There is a [chat room](https://chat.stackoverflow.com/rooms/17/javascript) named JavaScript on chat.stackoverflow.com. As the name suggests, it's related to programming, but the discussion going-on in the chat room is what I t... | 2018/05/07 | [
"https://meta.stackoverflow.com/questions/367453",
"https://meta.stackoverflow.com",
"https://meta.stackoverflow.com/users/-1/"
] | <https://chat.stackoverflow.com/faq>
>
> **What can we chat about?**
>
>
> This site is an extension of Stack Overflow, so discussion *should* more or less revolve around the same topics you'd find at Stack Overflow — but in an interactive, less strictly Q&A focused way. Do have fun, but please keep it professional... | It's a chat. Just compare it to the water cooler, cafeteria or any other social area in an office. Often people will chat about work related stuff (let's say JavaScript), but there will be random chit-chat, socializing, etc. as well (like what you apparently noticed when joining the room).
Also, I'm pretty sure there ... |
264,485 | everyone.
When referring to a person, are there any firm guidelines when it comes to the use of "a" or "the" after the comma that follows their name?
To clarify:
Recently, I was writing an article about Amy Winehouse, and I referred to her like this:
"Amy Winehouse, the troubled singer-songwriter who..."
A few... | 2015/08/03 | [
"https://english.stackexchange.com/questions/264485",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/131604/"
] | I think it comes down to how well-known you consider the person to be as far as the reader is concerned.
"...the famous singer..." assumes your reader knows the person. Additionally, it may distinguish them from another person of the same name.
"... a famous singer ..." assumes the reader is being introduced to the p... | I like your rule and think you should trust it.
I also offer you the thought that when you write "... , a troubled ...", you are writing as if the reader does not already know about the singer, whereas when you write "... , the troubled ...", you are writing as if the reader already knows about the singer. |
67,428,806 | Entity Framework doesn't include the nested entity with its data more than once.
Below is the response from Postman:
```
[{
"ProjectID": 29,
"ProjectName": "Angular",
"ProjectDescription": "This is angular project for developing webpages.",
"ProjectURL": "angular.com",
"ApplicationEntity": [],
... | 2021/05/07 | [
"https://Stackoverflow.com/questions/67428806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5826312/"
] | Please try with the below code. It worked for me.
```
driver.get("https://www.primefaces.org/showcase/ui/input/inputText.xhtml?jfwid=27a6e");
WebElement textfield = driver.findElement(By.id("j_idt302"));
textfield.sendKeys("selenium");
System.out.println(textfield.getAttribute("value"));
``` | Try getting field's attribute named `value`:
```
driver.findElement(By.cssSelector(input[id=j_idt302])).getAttribute("value");
```
I had a similar question once [Finding shadow DOM text with selenium and CSS](https://stackoverflow.com/questions/66483982/finding-shadow-dom-text-with-selenium-and-css) |
67,428,806 | Entity Framework doesn't include the nested entity with its data more than once.
Below is the response from Postman:
```
[{
"ProjectID": 29,
"ProjectName": "Angular",
"ProjectDescription": "This is angular project for developing webpages.",
"ProjectURL": "angular.com",
"ApplicationEntity": [],
... | 2021/05/07 | [
"https://Stackoverflow.com/questions/67428806",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5826312/"
] | Please try with the below code. It worked for me.
```
driver.get("https://www.primefaces.org/showcase/ui/input/inputText.xhtml?jfwid=27a6e");
WebElement textfield = driver.findElement(By.id("j_idt302"));
textfield.sendKeys("selenium");
System.out.println(textfield.getAttribute("value"));
``` | Try this xpath driver.findElement(By.xpath(".//input[@id='username2']")).getAttribute("value") |
238,969 | The Poissonian formulation of mechanics tells us that for a generating function $g(q,p,t)$, the Poisson bracket of some function/variable $f(q,p,t)$ with the generating function corresponds with an infinitesimal change in $f$ along the transformation or "motion" generated by $g$.
$$\delta f = \epsilon \left\{f,g \righ... | 2016/02/22 | [
"https://physics.stackexchange.com/questions/238969",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/62755/"
] | Let's just do it for a simple example. By $\vec{c}$ I imagine you mean the location of the particle relative to some origin, so $\vec{c}=\vec{r}$. Later on for simplicity we'll suppose further the particle is located on the x-axis (but it is important to do this only *after* differentiating as we will see).
We'll also... | The starting point is that the $3$-vector $\vec{\bf c}$ transforms in the $3$-dimensional irreducible vector representation of the rotation group $SO(3)$,
$$\tag{1} \{ \vec{\bf c}, \vec{\bf L}\cdot \hat{\bf n} \}\_{PB}~=~ \hat{\bf n}\times \vec{\bf c},$$
where $\hat{\bf n}$ is an arbitrary unit vector, whose Poisson ... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | `AAR` files are more similar to `Jar`s than to `Dll`s for the following reason:
>
> `Dll`s can be shared across applications where as `AAR`s and jars are
> packaged in with your app.
>
>
>
`AAR`s vs `Jar`s:
>
> The main difference between a `Jar` and a `AAR` is that `AAR`s include
> resources such as `layouts... | The statement "*The main difference between a Jar and a AAR is that AARs include resources such as layouts, drawables etc.*" does not correspond to the JAR file specification and therefore is not a truth.
According the [JAR file specification](http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html):
>
> ... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | `AAR` files are more similar to `Jar`s than to `Dll`s for the following reason:
>
> `Dll`s can be shared across applications where as `AAR`s and jars are
> packaged in with your app.
>
>
>
`AAR`s vs `Jar`s:
>
> The main difference between a `Jar` and a `AAR` is that `AAR`s include
> resources such as `layouts... | The citation in the question has nothing common with the current reality. Of course it is possible to use external libraries in Android and there are lots libraries available. Maybe they wanted to say that each application must bundle all libraries it needs, but reusing the library at the build time (static linking) is... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | `AAR` files are more similar to `Jar`s than to `Dll`s for the following reason:
>
> `Dll`s can be shared across applications where as `AAR`s and jars are
> packaged in with your app.
>
>
>
`AAR`s vs `Jar`s:
>
> The main difference between a `Jar` and a `AAR` is that `AAR`s include
> resources such as `layouts... | The main difference is aar is splitted inside android to jar.
If your app will be used only in user app only in android studio then aar is preferred.
If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.
Using jar and aar based on requirements aar working easy,
jar more flexibi... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | `AAR` files are more similar to `Jar`s than to `Dll`s for the following reason:
>
> `Dll`s can be shared across applications where as `AAR`s and jars are
> packaged in with your app.
>
>
>
`AAR`s vs `Jar`s:
>
> The main difference between a `Jar` and a `AAR` is that `AAR`s include
> resources such as `layouts... | **JAR vs AAR**
`JAR` – Java Archive. Contains `.class`, java resources
`AAR` – Android Archive. Contains `classes.jar`, and other Android related files like AndroidManifest.xml, R.txt, proguard.txt, res folder(layout, values, drawable) and others.
Android works with both files `jar` and `aar`. As a library developer... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | The statement "*The main difference between a Jar and a AAR is that AARs include resources such as layouts, drawables etc.*" does not correspond to the JAR file specification and therefore is not a truth.
According the [JAR file specification](http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html):
>
> ... | The citation in the question has nothing common with the current reality. Of course it is possible to use external libraries in Android and there are lots libraries available. Maybe they wanted to say that each application must bundle all libraries it needs, but reusing the library at the build time (static linking) is... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | The statement "*The main difference between a Jar and a AAR is that AARs include resources such as layouts, drawables etc.*" does not correspond to the JAR file specification and therefore is not a truth.
According the [JAR file specification](http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html):
>
> ... | The main difference is aar is splitted inside android to jar.
If your app will be used only in user app only in android studio then aar is preferred.
If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.
Using jar and aar based on requirements aar working easy,
jar more flexibi... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | The citation in the question has nothing common with the current reality. Of course it is possible to use external libraries in Android and there are lots libraries available. Maybe they wanted to say that each application must bundle all libraries it needs, but reusing the library at the build time (static linking) is... | The main difference is aar is splitted inside android to jar.
If your app will be used only in user app only in android studio then aar is preferred.
If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.
Using jar and aar based on requirements aar working easy,
jar more flexibi... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | **JAR vs AAR**
`JAR` – Java Archive. Contains `.class`, java resources
`AAR` – Android Archive. Contains `classes.jar`, and other Android related files like AndroidManifest.xml, R.txt, proguard.txt, res folder(layout, values, drawable) and others.
Android works with both files `jar` and `aar`. As a library developer... | The citation in the question has nothing common with the current reality. Of course it is possible to use external libraries in Android and there are lots libraries available. Maybe they wanted to say that each application must bundle all libraries it needs, but reusing the library at the build time (static linking) is... |
23,915,619 | I've been reading some articles about the new adoption of Gradle as the standard build system for Android apps. Well, coming from standard Java development I usually depend on *jar* files in order to build my project. However it seems that Android has also *aar* packages, which are the equivalent to the *dll* files in ... | 2014/05/28 | [
"https://Stackoverflow.com/questions/23915619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199132/"
] | **JAR vs AAR**
`JAR` – Java Archive. Contains `.class`, java resources
`AAR` – Android Archive. Contains `classes.jar`, and other Android related files like AndroidManifest.xml, R.txt, proguard.txt, res folder(layout, values, drawable) and others.
Android works with both files `jar` and `aar`. As a library developer... | The main difference is aar is splitted inside android to jar.
If your app will be used only in user app only in android studio then aar is preferred.
If you are planning for app to communicate with c/c++ compiled lib.so file jar is preferred.
Using jar and aar based on requirements aar working easy,
jar more flexibi... |
25,673 | The questions tagged under such tags attract very less views and/or get very few/no answers. Is this desirable?
Is it because very few users have the background knowledge about those topics or is it because these topics are found uninteresting by the community? Or is there some other reason for this behaviour?
I un... | 2017/01/14 | [
"https://math.meta.stackexchange.com/questions/25673",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/384307/"
] | I answer many logic questions, but I do not have every logic-related tag on my list. I would recommend using the "logic" tag on any question that is actually about logic, while also using other tags to help categorize it. If a question only has the "natural deduction" tag, for example, it may easily slip through the cr... | EDIT: As the OP pointed out [in a comment](http://meta.math.stackexchange.com/questions/25673/why-are-some-tags-very-inactive-for-example-natural-deduction-and-propositio/25674?noredirect=1#comment100951_25674), I have misunderstood the question. It seems that the question is not why *some tags* have less activity/atte... |
60,623,201 | in my current web application, I authenticate a user with the claim "customRole" (plus its value) and use the attribute "Authorize" to allow/deny access to actions.
All works well until the user as more than one claim of the same type, the access gets denied all the time and when debugging I noticed that only one clai... | 2020/03/10 | [
"https://Stackoverflow.com/questions/60623201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | >
> Can I create unordered\_map for size of integer upto 10^9?
>
>
>
Yes. Both `long long` and `long` are guaranteed to be able to represent all integers up to 109. Unordered map has no effect on that, as per documentation.
>
> just want to store integers in a container and check whether a particular integer is ... | You can use bitset, size 2^27 bytes (128mb). Bit 1 in the appropriate index will define "element within set", and bit 0 will be "element not in set".
Such set can be easy written as class like:
```
class bitset1G {
public:
bitset1G() { bzero(_data, sizeof(_data)); }
void set(uint32_t x) { _data[x >> 5] |= (1 << ... |
8,651 | The 2nd part of the "Fundamental Theorem of Calculus" has never seemed as earth shaking or as **fundamental** as the first to me. Why is it "fundamental" -- I mean, the *mean value theorem*, and the *intermediate value theorems* are both pretty exciting by comparison. And after the joyful union of integration and the d... | 2010/11/02 | [
"https://math.stackexchange.com/questions/8651",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2563/"
] | It's natural that the Fundamental Theorem of Calculus has two parts, since morally it expresses the fact that differentiation and integration are mutually inverse processes, and this amounts to two statements: (i) integrating and then differentiating and (ii) differentiating and then integrating get us (essentially) ba... | This is the part of the fundamental theorem that allows you to *compute* integrals; then you can compute areas, and with more theory even volumes, surfaces and so on. Exciting enough? |
8,651 | The 2nd part of the "Fundamental Theorem of Calculus" has never seemed as earth shaking or as **fundamental** as the first to me. Why is it "fundamental" -- I mean, the *mean value theorem*, and the *intermediate value theorems* are both pretty exciting by comparison. And after the joyful union of integration and the d... | 2010/11/02 | [
"https://math.stackexchange.com/questions/8651",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2563/"
] | The names "first" and "second" for the two parts of the theorem are meaningless. More correct names would be *existence* and *uniqueness*. It also is not unreasonable to separate the uniqueness statement from the formula relating definite integrals to antiderivatives, which is an algebraic *consequence* of the (analyti... | This is the part of the fundamental theorem that allows you to *compute* integrals; then you can compute areas, and with more theory even volumes, surfaces and so on. Exciting enough? |
8,651 | The 2nd part of the "Fundamental Theorem of Calculus" has never seemed as earth shaking or as **fundamental** as the first to me. Why is it "fundamental" -- I mean, the *mean value theorem*, and the *intermediate value theorems* are both pretty exciting by comparison. And after the joyful union of integration and the d... | 2010/11/02 | [
"https://math.stackexchange.com/questions/8651",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2563/"
] | It's natural that the Fundamental Theorem of Calculus has two parts, since morally it expresses the fact that differentiation and integration are mutually inverse processes, and this amounts to two statements: (i) integrating and then differentiating and (ii) differentiating and then integrating get us (essentially) ba... | The names "first" and "second" for the two parts of the theorem are meaningless. More correct names would be *existence* and *uniqueness*. It also is not unreasonable to separate the uniqueness statement from the formula relating definite integrals to antiderivatives, which is an algebraic *consequence* of the (analyti... |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | You can also use this
`Agency.find(1).update_column(:status, 0)` | You need [`update_column`](https://apidock.com/rails/ActiveRecord/Persistence/update_column) method. Try this:
```
agency = Agency.find(1)
agency.update_column(:status, 0)
```
You should spend sometime reading [RubyonRails Guide](http://guides.rubyonrails.org) |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | Rails provides many method for update an activerecord. You can get differences of each method from this [blog](https://web.archive.org/web/20160419042240/https://www.hoanghiep.org/2016/04/05/different-between-update-update_columns-update_column-update_attributes-assign_attributes)
```
agency = Agency.find(1)
```
1. ... | You need [`update_column`](https://apidock.com/rails/ActiveRecord/Persistence/update_column) method. Try this:
```
agency = Agency.find(1)
agency.update_column(:status, 0)
```
You should spend sometime reading [RubyonRails Guide](http://guides.rubyonrails.org) |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | You need [`update_column`](https://apidock.com/rails/ActiveRecord/Persistence/update_column) method. Try this:
```
agency = Agency.find(1)
agency.update_column(:status, 0)
```
You should spend sometime reading [RubyonRails Guide](http://guides.rubyonrails.org) | To update, you can use:
```
agency.update_column(:status, 0)
```
But update\_column **will ignore all the validations** that you may have on your model.
If you dont want to ignore your model validations, I recommend you to use:
```
agency.update status: 0
```
The method update\_attributes is deprecated on rails ... |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | Rails provides many method for update an activerecord. You can get differences of each method from this [blog](https://web.archive.org/web/20160419042240/https://www.hoanghiep.org/2016/04/05/different-between-update-update_columns-update_column-update_attributes-assign_attributes)
```
agency = Agency.find(1)
```
1. ... | You can also use this
`Agency.find(1).update_column(:status, 0)` |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | You can also use this
`Agency.find(1).update_column(:status, 0)` | To update, you can use:
```
agency.update_column(:status, 0)
```
But update\_column **will ignore all the validations** that you may have on your model.
If you dont want to ignore your model validations, I recommend you to use:
```
agency.update status: 0
```
The method update\_attributes is deprecated on rails ... |
45,252,984 | I have a model called **Agency**
One of the row from **Agency** active record looks as follows:
```
#<Agency id: 1, name: "Hello", contact_person: "Abhimanyu", phone_number: "946159", email: "Abhimanyu@purple.com ", local_package: false, outstation: true, remarks: nil, status: 1>
```
Here I want to change the value... | 2017/07/22 | [
"https://Stackoverflow.com/questions/45252984",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576036/"
] | Rails provides many method for update an activerecord. You can get differences of each method from this [blog](https://web.archive.org/web/20160419042240/https://www.hoanghiep.org/2016/04/05/different-between-update-update_columns-update_column-update_attributes-assign_attributes)
```
agency = Agency.find(1)
```
1. ... | To update, you can use:
```
agency.update_column(:status, 0)
```
But update\_column **will ignore all the validations** that you may have on your model.
If you dont want to ignore your model validations, I recommend you to use:
```
agency.update status: 0
```
The method update\_attributes is deprecated on rails ... |
22,655,138 | I have a requirement to store user ids appending with numbers like:
If user id is "stackoverflow", then first 7 letters of id "stackov" is taken and if it not there in the DataBase then it should be stored as "stackov001".
Now if another user gives similar user id as "stackoverflowed" then its user id should be store... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22655138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1782009/"
] | The Salah reply is wrong at so many levels I would consider this outright harmful.
First, the JVM will not trigger Stop The World GC and clean out heap just before dying with OutOfMemoryError. The reason for OOM is that the GC has failed to clean the memory, usually during tens and hundreds of runs prior the OOM.
Se... | **First** you need to take a look at the following memory parameters, it may not prevent the `OutOfMemoryError`, but you should learn about them:
```
-Xmx2048m -> this param to set the max memory that the JVM can allocate
-Xms1024m -> the init memory that JVM will allocate on the start up
-XX:MaxPermSize=512M -> this ... |
22,655,138 | I have a requirement to store user ids appending with numbers like:
If user id is "stackoverflow", then first 7 letters of id "stackov" is taken and if it not there in the DataBase then it should be stored as "stackov001".
Now if another user gives similar user id as "stackoverflowed" then its user id should be store... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22655138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1782009/"
] | `XmxSIZE` can be greater then Java core dump because `OutOfMemory` happen when you try to allocate a large object!
Our application with `-Xmx1000m` and 670 MiB dump crashed by `OutOfMemory` on uploading 300 MiB attachment by a user.
We discover this in VisualVM in "Show Threads" trace on `System.arrayCopy`. Reference... | **First** you need to take a look at the following memory parameters, it may not prevent the `OutOfMemoryError`, but you should learn about them:
```
-Xmx2048m -> this param to set the max memory that the JVM can allocate
-Xms1024m -> the init memory that JVM will allocate on the start up
-XX:MaxPermSize=512M -> this ... |
22,655,138 | I have a requirement to store user ids appending with numbers like:
If user id is "stackoverflow", then first 7 letters of id "stackov" is taken and if it not there in the DataBase then it should be stored as "stackov001".
Now if another user gives similar user id as "stackoverflowed" then its user id should be store... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22655138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1782009/"
] | `XmxSIZE` can be greater then Java core dump because `OutOfMemory` happen when you try to allocate a large object!
Our application with `-Xmx1000m` and 670 MiB dump crashed by `OutOfMemory` on uploading 300 MiB attachment by a user.
We discover this in VisualVM in "Show Threads" trace on `System.arrayCopy`. Reference... | The Salah reply is wrong at so many levels I would consider this outright harmful.
First, the JVM will not trigger Stop The World GC and clean out heap just before dying with OutOfMemoryError. The reason for OOM is that the GC has failed to clean the memory, usually during tens and hundreds of runs prior the OOM.
Se... |
18,993 | Could anybody please help me with my problem? My Arduino doesn't work correctly. I was between a project, and suddenly it started acting weird. First, it started taking about 4 minutes to compile and a minute to upload, I do not know why!
Second, now it doesn't accept any code at all. I will paste the error message be... | 2015/12/25 | [
"https://arduino.stackexchange.com/questions/18993",
"https://arduino.stackexchange.com",
"https://arduino.stackexchange.com/users/15858/"
] | Connecting to the 5v/2A power supply would cause no trouble at all. Taking 4 minutes to compile is strange but unlikely to be related to the Arduino board. "programmer is not responding" errors are communication errors.
* Did the program compile without errors?
* Are any LEDs lit or blinking on your board?
* Is the co... | I am getting the same exact errors. Tried different boards, cables, upgrade to 1.6.7, etc. Maybe will go back to pre1.6 and try. Will also try via tinyisp when I get a chance. FYI - having no issues with studio 6/tinyusb/avrdude combination, just on arduino. Wonder if it is a USB driver or arduino version of avrdude pr... |
2,836,601 | For some field $F$, given a set of $n$-dimensional input vectors $V\_{in}$ and a set of $n$-dimensional output vectors $V\_{out}$, where each of the set does not contain any duplicated elements.
Is it possible to create a corresponding linear transformation matrix $M$ such that $\vec{v}\_{out} = M \vec{v}\_{in} $ wher... | 2018/06/30 | [
"https://math.stackexchange.com/questions/2836601",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/336692/"
] | You need to find the sine and/or cosine of the angles that points A and/or C have with respect to the axes. Then find the same for the acute angles within the triangle. Geometry will then tell you the angles that BC has with respect to the axes and you can find the coordinates by multiplying the length of BC by these r... | **Hint:**
Convert the coordinates of $A$ to polar with the pole at $C$. Then replace the modulus ($\rho=AC$) by $BC$ and add/subtract $\dfrac\pi2$ to the argument $\theta$. Convert back to Cartesian. |
2,836,601 | For some field $F$, given a set of $n$-dimensional input vectors $V\_{in}$ and a set of $n$-dimensional output vectors $V\_{out}$, where each of the set does not contain any duplicated elements.
Is it possible to create a corresponding linear transformation matrix $M$ such that $\vec{v}\_{out} = M \vec{v}\_{in} $ wher... | 2018/06/30 | [
"https://math.stackexchange.com/questions/2836601",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/336692/"
] | You need to find the sine and/or cosine of the angles that points A and/or C have with respect to the axes. Then find the same for the acute angles within the triangle. Geometry will then tell you the angles that BC has with respect to the axes and you can find the coordinates by multiplying the length of BC by these r... | I believe you can find the length of $AB$ (Pythagoras!). If you let the coordinates of $B$ be $(x,y),$ then since you know the other distances and coordinates, you can use the distance formula to find two equations in $x$ and $y$ (apply it to $|BA|$ and $|BC|$ in turn) that you can hopefully solve for $(x,y).$ |
43,993,340 | I have the splash screen = 2208 x 2208. And app icon 192 X 192. I am using `ionic1` but still I am running the command as `ionic cordova resource` command to generate app icon and splash screen.
In Android it's working fine. But when I did for iOS, it throws me this error :
>
> Error: encountered bad status code (4... | 2017/05/16 | [
"https://Stackoverflow.com/questions/43993340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7251099/"
] | This error occurs due to wrong dimensions for the splash screen resource. You have a splash screen image in resources folder with dimensions 2208 X 2208 but based on [docs](https://ionicframework.com/docs/cli/cordova/resources/) it should be 2732 X 2732 | Try this,
**Check config.xml file and remove all entries of Landscape images in this file and again build your project.**
Put this line in config.xml
```
<preference name="orientation" value="portrait" />
``` |
43,993,340 | I have the splash screen = 2208 x 2208. And app icon 192 X 192. I am using `ionic1` but still I am running the command as `ionic cordova resource` command to generate app icon and splash screen.
In Android it's working fine. But when I did for iOS, it throws me this error :
>
> Error: encountered bad status code (4... | 2017/05/16 | [
"https://Stackoverflow.com/questions/43993340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7251099/"
] | The icon image's maximum dimensions should be 1024x1024 px.
The splash image's maximum dimensions should be 2732x2732 px.
Icon Image's Name Extention .PNG to .png transfer
Then Run $ionic cordova resources | Try this,
**Check config.xml file and remove all entries of Landscape images in this file and again build your project.**
Put this line in config.xml
```
<preference name="orientation" value="portrait" />
``` |
43,993,340 | I have the splash screen = 2208 x 2208. And app icon 192 X 192. I am using `ionic1` but still I am running the command as `ionic cordova resource` command to generate app icon and splash screen.
In Android it's working fine. But when I did for iOS, it throws me this error :
>
> Error: encountered bad status code (4... | 2017/05/16 | [
"https://Stackoverflow.com/questions/43993340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7251099/"
] | This error occurs due to wrong dimensions for the splash screen resource. You have a splash screen image in resources folder with dimensions 2208 X 2208 but based on [docs](https://ionicframework.com/docs/cli/cordova/resources/) it should be 2732 X 2732 | The icon image's maximum dimensions should be 1024x1024 px.
The splash image's maximum dimensions should be 2732x2732 px.
Icon Image's Name Extention .PNG to .png transfer
Then Run $ionic cordova resources |
1,694,963 | **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ? | 2009/11/08 | [
"https://Stackoverflow.com/questions/1694963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171461/"
] | I think these are GNU extensions, and processor specific, but have a look at [GNU C Atomic Builtins](http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html).
I think there are also atomic "libraries" available that use inline assembly etc. to provide such features. | The current C and C++ standards don't define such a thing. Your implementation may well have one. |
1,694,963 | **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ? | 2009/11/08 | [
"https://Stackoverflow.com/questions/1694963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171461/"
] | GLib has functions to do this. You might check out [<http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html>](http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html)
Specifically, it sounds like you want g\_atomic\_int\_inc() | The current C and C++ standards don't define such a thing. Your implementation may well have one. |
1,694,963 | **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ? | 2009/11/08 | [
"https://Stackoverflow.com/questions/1694963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171461/"
] | 2021 answer
-----------
### C++
12 years have passed since the other answers and it is now in the standard and it is possible to do this since C++11 using the [atomic operations library](https://en.cppreference.com/w/cpp/atomic/atomic/operator_arith).
```cpp
#include <iostream>
#include <atomic>
int main() {
st... | The current C and C++ standards don't define such a thing. Your implementation may well have one. |
1,694,963 | **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ? | 2009/11/08 | [
"https://Stackoverflow.com/questions/1694963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171461/"
] | GLib has functions to do this. You might check out [<http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html>](http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html)
Specifically, it sounds like you want g\_atomic\_int\_inc() | I think these are GNU extensions, and processor specific, but have a look at [GNU C Atomic Builtins](http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html).
I think there are also atomic "libraries" available that use inline assembly etc. to provide such features. |
1,694,963 | **UPDATED:** Is there a thread-safe, lock-free and available on all Linux distros *increment* function available in C or C++ ? | 2009/11/08 | [
"https://Stackoverflow.com/questions/1694963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/171461/"
] | GLib has functions to do this. You might check out [<http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html>](http://library.gnome.org/devel/glib/stable/glib-Atomic-Operations.html)
Specifically, it sounds like you want g\_atomic\_int\_inc() | 2021 answer
-----------
### C++
12 years have passed since the other answers and it is now in the standard and it is possible to do this since C++11 using the [atomic operations library](https://en.cppreference.com/w/cpp/atomic/atomic/operator_arith).
```cpp
#include <iostream>
#include <atomic>
int main() {
st... |
73,856,004 | I have a problem with a download button. If I reload the page, the onClick={() => ExportAll(data)} works fine the first time when pressing the download button, however when I try it after that the console throws this error:
[](https://i.stack.imgur.com/Dxfy... | 2022/09/26 | [
"https://Stackoverflow.com/questions/73856004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17318939/"
] | ```
const exportAll = (data) => {
const arr = []
data.map((element) => {
let newElement = { ...element}
newElement.orderlines = element?.orderlines?.join(' , ')
arr.push(newElement)
}
);
exportFileAsXLSX(arr, `Meest recente orders-${props.timespan}`);
... | Is orderlines an array? Cause you can only use join() if it is indeed an array!
Double check if it's not an object. |
511,842 | I know there was an old bug back during Ubuntu 9.x where the cursor wouldn't change because of compiz. I am now running Ubuntu 14.04 and the bug has now decided to rear its ugly head again. I am using an old cursor that looked decent with a theme and I now switched themes and my current cursor doesn't look good with it... | 2014/08/15 | [
"https://askubuntu.com/questions/511842",
"https://askubuntu.com",
"https://askubuntu.com/users/316050/"
] | The default setting in Debian (and hence Ubuntu) for OpenSSH Server is to deny password-based login for root and allow only key-based login. Change this line in `/etc/ssh/sshd_config`:
```
PermitRootLogin without-password
```
to
```
PermitRootLogin yes
```
And restart the SSH server:
```
sudo service ssh restar... | Hackers will bang away with root user trying to brute force their way in. If you are going to allow root logins, you should definitely install Fail2Ban, or something similar to protect against brute force attacks. Also use a very hard to guess password without the use of common words.
And, as Vaindil pointed out, a k... |
511,842 | I know there was an old bug back during Ubuntu 9.x where the cursor wouldn't change because of compiz. I am now running Ubuntu 14.04 and the bug has now decided to rear its ugly head again. I am using an old cursor that looked decent with a theme and I now switched themes and my current cursor doesn't look good with it... | 2014/08/15 | [
"https://askubuntu.com/questions/511842",
"https://askubuntu.com",
"https://askubuntu.com/users/316050/"
] | The default setting in Debian (and hence Ubuntu) for OpenSSH Server is to deny password-based login for root and allow only key-based login. Change this line in `/etc/ssh/sshd_config`:
```
PermitRootLogin without-password
```
to
```
PermitRootLogin yes
```
And restart the SSH server:
```
sudo service ssh restar... | To me, works changing (Ubuntu 18.04):
* `sudo nano /etc/ssh/sshd_config`
---
* `PermitRootLogin prohibit-password` to `PermitRootLogin yes`
* `PasswordAuthentication no` to `PasswordAuthentication yes`
---
then, restart ssh service:
* `sudo service ssh restart`
Thanks! |
511,842 | I know there was an old bug back during Ubuntu 9.x where the cursor wouldn't change because of compiz. I am now running Ubuntu 14.04 and the bug has now decided to rear its ugly head again. I am using an old cursor that looked decent with a theme and I now switched themes and my current cursor doesn't look good with it... | 2014/08/15 | [
"https://askubuntu.com/questions/511842",
"https://askubuntu.com",
"https://askubuntu.com/users/316050/"
] | To me, works changing (Ubuntu 18.04):
* `sudo nano /etc/ssh/sshd_config`
---
* `PermitRootLogin prohibit-password` to `PermitRootLogin yes`
* `PasswordAuthentication no` to `PasswordAuthentication yes`
---
then, restart ssh service:
* `sudo service ssh restart`
Thanks! | Hackers will bang away with root user trying to brute force their way in. If you are going to allow root logins, you should definitely install Fail2Ban, or something similar to protect against brute force attacks. Also use a very hard to guess password without the use of common words.
And, as Vaindil pointed out, a k... |
9,533 | In French, what is the plural of “un document texte”? Is it “des documents texte” or “des documents textes”? I think it is the former, but I am not sure. Additionally, can you explain to me how the “s” works in French for the second word in general ? | 2014/05/03 | [
"https://french.stackexchange.com/questions/9533",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/-1/"
] | Si j'interprète correctement l'[avis de l'Académie](http://www.academie-francaise.fr/la-langue-francaise/questions-de-langue#13_strong-em-apposition-les-danseuses-toiles-regardent-des-films-culte-em-strong) à ce sujet :
>
> Au pluriel, dans des syntagmes comme *danseuse étoile*, *film culte*, *produit phare* ou *mot ... | “Document texte” itself isn't a real composite word, so the answer would be ”Documents texte“, as it's just a shortener for “Documents (de type/having the type) texte”.
Anyway, we can find [a sheet here](http://www.journaldunet.com/management/efficacite-personnelle/orthographe-les-pieges-a-eviter/des-pluriels-trompeur... |
20,959,442 | I'm creating a small application learning about Java threading. I want to have a thread running that will analyze a small piece of data (a poker hand), and output a display message when the hand is detected to be a winning hand.
I already have the part completed that generates hands until the deck is empty, I just nee... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20959442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | You probably want to use a couple of [BlockingQueue](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html)s. Have the thread that generates hands stick the hands in one queue. The thread checking hands polls that queue and checks any hands it finds. Then it writes the results to a 2nd queue ... | There are many ways to accomplish this.
A simple approach might be to create a `Queue` that you pass in a reference to via the `ThreadWin` constructor.
Then you just add the objects you wish to pass to the queue from the main thread, and listen for new objects on the queue in your `ThreadWin` thread. In particular... |
20,959,442 | I'm creating a small application learning about Java threading. I want to have a thread running that will analyze a small piece of data (a poker hand), and output a display message when the hand is detected to be a winning hand.
I already have the part completed that generates hands until the deck is empty, I just nee... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20959442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | You probably want to use a couple of [BlockingQueue](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html)s. Have the thread that generates hands stick the hands in one queue. The thread checking hands polls that queue and checks any hands it finds. Then it writes the results to a 2nd queue ... | It sounds like you may want your "ThreadWin" to observe (<http://en.wikipedia.org/wiki/Observer_pattern>) the DeckHandler
Basically, the ThreadWin thread will "register" with the DeckHandler so it gets notified when the DeckHandler gets a new batch of PokerHands.
When the ThreadWin thread is notified it will "stop re... |
20,959,442 | I'm creating a small application learning about Java threading. I want to have a thread running that will analyze a small piece of data (a poker hand), and output a display message when the hand is detected to be a winning hand.
I already have the part completed that generates hands until the deck is empty, I just nee... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20959442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | You probably want to use a couple of [BlockingQueue](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html)s. Have the thread that generates hands stick the hands in one queue. The thread checking hands polls that queue and checks any hands it finds. Then it writes the results to a 2nd queue ... | You can use [BlockingQueue](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html) to create simple consumer-producer scenario, there is even a simple example in the documentation.
You should also read [this](http://docs.oracle.com/javase/tutorial/essential/concurrency/) to have a better un... |
20,959,442 | I'm creating a small application learning about Java threading. I want to have a thread running that will analyze a small piece of data (a poker hand), and output a display message when the hand is detected to be a winning hand.
I already have the part completed that generates hands until the deck is empty, I just nee... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20959442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | There are many ways to accomplish this.
A simple approach might be to create a `Queue` that you pass in a reference to via the `ThreadWin` constructor.
Then you just add the objects you wish to pass to the queue from the main thread, and listen for new objects on the queue in your `ThreadWin` thread. In particular... | It sounds like you may want your "ThreadWin" to observe (<http://en.wikipedia.org/wiki/Observer_pattern>) the DeckHandler
Basically, the ThreadWin thread will "register" with the DeckHandler so it gets notified when the DeckHandler gets a new batch of PokerHands.
When the ThreadWin thread is notified it will "stop re... |
20,959,442 | I'm creating a small application learning about Java threading. I want to have a thread running that will analyze a small piece of data (a poker hand), and output a display message when the hand is detected to be a winning hand.
I already have the part completed that generates hands until the deck is empty, I just nee... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20959442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16631/"
] | There are many ways to accomplish this.
A simple approach might be to create a `Queue` that you pass in a reference to via the `ThreadWin` constructor.
Then you just add the objects you wish to pass to the queue from the main thread, and listen for new objects on the queue in your `ThreadWin` thread. In particular... | You can use [BlockingQueue](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html) to create simple consumer-producer scenario, there is even a simple example in the documentation.
You should also read [this](http://docs.oracle.com/javase/tutorial/essential/concurrency/) to have a better un... |
68,124,046 | The below will only print 'try again' or follow the exit path. How do I meet the two word criteria (IE 'go' and 'north' for the if statement) on the first two statements, while also being able to meet the single word criteria of the 'exit' elif statement.
```
proceed = ['go', 'walk', 'travel', 'move']
direction = ['no... | 2021/06/25 | [
"https://Stackoverflow.com/questions/68124046",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16310941/"
] | It's an issue with string/boolean parsing.
This is an example of your current code:
```
document.getElementById('milkLover').checked = output_data_lines[i].split('|')[1];
```
Which is effectively translating to this, which is incorrect:
```
document.getElementById('milkLover').checked = 'false';
```
It should be... | If you write a boolean propery to your text file it becomes a string, e.g.
false -> "false".
And if you cast a string into a boolean (checked) "false" becomes !!"false" == true |
56,756,020 | I am trying to replicate this loop as an IQueryable:
```
foreach (var book in BookList)
{
foreach (var a in book.Authors)
{
if (a.AuthorId.ToString() == Id)
{
AuthorView = new AuthorViewModel(a, item.BookId);
}
... | 2019/06/25 | [
"https://Stackoverflow.com/questions/56756020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10972795/"
] | Try to do like this:
```
public function show($id)
{
$user = Auth::user();
$order = Order::with(['orderLines', 'orderLines.product'])
->where('user_id', '=', $user->id)
->findOrFail($id);
return view('layouts/order/index', compact('order'));
... | Hello Dezaley and welcome to StackOverflow!
Let's investigate your problem.
As far as I can see you are selecting the model in the wrong way. Let me help you:
```php
$order = Order::where(['id' => $id, 'user_id' => $user->id])->with('orderLine.product')->firstOrFail();
``` |
56,756,020 | I am trying to replicate this loop as an IQueryable:
```
foreach (var book in BookList)
{
foreach (var a in book.Authors)
{
if (a.AuthorId.ToString() == Id)
{
AuthorView = new AuthorViewModel(a, item.BookId);
}
... | 2019/06/25 | [
"https://Stackoverflow.com/questions/56756020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10972795/"
] | Try to do like this:
```
public function show($id)
{
$user = Auth::user();
$order = Order::with(['orderLines', 'orderLines.product'])
->where('user_id', '=', $user->id)
->findOrFail($id);
return view('layouts/order/index', compact('order'));
... | The answer from mare96, who was very friendly to help me, is working. However, I found out someting.
You can implement as (mare96 solution)
```php
public function show($id)
{
$user = Auth::user();
$order = Order::with(['orderLines', 'orderLines.product'])
->where('user_id', ... |
56,756,020 | I am trying to replicate this loop as an IQueryable:
```
foreach (var book in BookList)
{
foreach (var a in book.Authors)
{
if (a.AuthorId.ToString() == Id)
{
AuthorView = new AuthorViewModel(a, item.BookId);
}
... | 2019/06/25 | [
"https://Stackoverflow.com/questions/56756020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10972795/"
] | Try to do like this:
```
public function show($id)
{
$user = Auth::user();
$order = Order::with(['orderLines', 'orderLines.product'])
->where('user_id', '=', $user->id)
->findOrFail($id);
return view('layouts/order/index', compact('order'));
... | give it a try -
```
@foreach($order as $ordr)
<tr>
<td>{{$ordr->product_id->name}}</td>
<tr>
@endforeach
``` |
50,250,475 | I have the following scala object definition:
```
case class RecursiveSettings (
var recursiveFrom: Int,
var recursiveTo: Int,
var nonRecursiveFrom: Int,
var nonRecursiveTo: Int,
var betweenReach: Int,
var scoresamephrase: Boolean
)
```
and I'm trying to get the variables from an ArrayBuf... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50250475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9437756/"
] | Still you have selected the answer I would like to answer on your last desire that you want this to work in a proper way that WordPress do. Please check **wp\_footer** is called before **body** tag closed or not. Action Hook **wp\_enqueue\_scripts** will called in **wp\_footer** function. Please try once and let me kno... | You can get css file from below code:
```
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.