qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
68,313,317 | I currently have the following Sankey Diagram:
[](https://i.stack.imgur.com/4OcDU.png)
I would like to ensure that the nodes that start with C0 are always on top. The nodes with c1 are always on the bottom, and the nodes with C2 are in between (when ... | 2021/07/09 | [
"https://Stackoverflow.com/questions/68313317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15924053/"
] | Use the below style,
**style={{ wordBreak: "break-word" }}**
```
<React.Fragment>
<tr key={record._id}>
<td>{record.category}</td>
<td>{record.name}</td>
<td
style={{ width: "200px", wordBreak: "break-word" }... | **Try this**
```
white-space: nowrap;
width: 200px; //give your size
overflow: hidden;
text-overflow: ellipsis;
``` |
44,327,357 | I want to write a function that removes spaces between isolated letters, like in an acronym.
For example, if I have:
```
'I B M Computers' i need to have in return 'IBM Computers'
' I B M ' => 'IBM'
'Computers A B' => 'Computers AB'
'Computers A BC' => 'Computers A BC' (nothing changes)
'Computers A B CD' => 'Compute... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44327357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6389873/"
] | The regex as described in this post should work for you (with a little tweaking of the regex for MariaDB). From that post by @Alan Moore:
"It looks to me like you want to remove any space that is (1) preceded by a letter which is not itself preceded by a letter, and (2) followed by a letter which is not itself followed... | Try using ltrim and rtrim functions.
Example:
Update 'table' Set campo=ltrim(rtrim(campo)) |
44,327,357 | I want to write a function that removes spaces between isolated letters, like in an acronym.
For example, if I have:
```
'I B M Computers' i need to have in return 'IBM Computers'
' I B M ' => 'IBM'
'Computers A B' => 'Computers AB'
'Computers A BC' => 'Computers A BC' (nothing changes)
'Computers A B CD' => 'Compute... | 2017/06/02 | [
"https://Stackoverflow.com/questions/44327357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6389873/"
] | The regex as described in this post should work for you (with a little tweaking of the regex for MariaDB). From that post by @Alan Moore:
"It looks to me like you want to remove any space that is (1) preceded by a letter which is not itself preceded by a letter, and (2) followed by a letter which is not itself followed... | Use the replace function to strip spaces out of both sides of the comparison.
But do note that this will be inefficient, as your query will not be able to use indexes
```
REPLACE(mystring,' ','')
```
<https://learn.microsoft.com/en-us/sql/t-sql/functions/replace-transact-sql> |
46,865,803 | i saw similar questions, but not found accepted answers.
Problem - i have my own android library with some tiny functions.
My library uses others - f.e. Hawk (no sql database).
My library gradle file:
```
apply plugin: 'com.android.library'
buildscript {
repositories {
maven { url "https://www.jitpack.io" ... | 2017/10/21 | [
"https://Stackoverflow.com/questions/46865803",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4182946/"
] | >
> what should i do to make my main project see my library's third party dependencies?
>
>
>
The **aar** file **doesn't contain the [transitive](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies) dependencies** and doesn't have a pom file which describ... | Another way to solve the problem of dependencies is to get the *jar* files of the dependencies you want to use and place them in the libs folder of your module. This will copy all the your dependency *jars* into your library's jar or aar.
Note that I have emphasized jar because you cannot include aar file in libs fol... |
188,808 | I am using `listings` package and facing two issues
Following is the LaTeX code and output
```
\lstset{language=Java, basicstyle=\small, frame=single, breaklines=true, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookrightarrow\space}}}
\begin{lstlisting}[caption={Utils.java},label={lst:JOOQ-LGRN}]
CATCH CLAUSE ... | 2014/07/10 | [
"https://tex.stackexchange.com/questions/188808",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/56854/"
] | The “explicit space” symbols are due to the setting `showstringspaces=true` that's the default with `lstlisting`.
The `IEEEtran` class knows just two types of captions, those for tables and those for figures. If an environment is not `table`, the class assumes the caption is for a figure, so it adjusts the spacing for... | 1. This is because the Java language in `listings` has
```
morestring=[b]",%
```
(this can be found in the file `lstlang1.sty`) to avoid this, you can use `deletestring`, as in:
```
deletestring=[b]",
```
Since the language also sets
```
morestring=[b]',%
```
you might also be interested in
```
deletestring=... |
44,639,092 | Can anyone tell me how to disable my parallax effect on mobile? Thank you for your help in advance!
Here is my code:
```
$(document).scroll(function() {
var y = $(document).scrollTop(), header = $(".page-nav"); if(y >= 528)
{ header.css({position: "fixed", "top" : "0", "left" : "0"}); } else
{header.css("position"... | 2017/06/19 | [
"https://Stackoverflow.com/questions/44639092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8184980/"
] | This will print `Error!` 20 times (on 20 lines/rows), over a duration of 20 seconds
```
import time
for _ in range(20):
print("Error!")
time.sleep(1) # change 1 to whatever number you want, to control the amount of time before "Error!" is printed again
```
This will print "Error!" 20 times on the same line... | ```
import time
for _ in range(20):
print('Error!', end=' ', flush=True) # flush courtesy inspectorG4dget to disable buffering
time.sleep(0.2)
```
This'll print 'Error!' every 200 milliseconds on the same line (...20 times). Change that `for` to a `while` for better control over the stopping condition. |
44,639,092 | Can anyone tell me how to disable my parallax effect on mobile? Thank you for your help in advance!
Here is my code:
```
$(document).scroll(function() {
var y = $(document).scrollTop(), header = $(".page-nav"); if(y >= 528)
{ header.css({position: "fixed", "top" : "0", "left" : "0"}); } else
{header.css("position"... | 2017/06/19 | [
"https://Stackoverflow.com/questions/44639092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8184980/"
] | ```
import time
for _ in range(20):
print('Error!', end=' ', flush=True) # flush courtesy inspectorG4dget to disable buffering
time.sleep(0.2)
```
This'll print 'Error!' every 200 milliseconds on the same line (...20 times). Change that `for` to a `while` for better control over the stopping condition. | ```
import time
for i in range(20):
print ("Error!")
time.sleep(60) #pause for one minute
```
You can use a for loop to choose the number of times to print, and `sleep()` from the time library to do the pausing. |
44,639,092 | Can anyone tell me how to disable my parallax effect on mobile? Thank you for your help in advance!
Here is my code:
```
$(document).scroll(function() {
var y = $(document).scrollTop(), header = $(".page-nav"); if(y >= 528)
{ header.css({position: "fixed", "top" : "0", "left" : "0"}); } else
{header.css("position"... | 2017/06/19 | [
"https://Stackoverflow.com/questions/44639092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8184980/"
] | This will print `Error!` 20 times (on 20 lines/rows), over a duration of 20 seconds
```
import time
for _ in range(20):
print("Error!")
time.sleep(1) # change 1 to whatever number you want, to control the amount of time before "Error!" is printed again
```
This will print "Error!" 20 times on the same line... | ```
import time
for i in range(20):
print ("Error!")
time.sleep(60) #pause for one minute
```
You can use a for loop to choose the number of times to print, and `sleep()` from the time library to do the pausing. |
23,485,932 | This is probably an unusual case as I'm trying to define a new Proxy Endpoint in an API Proxy.
Let's say I have a `default` Proxy Endpoint with a Conditional Flow to match `/myflow` and `action == GET` and that works fine.
then I defined a new Proxy Endpoint (`new_endpoint`) with its own Conditional Flow to match `/m... | 2014/05/06 | [
"https://Stackoverflow.com/questions/23485932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/918858/"
] | Looks like you're missing your <RouteRule> in your proxy. Just like the ConditionalFlow, you need a second RouteRule to point to your new target, which would look something like this:
```
<HTTPProxyConnection>
<BasePath>/v2</BasePath>
<Properties/>
<VirtualHost>default</VirtualHost>
<VirtualHost>secure... | I learned something today: apparently it's `HttpProxyConnection/BasePath` dictates which Proxy Endpoint is selected
as soon as made sure that the `BasePath` is different for both endpoints, routing started the way I expected it to. |
71,102,253 | 1. `gcloud builds submit` failed for me yesterday.
2. Then I tried `gcloud config set project`, that also failed.
3. So I thought login might have expired so tried `gcloud auth login`.
In all cases, it always throws following error:
```
ERROR: gcloud crashed (ConnectionError): HTTPSConnectionPool(host='oauth2.googlea... | 2022/02/13 | [
"https://Stackoverflow.com/questions/71102253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9560672/"
] | This problem is with Airtel India ISP and not Google Cloud CLI. Use a VPN, and it will work. | connect to a VPN
or
mac users enable Private Relay(Beta) in icloud setting |
71,102,253 | 1. `gcloud builds submit` failed for me yesterday.
2. Then I tried `gcloud config set project`, that also failed.
3. So I thought login might have expired so tried `gcloud auth login`.
In all cases, it always throws following error:
```
ERROR: gcloud crashed (ConnectionError): HTTPSConnectionPool(host='oauth2.googlea... | 2022/02/13 | [
"https://Stackoverflow.com/questions/71102253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9560672/"
] | This problem is with Airtel India ISP and not Google Cloud CLI. Use a VPN, and it will work. | The same problem happened to me and it was a proxy issue
I followed the steps to unset the proxy
```
gcloud config unset proxy/type
gcloud config unset proxy/address
gcloud config unset proxy/port
```
reference: <https://cloud.google.com/sdk/gcloud/reference/config/unset> |
71,102,253 | 1. `gcloud builds submit` failed for me yesterday.
2. Then I tried `gcloud config set project`, that also failed.
3. So I thought login might have expired so tried `gcloud auth login`.
In all cases, it always throws following error:
```
ERROR: gcloud crashed (ConnectionError): HTTPSConnectionPool(host='oauth2.googlea... | 2022/02/13 | [
"https://Stackoverflow.com/questions/71102253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9560672/"
] | The same problem happened to me and it was a proxy issue
I followed the steps to unset the proxy
```
gcloud config unset proxy/type
gcloud config unset proxy/address
gcloud config unset proxy/port
```
reference: <https://cloud.google.com/sdk/gcloud/reference/config/unset> | connect to a VPN
or
mac users enable Private Relay(Beta) in icloud setting |
31,280,115 | Please help me. Is there a way how I can use a collection which is shared between all the Servlet instances?
I know I can save a string in HttpRequestContext but how can I store a collection? I know I could use a database but I'd prefer to store everything in memory
```
public class Servlet extends HttpServlet {
... | 2015/07/07 | [
"https://Stackoverflow.com/questions/31280115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1805274/"
] | You can save any object in the request, response or in the session. When you retrieve it, you just have to cast it back the correct class. | It depends on where do you want to store:
* `ServletContext.setAttribute()`: for lifetime of application.
* `HttpServletRequest.setAttribute()`: for lifetime of request. This will not be available for further requests.
* `HttpServletSession.setAttribute()`: for lifetime of user session scope. This will be available on... |
31,280,115 | Please help me. Is there a way how I can use a collection which is shared between all the Servlet instances?
I know I can save a string in HttpRequestContext but how can I store a collection? I know I could use a database but I'd prefer to store everything in memory
```
public class Servlet extends HttpServlet {
... | 2015/07/07 | [
"https://Stackoverflow.com/questions/31280115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1805274/"
] | You can store it in the session - quite common. But also in some public static Collection in an external class - for the sake of example Util.myCollection. Be careful though, servlets should be thread-safe and stateless, so the latter can be easily considered as an anti-patttern - you can get into lot of trouble doing ... | It depends on where do you want to store:
* `ServletContext.setAttribute()`: for lifetime of application.
* `HttpServletRequest.setAttribute()`: for lifetime of request. This will not be available for further requests.
* `HttpServletSession.setAttribute()`: for lifetime of user session scope. This will be available on... |
3,985,037 | first of all here is my code in question:
```
var geocoder;
var map;
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 18,
center: latlng,
mapTypeId: google.maps.MapTypeId.HYBRID
}
map = new google.... | 2010/10/21 | [
"https://Stackoverflow.com/questions/3985037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/267490/"
] | I got it
```
UIView *backView = [[UIView alloc] initWithFrame:CGRectZero];
backView.backgroundColor = [UIColor clearColor];
tableview.backgroundView = backView;
[backView release];
``` | Just posting because i found other way.
I used UITableView.separatorColor property and set color same as background color of cell.
It will make it easier for those who are using default cell properties |
32,485,815 | I'm working on a small .Net project, I used in my project EntityFramework with MySQL server, i tried the official Full MySQL installer, but i need only the server from that package to reduce the size of my application installer, like that used in PHPMyAdmin Installer, please show me how/where find that. | 2015/09/09 | [
"https://Stackoverflow.com/questions/32485815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3590138/"
] | No minimal installation is available from MySQL's site. They used to have an *essentials* version, but it's unavailable for versions >5.1.
One solution to your case is to create your own installation - it's not very complicated. The process (in general) is to include `bin`,`data`,`lib`, and `share` folders from a clea... | there are smaller versions, about 32.1MB it only allows you just to install the base server and configure the instance, you can use things like NAVICAT to manage it, have been using it for a lot of my .NET projects and it has been working very well
you can get it from <https://filehippo.com/download_mysql/> |
32,561,848 | I have trouble finding information about how to develop a Google (Marketplace) Chrome Web Store Web App.
I want to develop a simple "list info about all users in the domain, and let them add info about themselves through some web interface"-web-app.
And eventually i want to publish it in the Marketplace/Chrome Web St... | 2015/09/14 | [
"https://Stackoverflow.com/questions/32561848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5333244/"
] | Updated example with requirements: <https://jsfiddle.net/ozvkdw1p/1/>
```
$(function() {
var $col = $(".column")
//grab first attribute of first element, extract values
var initAttr = $("div", $col).get(0).attributes[0]
var initName = parseInt(initAttr.name.split("-")[1])
var initValue = parseInt(i... | You could archive this more easier using AngularJS framework. With this is is quite easy to combine javascript values with hmtl (-attributes, .. ) |
32,561,848 | I have trouble finding information about how to develop a Google (Marketplace) Chrome Web Store Web App.
I want to develop a simple "list info about all users in the domain, and let them add info about themselves through some web interface"-web-app.
And eventually i want to publish it in the Marketplace/Chrome Web St... | 2015/09/14 | [
"https://Stackoverflow.com/questions/32561848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5333244/"
] | This is one of the ways to do it. Look for comments inline.
```
//All columns
var $columns = $(".column");
//Grab the first div from the first column
var $firstColumnFirstChild = $columns.first().find("div").first();
//Grab the data attribute name (0) from '$firstColumnFirstChild' and convert it to number
var $firstCo... | You could archive this more easier using AngularJS framework. With this is is quite easy to combine javascript values with hmtl (-attributes, .. ) |
32,561,848 | I have trouble finding information about how to develop a Google (Marketplace) Chrome Web Store Web App.
I want to develop a simple "list info about all users in the domain, and let them add info about themselves through some web interface"-web-app.
And eventually i want to publish it in the Marketplace/Chrome Web St... | 2015/09/14 | [
"https://Stackoverflow.com/questions/32561848",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5333244/"
] | This is one of the ways to do it. Look for comments inline.
```
//All columns
var $columns = $(".column");
//Grab the first div from the first column
var $firstColumnFirstChild = $columns.first().find("div").first();
//Grab the data attribute name (0) from '$firstColumnFirstChild' and convert it to number
var $firstCo... | Updated example with requirements: <https://jsfiddle.net/ozvkdw1p/1/>
```
$(function() {
var $col = $(".column")
//grab first attribute of first element, extract values
var initAttr = $("div", $col).get(0).attributes[0]
var initName = parseInt(initAttr.name.split("-")[1])
var initValue = parseInt(i... |
62,270,350 | I was following a tutorial at [Authentication in NodeJS With Express and Mongo - CodeLab #1](https://dev.to/dipakkr/implementing-authentication-in-nodejs-with-express-and-jwt-codelab-1-j5i)
I got everything to work perfectly, but the tutorial does not address how to log out a user.
From what I can tell, the session ... | 2020/06/08 | [
"https://Stackoverflow.com/questions/62270350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1561777/"
] | From what I see, you are not saving any session data or storing tokens anywhere - which is great. You are simply appending the token to your headers in requests to the API.
So the only thing you can do is possibly expire the token in the `/logout route`
and then ensure you delete the token on the client - could be loc... | As you have used JWT the backend will always check 2 things
1. Proper token
2. If time is over for that particular (You should handle this one)
For 2nd point, if the user time is up than from frontend you may delete the token if you have stored the token in localstorage.
For logout when user clicks on logout just d... |
22,844,998 | We want to run a php script on our server to insert data (in the variable nameValuePairs) into our database using HttpClient and HttpPost.
If we create the following code as an Android Application with Idea IntelliJ, it works just fine.
But if it's created in Eclipse the App crashes at the .execute() method and throws ... | 2014/04/03 | [
"https://Stackoverflow.com/questions/22844998",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2306363/"
] | You should make your HTTP request in a separate thread. `NetworkOnMainThreadException` says that you are trying to make your network operation on the main thread.
[docs at developer.android.com](http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html)
1] Use simple Thread
```
Thread t... | `android.os.NetworkOnMainThreadException` throws because you are performing network operation on `main thread` .thats why its get crashed.
move your network call code in `Asyntask` `doInBackGround` method and then try
```
private class LongOperation extends AsyncTask<Void, Void, Void> {
@Override
protected v... |
440,496 | >
> $a, b, c, d$ are positive integers, $a-c|a b+c d$, and then $a-c|a d+b c$
>
>
>
proof: really easy when use $a b+c d-(a d+b c)$
---
however my first thought is, $a-c| a b+c d+k(a-c)$, and set some $k$ to prove, failed.
*question1* : is this method could be done? any other methods?
*question2* : `And` is th... | 2013/07/10 | [
"https://math.stackexchange.com/questions/440496",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/76942/"
] | HINT:
$$ab+cd-(ad+bc)=b(a-c)-d(a-c)=(a-c)(b-d)$$
Alternatively, $$ab+cd=b(a-c)+bc-(a-c)d+ad=(a-c)(b-d)+ad+bc$$ we are reaching at the same point | As lab gave you the $k$ which works for question 1, here is the answer to question 2:
$$\det \begin{pmatrix} a & d \\-c& b \end{pmatrix} = \det \begin{pmatrix} a & b \\-c & d \end{pmatrix}+\det \begin{pmatrix} a & d-b \\-c & b-d \end{pmatrix}$$
$$ = \det \begin{pmatrix} a & b \\-c & d \end{pmatrix}+(b-d)\det \begin{pm... |
168 | Is it possible to generate and export a report for each person in my family tree? I see how I can view, export and save a snapshot to for later use, but how can I automate the process of creating a report for all individuals in my tree? | 2012/10/10 | [
"https://genealogy.stackexchange.com/questions/168",
"https://genealogy.stackexchange.com",
"https://genealogy.stackexchange.com/users/35/"
] | Marriage banns are an announcement of an intended marriage. In some times and places and religions the banns had to be "published" one or more times before the marriage could occur. The purpose of the banns was to allow anyone with objections or anyone believing there were impediments to the marriage to come forward. T... | As Tom Wetmore says [here](https://genealogy.stackexchange.com/a/163/104), Banns in England and Wales are an announcement of an intended marriage in a Parish Church. Banns needed to be published twice, a week apart, in the parishes of both bride and groom, before the wedding in the third week (in one of the parishes, m... |
168 | Is it possible to generate and export a report for each person in my family tree? I see how I can view, export and save a snapshot to for later use, but how can I automate the process of creating a report for all individuals in my tree? | 2012/10/10 | [
"https://genealogy.stackexchange.com/questions/168",
"https://genealogy.stackexchange.com",
"https://genealogy.stackexchange.com/users/35/"
] | Marriage banns are an announcement of an intended marriage. In some times and places and religions the banns had to be "published" one or more times before the marriage could occur. The purpose of the banns was to allow anyone with objections or anyone believing there were impediments to the marriage to come forward. T... | ColeValleyGirl cautions against misinterpreting banns records with no corresponding marriage record. This is more complicated when the couple to be married did not live in the same parish.
Banns were read in (and recorded in the register of) both parishes to ensure that all relevant parties knew of the intention to ma... |
168 | Is it possible to generate and export a report for each person in my family tree? I see how I can view, export and save a snapshot to for later use, but how can I automate the process of creating a report for all individuals in my tree? | 2012/10/10 | [
"https://genealogy.stackexchange.com/questions/168",
"https://genealogy.stackexchange.com",
"https://genealogy.stackexchange.com/users/35/"
] | Marriage banns are an announcement of an intended marriage. In some times and places and religions the banns had to be "published" one or more times before the marriage could occur. The purpose of the banns was to allow anyone with objections or anyone believing there were impediments to the marriage to come forward. T... | The marriage took place at All Saints Poplar 26th November 1825
(image on Ancestry from LMA collection)
Banns are valid for three months after calling
Banns would be posted or called at the Parish of residence of both parties, qualifying residence could be a little as three weeks and may be no indication of birth Par... |
168 | Is it possible to generate and export a report for each person in my family tree? I see how I can view, export and save a snapshot to for later use, but how can I automate the process of creating a report for all individuals in my tree? | 2012/10/10 | [
"https://genealogy.stackexchange.com/questions/168",
"https://genealogy.stackexchange.com",
"https://genealogy.stackexchange.com/users/35/"
] | As Tom Wetmore says [here](https://genealogy.stackexchange.com/a/163/104), Banns in England and Wales are an announcement of an intended marriage in a Parish Church. Banns needed to be published twice, a week apart, in the parishes of both bride and groom, before the wedding in the third week (in one of the parishes, m... | ColeValleyGirl cautions against misinterpreting banns records with no corresponding marriage record. This is more complicated when the couple to be married did not live in the same parish.
Banns were read in (and recorded in the register of) both parishes to ensure that all relevant parties knew of the intention to ma... |
168 | Is it possible to generate and export a report for each person in my family tree? I see how I can view, export and save a snapshot to for later use, but how can I automate the process of creating a report for all individuals in my tree? | 2012/10/10 | [
"https://genealogy.stackexchange.com/questions/168",
"https://genealogy.stackexchange.com",
"https://genealogy.stackexchange.com/users/35/"
] | As Tom Wetmore says [here](https://genealogy.stackexchange.com/a/163/104), Banns in England and Wales are an announcement of an intended marriage in a Parish Church. Banns needed to be published twice, a week apart, in the parishes of both bride and groom, before the wedding in the third week (in one of the parishes, m... | The marriage took place at All Saints Poplar 26th November 1825
(image on Ancestry from LMA collection)
Banns are valid for three months after calling
Banns would be posted or called at the Parish of residence of both parties, qualifying residence could be a little as three weeks and may be no indication of birth Par... |
11,167,566 | >
> **Possible Duplicate:**
>
> [Avoid synchronized(this) in Java?](https://stackoverflow.com/questions/442564/avoid-synchronizedthis-in-java)
>
>
>
What is the difference between the two pieces of code ? What are advantages and disadvantages of each?
1)
```
public class Example {
private int value = 0;
... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11167566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163607/"
] | I would prefer the second option if I need to execute **two different tasks simultaneously which are independent of each other.**
e.g.:
```
public class Example {
private int value = 0;
private int new_value = 0;
private final Object lock1 = new Object();
private final Object lock2 = new Object();
... | I would say the second method is better. Consider the following situation:
```
public class Abc{
private int someVariable;
public class Xyz {
//some method,synchronize on this
}
//some method, and again synchronize on this
}
```
In this situation `this` is not the same in the two meth... |
11,167,566 | >
> **Possible Duplicate:**
>
> [Avoid synchronized(this) in Java?](https://stackoverflow.com/questions/442564/avoid-synchronizedthis-in-java)
>
>
>
What is the difference between the two pieces of code ? What are advantages and disadvantages of each?
1)
```
public class Example {
private int value = 0;
... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11167566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163607/"
] | The main reason why I would choose the 2nd approach is that I do not control what the clients do with the instances of my class.
If, for some reason, somebody decides to use an instance of my class as a lock, they will interfere with the synchronization logic within my class:
```
class ClientCode {
Example exampl... | I would say the second method is better. Consider the following situation:
```
public class Abc{
private int someVariable;
public class Xyz {
//some method,synchronize on this
}
//some method, and again synchronize on this
}
```
In this situation `this` is not the same in the two meth... |
11,167,566 | >
> **Possible Duplicate:**
>
> [Avoid synchronized(this) in Java?](https://stackoverflow.com/questions/442564/avoid-synchronizedthis-in-java)
>
>
>
What is the difference between the two pieces of code ? What are advantages and disadvantages of each?
1)
```
public class Example {
private int value = 0;
... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11167566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163607/"
] | The main reason why I would choose the 2nd approach is that I do not control what the clients do with the instances of my class.
If, for some reason, somebody decides to use an instance of my class as a lock, they will interfere with the synchronization logic within my class:
```
class ClientCode {
Example exampl... | I would prefer the second option if I need to execute **two different tasks simultaneously which are independent of each other.**
e.g.:
```
public class Example {
private int value = 0;
private int new_value = 0;
private final Object lock1 = new Object();
private final Object lock2 = new Object();
... |
11,167,566 | >
> **Possible Duplicate:**
>
> [Avoid synchronized(this) in Java?](https://stackoverflow.com/questions/442564/avoid-synchronizedthis-in-java)
>
>
>
What is the difference between the two pieces of code ? What are advantages and disadvantages of each?
1)
```
public class Example {
private int value = 0;
... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11167566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163607/"
] | I would prefer the second option if I need to execute **two different tasks simultaneously which are independent of each other.**
e.g.:
```
public class Example {
private int value = 0;
private int new_value = 0;
private final Object lock1 = new Object();
private final Object lock2 = new Object();
... | I think it really depends on the situation. Lets say your class is a subclass and the super class has a method that has synchronization. And lets say you are working with the same data set and want to maintain integrity within your method as well. Then definitely approach 1 is what you should be using.
Otherwise seco... |
11,167,566 | >
> **Possible Duplicate:**
>
> [Avoid synchronized(this) in Java?](https://stackoverflow.com/questions/442564/avoid-synchronizedthis-in-java)
>
>
>
What is the difference between the two pieces of code ? What are advantages and disadvantages of each?
1)
```
public class Example {
private int value = 0;
... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11167566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1163607/"
] | The main reason why I would choose the 2nd approach is that I do not control what the clients do with the instances of my class.
If, for some reason, somebody decides to use an instance of my class as a lock, they will interfere with the synchronization logic within my class:
```
class ClientCode {
Example exampl... | I think it really depends on the situation. Lets say your class is a subclass and the super class has a method that has synchronization. And lets say you are working with the same data set and want to maintain integrity within your method as well. Then definitely approach 1 is what you should be using.
Otherwise seco... |
42,362,199 | I'm trying to convert a PHP variable to a JS variable so I can use it in a game I'm making. When I check the map code it is just `undefined`. Thanks in advance. FYI the PHP works.
```
<script>
var mapCode;
var used;
var active;
function downloadCode() {
$.ajax({
type: 'GET',
... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42362199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7583481/"
] | If the file extension is `.php` and not `.js` then this should work
```
<script>
function downloadCode() {
$.ajax({
type: 'GET',
url: 'getMapCode.php',
data: {
mapCode: "<?php echo $mapCode; ?>",
used: "<?php echo $used; ?>",
... | You only need to use <?php echo $mapCode;?> instead $mapCode. .... php variables can't be reed whithout open Php tag |
42,362,199 | I'm trying to convert a PHP variable to a JS variable so I can use it in a game I'm making. When I check the map code it is just `undefined`. Thanks in advance. FYI the PHP works.
```
<script>
var mapCode;
var used;
var active;
function downloadCode() {
$.ajax({
type: 'GET',
... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42362199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7583481/"
] | If the file extension is `.php` and not `.js` then this should work
```
<script>
function downloadCode() {
$.ajax({
type: 'GET',
url: 'getMapCode.php',
data: {
mapCode: "<?php echo $mapCode; ?>",
used: "<?php echo $used; ?>",
... | My current project is actually dealing with lots of ajax calls,
here is the simplified version of what I use to communicate with server:
```
// php
// needed functions
function JSONE(array $array)
{
$json_str = json_encode( $array, JSON_NUMERIC_CHECK );
if (json_last_error() == JSON_ERROR_NONE)
{
r... |
42,362,199 | I'm trying to convert a PHP variable to a JS variable so I can use it in a game I'm making. When I check the map code it is just `undefined`. Thanks in advance. FYI the PHP works.
```
<script>
var mapCode;
var used;
var active;
function downloadCode() {
$.ajax({
type: 'GET',
... | 2017/02/21 | [
"https://Stackoverflow.com/questions/42362199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7583481/"
] | If the file extension is `.php` and not `.js` then this should work
```
<script>
function downloadCode() {
$.ajax({
type: 'GET',
url: 'getMapCode.php',
data: {
mapCode: "<?php echo $mapCode; ?>",
used: "<?php echo $used; ?>",
... | How did i get you, you need to get the result from ajax request, to do it, you should first setup your php outputs your results, so the ajax can get outputed results from php like this:
```
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$servername = "localhost";
$username = "username";
$passwo... |
2,254,255 | I have the following simple script, which I am using to dynamically create the list elements in a `<ul>`
```
<script type="text/javascript">
function generate(){
var arr = new Array();
<c:forEach items="${articles}" var="a" varStatus="status">
$('#listitems').append(
"<l... | 2010/02/12 | [
"https://Stackoverflow.com/questions/2254255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127160/"
] | In EL you can use the brace notation to access a `List` element by index. Thus, the following should do:
```
arr[${status.index}] = "${a.slideShow.images[0]}";
```
This will behind the scenes do exactly as you proposed: `a.getSlideShow().getImages().get(0)`.
That said, you normally declare JS arrays like follows:
... | As those who commented on your question suggest, this is a common misunderstanding. By the time your JavaScript executes (in the browser), Java and JSP and JSTL are no longer available. The JSTL/JSP execute at the server to create source/HTML that is then sent to the client.
View source on your page - it might shed so... |
42,547,001 | I have created an ASP.NET web app for a university project and I had it all working as intended with full functionality using local mysql db. Due to reasons out of my control, I have been instructed to change the database to an access one. So I have done this, changed out the 'sql' statements for 'Oledb' ones and one h... | 2017/03/02 | [
"https://Stackoverflow.com/questions/42547001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6054355/"
] | You need another `<Resource>` for the relationship, even empty:
```
<Resource name="customers" list={CustomerList} icon={UserIcon} edit={CustomerEdit} create={CustomerCreate}/>
<Resource name="partners" />
```
It is well documented for [`<ReferenceField>`](https://marmelab.com/admin-on-rest/Fields.html#referencefiel... | You `<ReferenceInput reference="...">` needs to match the `<Resource name="...">` for this to work. So this is the reason why `reference="customers"` worked for you.
If you want to get data from `customers` endpoints, but you want the `label` to be `Partner` you can specify it as `label` attribute on your `ReferenceIn... |
42,547,001 | I have created an ASP.NET web app for a university project and I had it all working as intended with full functionality using local mysql db. Due to reasons out of my control, I have been instructed to change the database to an access one. So I have done this, changed out the 'sql' statements for 'Oledb' ones and one h... | 2017/03/02 | [
"https://Stackoverflow.com/questions/42547001",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6054355/"
] | You need another `<Resource>` for the relationship, even empty:
```
<Resource name="customers" list={CustomerList} icon={UserIcon} edit={CustomerEdit} create={CustomerCreate}/>
<Resource name="partners" />
```
It is well documented for [`<ReferenceField>`](https://marmelab.com/admin-on-rest/Fields.html#referencefiel... | The problem is probably the way you're importing your 'ReferenceInput' object. I had the same issue while creating my app and had no idea what is the problem.
Check your import line and if it looks like this:
```
import {ReferenceInput} from "../../src/mui/input/ReferenceInput";
```
then change it to look this way:... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | `String.prototype.includes` is, as you write, not supported in Internet Explorer (or Opera).
Instead you can use `String.prototype.indexOf`. `#indexOf` returns the index of the first character of the substring if it is in the string, otherwise it returns `-1`. (Much like the Array equivalent)
```
var myString = 'this... | this is because ie does not support includes so
Make a dot function and use it just like es6 includes() in es5 as below :
```
String.prototype.includes = function (str) {
return this.indexOf(str) !== -1;
}
```
Following is the string
```
var myString = 'this is my string';
```
Checking the match as following:
`... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | Or just put this in a Javascript file and have a good day :)
```
String.prototype.includes = function (str) {
var returnValue = false;
if (this.indexOf(str) !== -1) {
returnValue = true;
}
return returnValue;
}
``` | includes() is not supported by most browsers. Your options are either to use
**-polyfill from MDN**
<https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/includes>
or to use
**-indexof()**
```
var str = "abcde";
var n = str.indexOf("cd");
```
Which gives you n=2
This is widely su... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | This one may be better and shorter:
```
function stringIncludes(a, b) {
return a.indexOf(b) >= 0;
}
``` | You can do the same with !! and ~ operators
```
var myString = 'this is my string';
!!~myString.indexOf('string');
// -> true
!!~myString.indexOf('hello');
// -> false
```
here's the explanation of the two operators (!! and ~ )
[What is the !! (not not) operator in JavaScript?](https://stackoverflow.com/que... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | `String.prototype.includes` is, as you write, not supported in Internet Explorer (or Opera).
Instead you can use `String.prototype.indexOf`. `#indexOf` returns the index of the first character of the substring if it is in the string, otherwise it returns `-1`. (Much like the Array equivalent)
```
var myString = 'this... | Or just put this in a Javascript file and have a good day :)
```
String.prototype.includes = function (str) {
var returnValue = false;
if (this.indexOf(str) !== -1) {
returnValue = true;
}
return returnValue;
}
``` |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | This one may be better and shorter:
```
function stringIncludes(a, b) {
return a.indexOf(b) >= 0;
}
``` | It works for me:
```
function stringIncludes(a, b) {
return a.indexOf(b) !== -1;
}
``` |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | Or just put this in a Javascript file and have a good day :)
```
String.prototype.includes = function (str) {
var returnValue = false;
if (this.indexOf(str) !== -1) {
returnValue = true;
}
return returnValue;
}
``` | If you want to keep using the `Array.prototype.include()` in javascript you can use this script:
[github-script-ie-include](https://github.com/Mteixeira88/IE-include-script)
That converts automatically the include() to the match() function if it detects IE.
Other option is using always the`string.match(Regex(expressio... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | this is because ie does not support includes so
Make a dot function and use it just like es6 includes() in es5 as below :
```
String.prototype.includes = function (str) {
return this.indexOf(str) !== -1;
}
```
Following is the string
```
var myString = 'this is my string';
```
Checking the match as following:
`... | You can do the same with !! and ~ operators
```
var myString = 'this is my string';
!!~myString.indexOf('string');
// -> true
!!~myString.indexOf('hello');
// -> false
```
here's the explanation of the two operators (!! and ~ )
[What is the !! (not not) operator in JavaScript?](https://stackoverflow.com/que... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | Or just put this in a Javascript file and have a good day :)
```
String.prototype.includes = function (str) {
var returnValue = false;
if (this.indexOf(str) !== -1) {
returnValue = true;
}
return returnValue;
}
``` | I had the same problem when working in Angular 5. In order to make it work directly without writing a polyfill yourself, just add the following line to polyfills.ts file:
```
import "core-js/es7/array"
```
Also, `tsconfig.json` lib section might be relevant:
```
"lib": [
"es2017",
"dom"
],
``` |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | For react:
```
import 'react-app-polyfill/ie11';
import 'core-js/es5';
import 'core-js/es6';
import 'core-js/es7';
```
Issue resolve for - includes(), find(), and so on.. | this is because ie does not support includes so
Make a dot function and use it just like es6 includes() in es5 as below :
```
String.prototype.includes = function (str) {
return this.indexOf(str) !== -1;
}
```
Following is the string
```
var myString = 'this is my string';
```
Checking the match as following:
`... |
36,574,351 | This code does not work in internet explorer. Any alternative?
```
"abcde".includes("cd")
``` | 2016/04/12 | [
"https://Stackoverflow.com/questions/36574351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5872746/"
] | If you want to keep using the `Array.prototype.include()` in javascript you can use this script:
[github-script-ie-include](https://github.com/Mteixeira88/IE-include-script)
That converts automatically the include() to the match() function if it detects IE.
Other option is using always the`string.match(Regex(expressio... | this is because ie does not support includes so
Make a dot function and use it just like es6 includes() in es5 as below :
```
String.prototype.includes = function (str) {
return this.indexOf(str) !== -1;
}
```
Following is the string
```
var myString = 'this is my string';
```
Checking the match as following:
`... |
2,709,651 | I've got a grouping grid that I would like to use with remote sort & json data store. Is there any working example showing this function? I haven't managed to solve sorting.
Thanks | 2010/04/25 | [
"https://Stackoverflow.com/questions/2709651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/197255/"
] | There is the official demo:
<http://www.sencha.com/deploy/dev/examples/grid/paging.html> | Try
<http://www.jprovocateur.org/sampleweb/view/listCountries>
, it contains grouping/sorting(remote)/paging(remote)/filtering(remote)/ export to excel/print of grid/state of the grid saved on db.
or try from the menu the Customers which contains the above plus detail grids.
M. |
64,233,252 | ```
this.snackBar.open(
`Only files of size less than ${this.fileSizeAllowed}KB are allowed`,
this.translate.instant('USER_REG.close'),
{
panelClass: 'errorSnackbar',
duration: 5500,
}
);
```
I just want the message present in the ... | 2020/10/06 | [
"https://Stackoverflow.com/questions/64233252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10758042/"
] | >
> Is there a way to do this?
>
>
>
Strictly speaking, no, there is not a way to do this. Repository rules like `http_archive` are executed during the [loading phase](https://docs.bazel.build/versions/master/guide.html#phases-of-a-build) of a build, while build outputs are created during the [execution phase](htt... | You can [override dependencies on the command line](https://bazel.build/docs/external#overriding-repositories), and use a local checkout of a repository instead of the `http_archive`.
For example, given the following `WORKSPACE.bazel`
```
workspace(name = "cli_cpp")
load("@bazel_tools//tools/build_defs/repo:http.bzl... |
54,289,858 | I have a problem with reducing the number of `for`-loops. They do the same thing for different type.
Should I use void pointers or something else.
Is it possible to reduce the number of code?
```
void smt(int nb, int iform, void *ptr)//example function
{
int *ipt;// pointers definitions
float *fpt;
... | 2019/01/21 | [
"https://Stackoverflow.com/questions/54289858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9925297/"
] | If you allocate memory with
```
float *a = malloc(nb*sizeof(float));
```
you can use the pointer `a` as an array of float. The compiler knows how big a `float` is for the calculation of the address of the array element `a[i]`.
If you cast the pointer to a different type, the size of an array element may be differen... | As C does not know templates one could fall back to use the preprocessor and some (in?)sane macros:
```
#include <stdlib.h>
#include <stdio.h>
#include <math.h> /* for M_PI */
#ifndef M_PI
# define M_PI (3.14159265359)
#endif
#define SMT_INIT(T, p, nb) do { \
(p) = malloc(nb * sizeof (T)); \
} while (0)
#define... |
7,358 | Get this error when creating a site containing 'record' in the name. Is the a list of reserved words that you can't use in SharePoint site names?
>
> Site names cannot contain certain reserved words and cannot begin with an underscore
>
>
>
**Correction**
Even though the error message was about 'site names', i... | 2010/11/26 | [
"https://sharepoint.stackexchange.com/questions/7358",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/1066/"
] | I think "Personal" and "Sites" are reserved words, not sure if MS have a published list of what's not allowed. | If the same site name is used as a site collection name already, you cannot create a site with the same name.
In my case, I created a site collection with the same name using Managed path(explicit inclusion). After deleting, the site collection, delete the managed path too to create a site with the same name. |
7,358 | Get this error when creating a site containing 'record' in the name. Is the a list of reserved words that you can't use in SharePoint site names?
>
> Site names cannot contain certain reserved words and cannot begin with an underscore
>
>
>
**Correction**
Even though the error message was about 'site names', i... | 2010/11/26 | [
"https://sharepoint.stackexchange.com/questions/7358",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/1066/"
] | I just wanted to expand on Joelji's answer, since I recently ran into the same problem:
Any of the "Managed Paths" are restricted site names. You can find this by going to [Central Administration] > [Application Management : Manage Web Applications] > Select a Web Application, and click [Managed Paths]
By default you... | I think "Personal" and "Sites" are reserved words, not sure if MS have a published list of what's not allowed. |
7,358 | Get this error when creating a site containing 'record' in the name. Is the a list of reserved words that you can't use in SharePoint site names?
>
> Site names cannot contain certain reserved words and cannot begin with an underscore
>
>
>
**Correction**
Even though the error message was about 'site names', i... | 2010/11/26 | [
"https://sharepoint.stackexchange.com/questions/7358",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/1066/"
] | I just wanted to expand on Joelji's answer, since I recently ran into the same problem:
Any of the "Managed Paths" are restricted site names. You can find this by going to [Central Administration] > [Application Management : Manage Web Applications] > Select a Web Application, and click [Managed Paths]
By default you... | If the same site name is used as a site collection name already, you cannot create a site with the same name.
In my case, I created a site collection with the same name using Managed path(explicit inclusion). After deleting, the site collection, delete the managed path too to create a site with the same name. |
160,581 | I want to install PyQt. This seems kind of complicated to install on OS X. I haven't found any precompiled packages of it (are there any? I would really prefer those).
So I downloaded PyQt. And SIP, because it depends on that. These files:
* <http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7... | 2010/07/06 | [
"https://superuser.com/questions/160581",
"https://superuser.com",
"https://superuser.com/users/37009/"
] | A new version of Qt, esp. Qt 4.7 Beta, seems to fix this problem.
<http://qt.nokia.com/developer/qt-qtcreator-prerelease> | You're better off using [PyQtX](https://sourceforge.net/projects/pyqtx/files/) which is binary precompiled package of PyQt for OS X. Compiling it manually is a big hassle. |
160,581 | I want to install PyQt. This seems kind of complicated to install on OS X. I haven't found any precompiled packages of it (are there any? I would really prefer those).
So I downloaded PyQt. And SIP, because it depends on that. These files:
* <http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7... | 2010/07/06 | [
"https://superuser.com/questions/160581",
"https://superuser.com",
"https://superuser.com/users/37009/"
] | It worked without problems via [Homebrew](https://brew.sh/):
```
brew install pyqt
```
Note that there was also [PySide](https://wiki.qt.io/PySide). Although that seems like it is abandoned and does not support Qt 5. You probably can install it anyway via:
```
brew install pyside
``` | A new version of Qt, esp. Qt 4.7 Beta, seems to fix this problem.
<http://qt.nokia.com/developer/qt-qtcreator-prerelease> |
160,581 | I want to install PyQt. This seems kind of complicated to install on OS X. I haven't found any precompiled packages of it (are there any? I would really prefer those).
So I downloaded PyQt. And SIP, because it depends on that. These files:
* <http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7... | 2010/07/06 | [
"https://superuser.com/questions/160581",
"https://superuser.com",
"https://superuser.com/users/37009/"
] | You can also use [MacPorts](http://macports.org) to install pyqt, qt, and many other packages. I haven't used the pyat package, but in general I've been pleased with MacPorts. It also makes it easy to update various packages as bew versions come out. | You're better off using [PyQtX](https://sourceforge.net/projects/pyqtx/files/) which is binary precompiled package of PyQt for OS X. Compiling it manually is a big hassle. |
160,581 | I want to install PyQt. This seems kind of complicated to install on OS X. I haven't found any precompiled packages of it (are there any? I would really prefer those).
So I downloaded PyQt. And SIP, because it depends on that. These files:
* <http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7... | 2010/07/06 | [
"https://superuser.com/questions/160581",
"https://superuser.com",
"https://superuser.com/users/37009/"
] | It worked without problems via [Homebrew](https://brew.sh/):
```
brew install pyqt
```
Note that there was also [PySide](https://wiki.qt.io/PySide). Although that seems like it is abandoned and does not support Qt 5. You probably can install it anyway via:
```
brew install pyside
``` | You can also use [MacPorts](http://macports.org) to install pyqt, qt, and many other packages. I haven't used the pyat package, but in general I've been pleased with MacPorts. It also makes it easy to update various packages as bew versions come out. |
160,581 | I want to install PyQt. This seems kind of complicated to install on OS X. I haven't found any precompiled packages of it (are there any? I would really prefer those).
So I downloaded PyQt. And SIP, because it depends on that. These files:
* <http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/PyQt-mac-gpl-4.7... | 2010/07/06 | [
"https://superuser.com/questions/160581",
"https://superuser.com",
"https://superuser.com/users/37009/"
] | It worked without problems via [Homebrew](https://brew.sh/):
```
brew install pyqt
```
Note that there was also [PySide](https://wiki.qt.io/PySide). Although that seems like it is abandoned and does not support Qt 5. You probably can install it anyway via:
```
brew install pyside
``` | You're better off using [PyQtX](https://sourceforge.net/projects/pyqtx/files/) which is binary precompiled package of PyQt for OS X. Compiling it manually is a big hassle. |
73,395,467 | I got `TrackPlayer.destroy is not a function. (In 'TrackPlayer.destroy()', 'TrackPlayer.destroy' is undefined` error when I called TrackPlayer `destroy` method in my expo react native app
this is my code
the `service.ts`
```
import TrackPlayer, {Event} from 'react-native-track-player';
module.exports = async func... | 2022/08/17 | [
"https://Stackoverflow.com/questions/73395467",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13013009/"
] | I have found out what went wrong, the `destroy` function was removed from `react-native-track-player` few minutes before I installed it and that's like 15 - 20 hours now
this is the link to the PR
<https://github.com/doublesymmetry/react-native-track-player/pull/1645/files#diff-67806635aecad4c3ddf7d36728b6510a7904dcab... | What's your `react-native-track-player` version? There's some bugs on versions 2.2.0-rc3 and 2.2.0-rc4, maybe it's your case. If it is, you have to upgrade to the newest version.
Check this [issue](https://github.com/doublesymmetry/react-native-track-player/issues/1587). |
26,019,145 | The following code got compilation error:
```
var a : Int = 0
var b : Int = 3
var sum : Int = 0
while (sum = a+b) < 2 {
}
```
The error message is:
>
> Cannot invoke '<' with an argument list of type '((()),
> IntegerLiteralConvertible)'
>
>
>
How to solve this problem? (Of course I can put **sum** assignme... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26019145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118562/"
] | In many other languages, including C and Objective-C, `sum = a+b` would return the value of `sum`, so it could be compared.
In Swift, this doesn't work. This was done intentionally to avoid a common programmer error. From [The Swift Programming Language](https://developer.apple.com/library/ios/documentation/swift/conc... | In most languages, assignments propagate their value -- that is, when you call
```
sum = a + b
```
the new value of `sum` is available for another part of the expression:
```
doubleSum = (sum = a + b) * 2
```
Swift doesn't work that way -- the value of `sum` *isn't* available after the assignment, so it can't be... |
26,019,145 | The following code got compilation error:
```
var a : Int = 0
var b : Int = 3
var sum : Int = 0
while (sum = a+b) < 2 {
}
```
The error message is:
>
> Cannot invoke '<' with an argument list of type '((()),
> IntegerLiteralConvertible)'
>
>
>
How to solve this problem? (Of course I can put **sum** assignme... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26019145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118562/"
] | In many other languages, including C and Objective-C, `sum = a+b` would return the value of `sum`, so it could be compared.
In Swift, this doesn't work. This was done intentionally to avoid a common programmer error. From [The Swift Programming Language](https://developer.apple.com/library/ios/documentation/swift/conc... | You can rewrite it as a `for` loop, although you'll have to repeat the assignment and addition:
```
for sum = a+b; sum < 2; sum = a+b {
}
``` |
26,019,145 | The following code got compilation error:
```
var a : Int = 0
var b : Int = 3
var sum : Int = 0
while (sum = a+b) < 2 {
}
```
The error message is:
>
> Cannot invoke '<' with an argument list of type '((()),
> IntegerLiteralConvertible)'
>
>
>
How to solve this problem? (Of course I can put **sum** assignme... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26019145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/118562/"
] | In many other languages, including C and Objective-C, `sum = a+b` would return the value of `sum`, so it could be compared.
In Swift, this doesn't work. This was done intentionally to avoid a common programmer error. From [The Swift Programming Language](https://developer.apple.com/library/ios/documentation/swift/conc... | The other answers explain why your code won't compile. Here is how you can clean it up without calculating `sum` in the while loop (I'm assuming you want to be able to reassign what `sum`'s getter is, elsewhere.):
```
var a = 0, b = 3
var getSum = { a + b }
var sum: Int { return getSum() }
while sum < 2 {
```
...an... |
26,244,047 | I have a model spec that is failing with "undefined method 'save' for nil:NilClass'." This occurs in the class method 'create\_and\_send\_self\_eval'. The method is creating a new Evaluation, but it always returns nil in the test environment. I've also tried using 'create', 'create!' and they also return nil. However, ... | 2014/10/07 | [
"https://Stackoverflow.com/questions/26244047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058298/"
] | The answer to this question had to do with how the tests were written. In my spec, I'm checking to see if "new" is called on Evaluation. Since, I'm using rspec-mocks, Evaluation is not actually being created. Fixed this by changing the test to test the output results. | Try doing this instead:
```
evaluation = self.new.tap do |e|
e.participant_id = participant.id
e.evaluator = participant
end
```
Using [Object#tap](http://ruby-doc.org/core-2.1.2/Object.html#method-i-tap) should guarantee that you set evaluation to the object rather than to the return value of the block. |
30,864,905 | I am developing a IME keyboard which will have a automobile dial pad as the input handler in android. More clearly, the dial pad turns decide which alphabet to select.if the dial pad is pointed to "a" and then click the center button of the dial pad, it selects alphabet "a".
But my question is, is there a way i can ha... | 2015/06/16 | [
"https://Stackoverflow.com/questions/30864905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3083866/"
] | For future users- if you're implementing your own keyboard you can override boolean onEvaluateInputViewShown in InputMethodService. This function controls if the keyboard is shown, and the default implementation is to return false if a hardware keyboard exists. Change it to return true and it will work.
I don't know a... | for navigation part, i found the solution.
go to settings->input -> default-> disable the hardware physical keyboard.
then if any text edit is used, the soft keyboard comes up and then we can use the physical keyboard to navigate. (only navigation) . |
8,444,832 | Unable to do multiple overlayed videos using flowplayer with jQuery
I did single overlayed video, but i don't get result when i try to do multiple overlays
I think there may be problem with Script and i don't know jQuery please help me
My code is
```
<style>
.overlay {
background:url(white.png) no-... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8444832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084933/"
] | The `.text` segment is a read only section. You should use `.bss` `.data` or the `stack` for modifiable variables.
<http://en.wikipedia.org/wiki/Code_segment> | The `.text` area is usually read only, so you can't write results to it. You could use `.data` instead, or even the stack if you really want. |
8,444,832 | Unable to do multiple overlayed videos using flowplayer with jQuery
I did single overlayed video, but i don't get result when i try to do multiple overlays
I think there may be problem with Script and i don't know jQuery please help me
My code is
```
<style>
.overlay {
background:url(white.png) no-... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8444832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084933/"
] | The `.text` segment is a read only section. You should use `.bss` `.data` or the `stack` for modifiable variables.
<http://en.wikipedia.org/wiki/Code_segment> | You can use `VirtualProtect` function to make `.text` *section* writeable.
---
**Upd:** regarding security risks:
As @RaymondChen wrote, having read-write-execute page is insecure.
Attacker can exploit buffer overflow such way that it will overwrite pointer to another buffer, and attacker's code will be copied t... |
8,444,832 | Unable to do multiple overlayed videos using flowplayer with jQuery
I did single overlayed video, but i don't get result when i try to do multiple overlays
I think there may be problem with Script and i don't know jQuery please help me
My code is
```
<style>
.overlay {
background:url(white.png) no-... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8444832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1084933/"
] | The `.text` area is usually read only, so you can't write results to it. You could use `.data` instead, or even the stack if you really want. | You can use `VirtualProtect` function to make `.text` *section* writeable.
---
**Upd:** regarding security risks:
As @RaymondChen wrote, having read-write-execute page is insecure.
Attacker can exploit buffer overflow such way that it will overwrite pointer to another buffer, and attacker's code will be copied t... |
58,888 | When running the following queries in MS SQL Server 2012 the second query fails but not the first. Also, when run without the where clauses both queries will fail. I am at a loss why either would fail since both should have empty result sets. Any help/insight is appreciated.
```
create table #temp
(id int primary ... | 2014/02/13 | [
"https://dba.stackexchange.com/questions/58888",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/34257/"
] | An initial look at the execution plans shows that the expression `1/0` is defined in the Compute Scalar operators:

Now, even though execution plans do start executing at the far left, iteratively calling `Open` and `GetRow` methods on child iterators to return r... | I am going to intelligently guess (and in the process probably attract a SQL Server guru who might give a really detailed answer).
The first query approaches the execution as:
1. Scan the primary key index
2. Look up the values in the data table needed for the query
It chooses this path because you have a `where` cl... |
39,362 | I Googled film vs dslr and found an article from 2007 that said:
>
> Digital sensor has higher reflectiveness than film. The light bouncing back from sensor will cause flare and lead to poor optical performance. Lens with better or specialized coating solve this problem. So, film lens usually has poor optical perform... | 2013/05/20 | [
"https://photo.stackexchange.com/questions/39362",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/19980/"
] | It depends on what, exactly, you mean by image quality. *In terms of ghosting or flare caused by reflections on the back surfaces of the elements of a lens this is often the case.* If the ghosting is visible through the viewfinder when the mirror is down and the shutter closed on a DSLR, then the ghosting is not being ... | Yes and no, when dealing with bright light sources (relative to the rest of the scene) are entering the lens, it is possible for internal reflection to result in a ghost image. This is most commonly seen when a light is directly in a dark shot. A blob of light and often a haze will appear opposite the center axis of th... |
182,640 | suppose $T$ is a complete stats for a parameter $\theta$.
Is any function $f(T)$ again complete?
It sounds weird but the definition seems to confirm that $f(T)$ is indeed complete.. | 2014/10/05 | [
"https://mathoverflow.net/questions/182640",
"https://mathoverflow.net",
"https://mathoverflow.net/users/59120/"
] | Geometrically, completeness means something like this: if a vector $g(T)$ is orthogonal to the p.d.f. $f\_\theta$ of $T$ for each $\theta$,
$$\mathbb E\_\theta g(T) = \langle g(T),f\_\theta\rangle=0$$
then $g(T)=0$ i.e., the functions $f\_\theta$ for varying $\theta$ span the whole space of functions of $T$. So in a wa... | Statistics $T$ and $T'$ are called *equivalent* if there exists a one-to-one function $f$ such that $T'=f(T)$. Equivalent statistics give equivalent information, in particular, if $T$ and $T'$ are equivalent statistics and $T$ is complete for $\theta$ then $T'$ is complete for $\theta$.
See, for example, <http://www.r... |
17,630,549 | I'm currently working on my first game in java and i'm trying to implement sounds when the spaceship is getting hit.. this is my code . I get a null pointer exception but my sound is in the right place "workspace/project/src/sounds/"
```
public class GameSounds
{
public static synchronized void hit()
{
try
{... | 2013/07/13 | [
"https://Stackoverflow.com/questions/17630549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2579222/"
] | In all likelihood, you are not getting the resource with the correct path. Understand that resource paths are based on where the class loader looks to load class files and not on where the src or "user.dir" directory is.
Perhaps you want to do:
```
// almost always better to break up a long code line into smaller lin... | I have had the same problems. But after searching for hours I found Javazoom which is a external libery you can import into your project and makes it much more easy to play sounds:
<http://www.javazoom.net/index.shtml>
You can use it like this:
```
import javazoom.jl.player.advanced.*;
class SoundJLayer extends P... |
150,409 | Submitting on mobile can update later with more details.
You've had a laptop provided to you by your workplace, you may have also used it for some personal web traffic. You've been asked to return it with your password while going on leave, what's the check list of what you should scrub/delete/leave intact? | 2017/02/04 | [
"https://security.stackexchange.com/questions/150409",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/80878/"
] | I assume this question is about a short leave. In this case it might not be suitable to wipe the complete machine.
Dependent on the trust into you IT department, the following points *may* be good ideas:
* Browser caches, stored passwords, forms, ...
* Media Player caches
* Password Manager
* private files, including... | I would be concerned if your IT department is asking you to give them your password along with the machine. They should already have admin access so they shouldn't it. And most companies have very clear policies about never sharing passwords.
Also add to the list:
Download list
Download directory
My documents / my pic... |
84,691 | >
> “*We are but pawns on a chessboard too large to see the edges* ”
>
>
>
I remember hearing this in a TV show a few years back. I'm fairly certain it had a fantasy/medieval setting; my first guess was Tywin Lannister from Game of Thrones. But all my Google search results, even with lots of variations (*e.g.* pie... | 2015/03/25 | [
"https://scifi.stackexchange.com/questions/84691",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/43494/"
] | I wonder if it is from Sheri Tepper's 'The True Game', where the people are the pieces, each with powers/rules, and game against each other.
I don't have a copy with me to check for you, but if not, I still recommend it as a good read. | It could possibly from David Edding's "Belgariad". The protagonist is often reminded of the fact they they are just pieces of a much larger game and the books are even named after chess moves. |
84,691 | >
> “*We are but pawns on a chessboard too large to see the edges* ”
>
>
>
I remember hearing this in a TV show a few years back. I'm fairly certain it had a fantasy/medieval setting; my first guess was Tywin Lannister from Game of Thrones. But all my Google search results, even with lots of variations (*e.g.* pie... | 2015/03/25 | [
"https://scifi.stackexchange.com/questions/84691",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/43494/"
] | Found a couple of contenders. But don't seem to be the right subject matter.
[Darwin's Bass: The Evolutionary Psychology of Fishing Man](https://books.google.co.uk/books?id=JUiN1HN6OZEC&pg=PT249&lpg=PT249&dq=%22we%20are%20but%20pawns%22&source=bl&ots=wcY4yUO_io&sig=1xANiliW1QPsN-AdQ7zZVCGM7ps&hl=en&sa=X&ved=0ahUKEwjur... | It could possibly from David Edding's "Belgariad". The protagonist is often reminded of the fact they they are just pieces of a much larger game and the books are even named after chess moves. |
11,677,815 | I have code, which is using `System.Net` and `System.Net.NetworkInformation` references, it generates a list of my network connection names.
Everything seems fine and working, but when I made a class of this code, and exported values to `listbox1` items add, I had only one network connection name, but really I have fo... | 2012/07/26 | [
"https://Stackoverflow.com/questions/11677815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539124/"
] | I would modify the code you currently have:
```
public string net_adapters()
{
string value = string.Empty;
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
// bug in your original code right here is `=`
// you proably meant to do something like value += "... | You only return the last item `value = nic.Name;` You should use an array or List to return all items
```
public List<string> net_adapters()
{
List<string> values = new List<string>();
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
values.Add(nic.Name);
}
... |
11,677,815 | I have code, which is using `System.Net` and `System.Net.NetworkInformation` references, it generates a list of my network connection names.
Everything seems fine and working, but when I made a class of this code, and exported values to `listbox1` items add, I had only one network connection name, but really I have fo... | 2012/07/26 | [
"https://Stackoverflow.com/questions/11677815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539124/"
] | You only return the last item `value = nic.Name;` You should use an array or List to return all items
```
public List<string> net_adapters()
{
List<string> values = new List<string>();
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
values.Add(nic.Name);
}
... | Copy and Paste of <https://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface(v=vs.110).aspx>
```
public static void ShowNetworkInterfaces()
{
IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfa... |
11,677,815 | I have code, which is using `System.Net` and `System.Net.NetworkInformation` references, it generates a list of my network connection names.
Everything seems fine and working, but when I made a class of this code, and exported values to `listbox1` items add, I had only one network connection name, but really I have fo... | 2012/07/26 | [
"https://Stackoverflow.com/questions/11677815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1539124/"
] | I would modify the code you currently have:
```
public string net_adapters()
{
string value = string.Empty;
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
// bug in your original code right here is `=`
// you proably meant to do something like value += "... | Copy and Paste of <https://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface(v=vs.110).aspx>
```
public static void ShowNetworkInterfaces()
{
IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfa... |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | A VM is generally considered Infrastructure-as-a-Service, as you retain responsibility for patching and managing the Virtual Machine Operating System.
And even though there are Marketplace VM offerings that are completely pre-configured and even auto-updating, the responsibility for maintaining those solutions after ... | VM's are **IAAS** (Infrastructure as a service) because on a VM you can manage what operation system runs and what software is installed.
[](https://i.stack.imgur.com/R8uJx.png)
On a PAAS you only manage the software or application that runs in the c... |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | A VM is generally considered Infrastructure-as-a-Service, as you retain responsibility for patching and managing the Virtual Machine Operating System.
And even though there are Marketplace VM offerings that are completely pre-configured and even auto-updating, the responsibility for maintaining those solutions after ... | It's both.
Like IaaS, PaaS includes infrastructure—servers, storage, and networking—but also middleware, development tools, business intelligence (BI) services, database management systems, and more. PaaS is designed to support the complete web application lifecycle: building, testing, deploying, managing, and updating... |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | A VM is generally considered Infrastructure-as-a-Service, as you retain responsibility for patching and managing the Virtual Machine Operating System.
And even though there are Marketplace VM offerings that are completely pre-configured and even auto-updating, the responsibility for maintaining those solutions after ... | I've just been through Microsoft's AZ900 training at it states:
Azure Virtual Machines (VM) are software emulations
of physical computers.
* Includes virtual processor, memory, storage, and
networking.
* **IaaS offering that provides total control and
customization.** |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | A VM is generally considered Infrastructure-as-a-Service, as you retain responsibility for patching and managing the Virtual Machine Operating System.
And even though there are Marketplace VM offerings that are completely pre-configured and even auto-updating, the responsibility for maintaining those solutions after ... | example Az900 test questions:
VM with installed SQL is PaaS
* appears to times
VM with instlled sql server is Iaas - one time
DNS is IaaS according to MS diagram: <https://techcommunity.microsoft.com/t5/image/serverpage/image-id/94214iF8738A37E3E44F77>
But VM with DNS server installed is PaaS
Also encountered that VM ... |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | VM's are **IAAS** (Infrastructure as a service) because on a VM you can manage what operation system runs and what software is installed.
[](https://i.stack.imgur.com/R8uJx.png)
On a PAAS you only manage the software or application that runs in the c... | It's both.
Like IaaS, PaaS includes infrastructure—servers, storage, and networking—but also middleware, development tools, business intelligence (BI) services, database management systems, and more. PaaS is designed to support the complete web application lifecycle: building, testing, deploying, managing, and updating... |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | VM's are **IAAS** (Infrastructure as a service) because on a VM you can manage what operation system runs and what software is installed.
[](https://i.stack.imgur.com/R8uJx.png)
On a PAAS you only manage the software or application that runs in the c... | I've just been through Microsoft's AZ900 training at it states:
Azure Virtual Machines (VM) are software emulations
of physical computers.
* Includes virtual processor, memory, storage, and
networking.
* **IaaS offering that provides total control and
customization.** |
61,601,241 | I would like some clarification on whether Azure VM's are strictly IaaS or can be PaaS depending on the amount responsibilities the creator/user has.
I've seen multiple different website saying VM are ONLY IaaS since you require an operating system, and others saying VM can be PaaS if a specific OS is specified on cr... | 2020/05/04 | [
"https://Stackoverflow.com/questions/61601241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5927617/"
] | VM's are **IAAS** (Infrastructure as a service) because on a VM you can manage what operation system runs and what software is installed.
[](https://i.stack.imgur.com/R8uJx.png)
On a PAAS you only manage the software or application that runs in the c... | example Az900 test questions:
VM with installed SQL is PaaS
* appears to times
VM with instlled sql server is Iaas - one time
DNS is IaaS according to MS diagram: <https://techcommunity.microsoft.com/t5/image/serverpage/image-id/94214iF8738A37E3E44F77>
But VM with DNS server installed is PaaS
Also encountered that VM ... |
8,204,397 | Either this is just a deprecated window style with no documentation, or I've made a flaw in searching for it.
My question is, what does this flag do? Is there a supported equivalent to it that I may need?
Advice is appreciated! | 2011/11/20 | [
"https://Stackoverflow.com/questions/8204397",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864627/"
] | `WS_EX_APPWINDOW` is an extended window style that is documented on [MSDN](http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx). It is most definitely not deprecated and is a fully supported and widely used style.
The documentation states that the style:
>
> Forces a top-level window o... | According to [Extended Window Styles](http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543%28v=vs.85%29.aspx) on MSDN it:
>
> Forces a top-level window onto the taskbar when the window is visible.
>
>
>
I don't see anywhere on the [CreateWindowEx](http://msdn.microsoft.com/en-us/library/windows/deskt... |
39,553,567 | I have 5 subviews(White) added to the superview(Gray), when I rotate the superview I want to know the angle(like 1 and 2) of each of the subview with the red circle.(the center of the subviews and the red circle are ON the same circle)
**Start Position:**
[, completionHandler:^(id _Nullable result, NSError * _Nullable error) {
NSLog(@">>>%@",result);
})
``` |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | You have to use a prepared statement and replace the variables with a placeholder.
<http://php.net/manual/de/mysqli.prepare.php> | Answering your question:
You may do something like below. Actually, that is to put a variable of array item into a string, not only for `$_GET`. Any array may be accessed like that:
```
$str = "some text {$_GET['title']}"
```
Or similar approach when you are working with objects:
```
$str = "some text {$obj->test}... |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | You need to break out of the string in order to concatenate it with the `$_GET` variables.
```
mysqli_query($db,"INSERT INTO jliu VALUES(null,".$_GET['title'].",".$_GET['fname'].",".$_GET['lname'].",".$_GET['description'].")");
```
But really you should look into [prepared statements](http://php.net/manual/en/mysqli... | Your *actual* issue, inserting index values of an array into a string can be solved in two ways (more if you count heredoc, sprintf and whatnot):
Use curly braces:
```
"INSERT INTO jliu VALUE(null, {$_GET['title']}, {$_GET['fname']}, {$_GET['lname']}, {$_GET['description']})"
```
Use concatenation:
```
"INSERT INT... |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | You need to break out of the string in order to concatenate it with the `$_GET` variables.
```
mysqli_query($db,"INSERT INTO jliu VALUES(null,".$_GET['title'].",".$_GET['fname'].",".$_GET['lname'].",".$_GET['description'].")");
```
But really you should look into [prepared statements](http://php.net/manual/en/mysqli... | You have to use a prepared statement and replace the variables with a placeholder.
<http://php.net/manual/de/mysqli.prepare.php> |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | You need to break out of the string in order to concatenate it with the `$_GET` variables.
```
mysqli_query($db,"INSERT INTO jliu VALUES(null,".$_GET['title'].",".$_GET['fname'].",".$_GET['lname'].",".$_GET['description'].")");
```
But really you should look into [prepared statements](http://php.net/manual/en/mysqli... | It should be like this.
```
$query = sprintf("INSERT INTO jliu VALUE(null,%s,%s,%s,%s)",$_GET['title'],$_GET['fname'],$_GET['lname'],$_GET['description']);
mysqli_query($db,$query);
``` |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | Your *actual* issue, inserting index values of an array into a string can be solved in two ways (more if you count heredoc, sprintf and whatnot):
Use curly braces:
```
"INSERT INTO jliu VALUE(null, {$_GET['title']}, {$_GET['fname']}, {$_GET['lname']}, {$_GET['description']})"
```
Use concatenation:
```
"INSERT INT... | It should be like this.
```
$query = sprintf("INSERT INTO jliu VALUE(null,%s,%s,%s,%s)",$_GET['title'],$_GET['fname'],$_GET['lname'],$_GET['description']);
mysqli_query($db,$query);
``` |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | Please don't use mysql\_query() and consorts, they are [way too unsafe](http://en.wikipedia.org/wiki/SQL_injection). Do have a look at [PDO](http://php.net/manual/en/book.pdo.php) and use that instead. Specifically PDO::prepare() and PDOStatement::execute() will be your solution. | It should be like this.
```
$query = sprintf("INSERT INTO jliu VALUE(null,%s,%s,%s,%s)",$_GET['title'],$_GET['fname'],$_GET['lname'],$_GET['description']);
mysqli_query($db,$query);
``` |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | You have to use a prepared statement and replace the variables with a placeholder.
<http://php.net/manual/de/mysqli.prepare.php> | try this..
```
$title = mysqli_real_escape_string($_GET['title']);
$fname = mysqli_real_escape_string($_GET['fname']);
$lname = mysqli_real_escape_string($_GET['lname']);
$description = mysqli_real_escape_string($_GET['description']);
$stmt = mysqli_prepare($db,"INSERT INTO jliu VALUES(null,'".$ti... |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | Your *actual* issue, inserting index values of an array into a string can be solved in two ways (more if you count heredoc, sprintf and whatnot):
Use curly braces:
```
"INSERT INTO jliu VALUE(null, {$_GET['title']}, {$_GET['fname']}, {$_GET['lname']}, {$_GET['description']})"
```
Use concatenation:
```
"INSERT INT... | Answering your question:
You may do something like below. Actually, that is to put a variable of array item into a string, not only for `$_GET`. Any array may be accessed like that:
```
$str = "some text {$_GET['title']}"
```
Or similar approach when you are working with objects:
```
$str = "some text {$obj->test}... |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | Please don't use mysql\_query() and consorts, they are [way too unsafe](http://en.wikipedia.org/wiki/SQL_injection). Do have a look at [PDO](http://php.net/manual/en/book.pdo.php) and use that instead. Specifically PDO::prepare() and PDOStatement::execute() will be your solution. | try this..
```
$title = mysqli_real_escape_string($_GET['title']);
$fname = mysqli_real_escape_string($_GET['fname']);
$lname = mysqli_real_escape_string($_GET['lname']);
$description = mysqli_real_escape_string($_GET['description']);
$stmt = mysqli_prepare($db,"INSERT INTO jliu VALUES(null,'".$ti... |
15,633,600 | I'm trying to make like few text boxes and upon submit another php will be connected let's say it's database.php then the database.php will insert what's in the textboxes into the mysql database table but I'm not sure how I should be into the mysqli\_query code....what I have now is
```
mysqli_query($db,"INSERT INTO j... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15633600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1850712/"
] | Your *actual* issue, inserting index values of an array into a string can be solved in two ways (more if you count heredoc, sprintf and whatnot):
Use curly braces:
```
"INSERT INTO jliu VALUE(null, {$_GET['title']}, {$_GET['fname']}, {$_GET['lname']}, {$_GET['description']})"
```
Use concatenation:
```
"INSERT INT... | You have to use a prepared statement and replace the variables with a placeholder.
<http://php.net/manual/de/mysqli.prepare.php> |
40,914,743 | I have the current configuration in my httpd.conf file.I am trying to remove the vulnerability Authentication Bypass Using HTTP Verb Tampering. I only want to allow certain HTTP request headers, Get and Post in the below example and a different header should throw an error.
```
DocumentRoot "c:/dev"
<Directory "C:/dev... | 2016/12/01 | [
"https://Stackoverflow.com/questions/40914743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3223509/"
] | Try this settings
```
<Location />
Order allow,deny
Allow from all
<LimitExcept POST GET>
Deny from all
</LimitExcept>
</Location>
``` | The LimitExcept directive is the inverse of Limit directive. It allows applying a set of access restrictions to all listed http methods except for the ones listed with the LimitExcept directive. See this link: <http://httpd.apache.org/docs/current/mod/core.html#limitexcept>. So the access restrictions are applied to al... |
40,914,743 | I have the current configuration in my httpd.conf file.I am trying to remove the vulnerability Authentication Bypass Using HTTP Verb Tampering. I only want to allow certain HTTP request headers, Get and Post in the below example and a different header should throw an error.
```
DocumentRoot "c:/dev"
<Directory "C:/dev... | 2016/12/01 | [
"https://Stackoverflow.com/questions/40914743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3223509/"
] | This is how you can limit to GET/POST/OPTIONS. Note: NIST Stigs V-26396 states that this should not be applied to the root but only the others such as in my example (/etc/apache2/apache2.conf):
[](https://i.stack.imgur.com/5g2Ld.png)
It appears that ... | The LimitExcept directive is the inverse of Limit directive. It allows applying a set of access restrictions to all listed http methods except for the ones listed with the LimitExcept directive. See this link: <http://httpd.apache.org/docs/current/mod/core.html#limitexcept>. So the access restrictions are applied to al... |
40,914,743 | I have the current configuration in my httpd.conf file.I am trying to remove the vulnerability Authentication Bypass Using HTTP Verb Tampering. I only want to allow certain HTTP request headers, Get and Post in the below example and a different header should throw an error.
```
DocumentRoot "c:/dev"
<Directory "C:/dev... | 2016/12/01 | [
"https://Stackoverflow.com/questions/40914743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3223509/"
] | This is how you can limit to GET/POST/OPTIONS. Note: NIST Stigs V-26396 states that this should not be applied to the root but only the others such as in my example (/etc/apache2/apache2.conf):
[](https://i.stack.imgur.com/5g2Ld.png)
It appears that ... | Try this settings
```
<Location />
Order allow,deny
Allow from all
<LimitExcept POST GET>
Deny from all
</LimitExcept>
</Location>
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.