qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
42,853,292 | Is there a way to add buttons from a specific wrappanel to an array or list in code?
I tried the code below, but it doesn't work:
```
foreach(Button b in nameOfWrappanel)
{
list.Add(b);
}
``` | 2017/03/17 | [
"https://Stackoverflow.com/questions/42853292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5790802/"
] | You have to specify wrappanel.children to access its child.
```
foreach (Button b in nameOfWrappanel.Children)
{
list.Add(b);
}
``` | You could use Linq:
```
var buttons = myWrapPanel.Children.OfType<Button>().ToList();
``` |
42,853,292 | Is there a way to add buttons from a specific wrappanel to an array or list in code?
I tried the code below, but it doesn't work:
```
foreach(Button b in nameOfWrappanel)
{
list.Add(b);
}
``` | 2017/03/17 | [
"https://Stackoverflow.com/questions/42853292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5790802/"
] | You have to specify wrappanel.children to access its child.
```
foreach (Button b in nameOfWrappanel.Children)
{
list.Add(b);
}
``` | Since the `Children` property of a `Panel` returns a `UIElementCollection` that may contain any type of `UIElement` objects, you could use the `OfType` LINQ extension method to only retrive the `Button` elements:
```
foreach (Button b in nameOfWrappanel.Children.OfType<Button>())
{
list.Add(b);
}
``` |
42,853,292 | Is there a way to add buttons from a specific wrappanel to an array or list in code?
I tried the code below, but it doesn't work:
```
foreach(Button b in nameOfWrappanel)
{
list.Add(b);
}
``` | 2017/03/17 | [
"https://Stackoverflow.com/questions/42853292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5790802/"
] | You could use Linq:
```
var buttons = myWrapPanel.Children.OfType<Button>().ToList();
``` | Since the `Children` property of a `Panel` returns a `UIElementCollection` that may contain any type of `UIElement` objects, you could use the `OfType` LINQ extension method to only retrive the `Button` elements:
```
foreach (Button b in nameOfWrappanel.Children.OfType<Button>())
{
list.Add(b);
}
``` |
37,907,105 | this is my spring-security.xml:
```
<security:http pattern="/eklienci/**"
authentication-manager-ref="authenticationManager" entry-point-ref="restAuthenticationEntryPoint"
create-session="stateless">
<security:intercept-url pattern="/eklienci/**"
access="hasAnyAuthority('ADMIN',... | 2016/06/19 | [
"https://Stackoverflow.com/questions/37907105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2420030/"
] | [CSRF](http://docs.spring.io/spring-security/site/docs/current/reference/html/csrf.html) is activated by default for the common non-GET methods like POST, PUT, DELETE causing 403s if you haven't placed the CSRF headers in your REST calls. You can (temporarily!) shut off CSRF in your security.xml to confirm that's the i... | Turn off CSRF protection. It is not needed when you have `create-session="stateless"`.
```xml
<security:http ...>
<security:csrf disabled="true"/>
<!-- the rest same as before -->
</security:http>
``` |
18,488,096 | Here's my table A
```
orderID groupID nameID
1 grade A foo
2 grade A bar
3 grade A rain
1 grade B rain
2 grade B foo
3 grade B bar
1 grade C rain
2 grade C bar
3 grade C foo
```
Desired result:
```
rain
bar
foo
```
I need `nameID` of `max(o... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18488096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2689375/"
] | **edit:** I just fixed a mistake in my answer.
You are looking for something quite like:
```
select
orderID,
groupID,
nameID
from
A
where
concat(orderID,'-',groupId) in (select concat(max(orderID),'-',groupId) from A group by groupID)
```
**edit:** in regards to the extra question:
To put the list in o... | ```
SELECT * FROM (select
max(`orderID`) as maxID, `groupID`, `nameID`
from
Table1
GROUP BY `groupID`, `nameID`
ORDER BY maxID desc) abc
GROUP BY GROUPID
```
**[Fiddle With my test data](http://www.sqlfiddle.com/#!2/e94e8f/5)**
**[Fiddle with your data](http://www.sqlfiddle.com/#!2/afdc6/1)** |
18,488,096 | Here's my table A
```
orderID groupID nameID
1 grade A foo
2 grade A bar
3 grade A rain
1 grade B rain
2 grade B foo
3 grade B bar
1 grade C rain
2 grade C bar
3 grade C foo
```
Desired result:
```
rain
bar
foo
```
I need `nameID` of `max(o... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18488096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2689375/"
] | Here is an appropriate query, using a correlated subquery:
```
select orderID, groupID, nameID
from A
where orderId = (select max(OrderId) from A a2 where A.groupId = a2.groupId);
```
If you want to do this with aggregation, you can use the `group_concat()`/`substring_index()` trick:
```
SELECT max(orderID) as orde... | ```
SELECT * FROM (select
max(`orderID`) as maxID, `groupID`, `nameID`
from
Table1
GROUP BY `groupID`, `nameID`
ORDER BY maxID desc) abc
GROUP BY GROUPID
```
**[Fiddle With my test data](http://www.sqlfiddle.com/#!2/e94e8f/5)**
**[Fiddle with your data](http://www.sqlfiddle.com/#!2/afdc6/1)** |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | It sounds like your client is detecting loss of connectivity to the server (using Bonjour), but you don't have the corresponding capability in the other direction.
You're certainly going to want some kind of timeout for inactive connections on the server side as well, otherwise dead connections will hang around foreve... | If you close server socket only in case of blocking socket then client socket will be closed but not vice versa.
otherwise it would be better socket in both end. Because socket is a heavy weigt for you system. It will use a local port and a remote port of your system forever.
Thanks
Sunil Kumar Sahoo |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | A quick/ dirty illustration of why this can't happen (note the client forcibly uses the same local port in its connection):
```
public class Server{
public static void main(String[] args) throws Exception {
new Thread(){
java.net.ServerSocket server = new java.net.ServerSocket(12345);
java.util.Ar... | the client operating system will not allocate the same port to a new socket so soon. there are several mechanism that prevents it. one of which is the TIME\_WAIT state that reserves the port for some time after the connection is closed.
I wouldn't worry about it.
if you really need to detect disconnection you will ha... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | A quick/ dirty illustration of why this can't happen (note the client forcibly uses the same local port in its connection):
```
public class Server{
public static void main(String[] args) throws Exception {
new Thread(){
java.net.ServerSocket server = new java.net.ServerSocket(12345);
java.util.Ar... | Short answer: yes, you should close socket on both ends.
Although the answer is simple, in reality it may be very hard to detect that the peer has stopped responding if you don't build some ACK/NACK scheme into your client-server protocol.
Even with your protocol ACKs your processing thread may be hanging waiting for... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | Yes, close the socket, as soon as you detect a failure.
The socket will be "stuck" in "close\_wait" if not closed properly.
Even if the socket is closed, it's state will be in time\_wait for a short period.
However, if You design the application to use a different local port for each new connection, there is no need... | If you close server socket only in case of blocking socket then client socket will be closed but not vice versa.
otherwise it would be better socket in both end. Because socket is a heavy weigt for you system. It will use a local port and a remote port of your system forever.
Thanks
Sunil Kumar Sahoo |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | Yes, close the socket, as soon as you detect a failure.
The socket will be "stuck" in "close\_wait" if not closed properly.
Even if the socket is closed, it's state will be in time\_wait for a short period.
However, if You design the application to use a different local port for each new connection, there is no need... | the client operating system will not allocate the same port to a new socket so soon. there are several mechanism that prevents it. one of which is the TIME\_WAIT state that reserves the port for some time after the connection is closed.
I wouldn't worry about it.
if you really need to detect disconnection you will ha... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | A quick/ dirty illustration of why this can't happen (note the client forcibly uses the same local port in its connection):
```
public class Server{
public static void main(String[] args) throws Exception {
new Thread(){
java.net.ServerSocket server = new java.net.ServerSocket(12345);
java.util.Ar... | It sounds like your client is detecting loss of connectivity to the server (using Bonjour), but you don't have the corresponding capability in the other direction.
You're certainly going to want some kind of timeout for inactive connections on the server side as well, otherwise dead connections will hang around foreve... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | Yes, close the socket, as soon as you detect a failure.
The socket will be "stuck" in "close\_wait" if not closed properly.
Even if the socket is closed, it's state will be in time\_wait for a short period.
However, if You design the application to use a different local port for each new connection, there is no need... | Short answer: yes, you should close socket on both ends.
Although the answer is simple, in reality it may be very hard to detect that the peer has stopped responding if you don't build some ACK/NACK scheme into your client-server protocol.
Even with your protocol ACKs your processing thread may be hanging waiting for... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | the client operating system will not allocate the same port to a new socket so soon. there are several mechanism that prevents it. one of which is the TIME\_WAIT state that reserves the port for some time after the connection is closed.
I wouldn't worry about it.
if you really need to detect disconnection you will ha... | If you close server socket only in case of blocking socket then client socket will be closed but not vice versa.
otherwise it would be better socket in both end. Because socket is a heavy weigt for you system. It will use a local port and a remote port of your system forever.
Thanks
Sunil Kumar Sahoo |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | Yes, close the socket, as soon as you detect a failure.
The socket will be "stuck" in "close\_wait" if not closed properly.
Even if the socket is closed, it's state will be in time\_wait for a short period.
However, if You design the application to use a different local port for each new connection, there is no need... | It sounds like your client is detecting loss of connectivity to the server (using Bonjour), but you don't have the corresponding capability in the other direction.
You're certainly going to want some kind of timeout for inactive connections on the server side as well, otherwise dead connections will hang around foreve... |
2,454,550 | I have the following problem. My client program monitor for availability of server in the local network (using Bonjour, but it does not rally mater). As soon as a server is "noticed" by the client application, the client tries to create a socket: `Socket(serverIP,serverPort);`.
At some point the client can loose the s... | 2010/03/16 | [
"https://Stackoverflow.com/questions/2454550",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/245549/"
] | A quick/ dirty illustration of why this can't happen (note the client forcibly uses the same local port in its connection):
```
public class Server{
public static void main(String[] args) throws Exception {
new Thread(){
java.net.ServerSocket server = new java.net.ServerSocket(12345);
java.util.Ar... | If you close server socket only in case of blocking socket then client socket will be closed but not vice versa.
otherwise it would be better socket in both end. Because socket is a heavy weigt for you system. It will use a local port and a remote port of your system forever.
Thanks
Sunil Kumar Sahoo |
69,727,847 | So I'm making a voice assistant in Python and I want it to do math that I input. This code checks if it ends with an integer:
```
elif text[-1].isdigit() == True:
basicmath()
```
Then the function basicmath():
```
def basicmath():
split = text.split(" ")
in1 = split[0]
in2 = split[5]
... | 2021/10/26 | [
"https://Stackoverflow.com/questions/69727847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17245368/"
] | Use `perl=TRUE` with [lookaround](https://www.regular-expressions.info/lookaround.html):
```r
vec <- c("2 - 5-< 2", "6 - 10-< 2", "6 - 10-2 - 5", "> 15-2 - 5")
strsplit(vec, "(?<! )-(?!= )", perl=TRUE)
# [[1]]
# [1] "2 - 5" "< 2"
# [[2]]
# [1] "6 - 10" "< 2"
# [[3]]
# [1] "6 - 10" "2 - 5"
# [[4]]
# [1] "> 15" "... | I guess this is an easier-to-understand solution:
```
library(stringr)
str_split(vec, "(?<=\\d)-(?=\\d)")
[[1]]
[1] "2 - 5" "< 2"
[[2]]
[1] "6 - 10" "< 2"
[[3]]
[1] "6 - 10" "2 - 5"
[[4]]
[1] "> 15" "2 - 5"
```
First off, no `perl = TRUE` needed (well, but a new package, `stringr`).
But then, `(?<=\\d)` an... |
29,043,922 | I have an image in an HTML email template where the height is being cutoff. I'm using the Zurb Ink email framework. The setup is two images that are supposed to stack on top of each other. From what I can tell the image is being cutoff at 19px in height, while it's actual height is 47px;
I'm using Email on Acid to pre... | 2015/03/14 | [
"https://Stackoverflow.com/questions/29043922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/438581/"
] | Floats don't work in Outlook. What you want is to use `<td align="left|right|center">` instead. You should use `td`'s `valign` and `height` attributes too.
The width bit could be causing the problem too, you should set the width of the image via the `width` attribute and then set the style `max-width:100%` inline to a... | I ran into the same issue with the height being cut off in Outlook only. I solved this by removing the custom class(es) on my image. |
29,043,922 | I have an image in an HTML email template where the height is being cutoff. I'm using the Zurb Ink email framework. The setup is two images that are supposed to stack on top of each other. From what I can tell the image is being cutoff at 19px in height, while it's actual height is 47px;
I'm using Email on Acid to pre... | 2015/03/14 | [
"https://Stackoverflow.com/questions/29043922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/438581/"
] | Try setting `mso-line-height-rule: at-least` on the TD that the image sits in. I've found issues with MSO email clients where it would crop images to the line-height unless this option is set correctly. | Floats don't work in Outlook. What you want is to use `<td align="left|right|center">` instead. You should use `td`'s `valign` and `height` attributes too.
The width bit could be causing the problem too, you should set the width of the image via the `width` attribute and then set the style `max-width:100%` inline to a... |
29,043,922 | I have an image in an HTML email template where the height is being cutoff. I'm using the Zurb Ink email framework. The setup is two images that are supposed to stack on top of each other. From what I can tell the image is being cutoff at 19px in height, while it's actual height is 47px;
I'm using Email on Acid to pre... | 2015/03/14 | [
"https://Stackoverflow.com/questions/29043922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/438581/"
] | Try setting `mso-line-height-rule: at-least` on the TD that the image sits in. I've found issues with MSO email clients where it would crop images to the line-height unless this option is set correctly. | I ran into the same issue with the height being cut off in Outlook only. I solved this by removing the custom class(es) on my image. |
5,988,673 | iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714681/"
] | You would use an obfuscator. There are a lot of them on the market, just google.
For example, Visual Studio used to ship with the [Dotfuscator Community Edition](http://www.preemptive.com/products/dotfuscator). I never used it, so I can't say anything about its quality.
This blog post shows the possible ways to t... | In the end it will always be possible to reverse engineer the code. Obfuscation can help but your code will never completely be protected.
The only way to fully protect the code is by not deploying it but instead keeping it on a server. |
5,988,673 | iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714681/"
] | You would use an obfuscator. There are a lot of them on the market, just google.
For example, Visual Studio used to ship with the [Dotfuscator Community Edition](http://www.preemptive.com/products/dotfuscator). I never used it, so I can't say anything about its quality.
This blog post shows the possible ways to t... | Obfuscating your assemblies will ensure that it is difficult (if not impossible) to reverse-engineer your compiled assemblies. Obfuscators use techniques like symbol renaming, string encryption, control flow obfuscation to try to obfuscate the meaning of the original code. In some cases, it is even possible to totally ... |
5,988,673 | iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714681/"
] | You would use an obfuscator. There are a lot of them on the market, just google.
For example, Visual Studio used to ship with the [Dotfuscator Community Edition](http://www.preemptive.com/products/dotfuscator). I never used it, so I can't say anything about its quality.
This blog post shows the possible ways to t... | You can use FxProtect obfuscator. It successfully supports WPF and Silverlight obfuscation.
You can try it... **[.NET Obfuscator](http://www.maycoms.net)** |
5,988,673 | iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714681/"
] | In the end it will always be possible to reverse engineer the code. Obfuscation can help but your code will never completely be protected.
The only way to fully protect the code is by not deploying it but instead keeping it on a server. | You can use FxProtect obfuscator. It successfully supports WPF and Silverlight obfuscation.
You can try it... **[.NET Obfuscator](http://www.maycoms.net)** |
5,988,673 | iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me | 2011/05/13 | [
"https://Stackoverflow.com/questions/5988673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/714681/"
] | Obfuscating your assemblies will ensure that it is difficult (if not impossible) to reverse-engineer your compiled assemblies. Obfuscators use techniques like symbol renaming, string encryption, control flow obfuscation to try to obfuscate the meaning of the original code. In some cases, it is even possible to totally ... | You can use FxProtect obfuscator. It successfully supports WPF and Silverlight obfuscation.
You can try it... **[.NET Obfuscator](http://www.maycoms.net)** |
48,727,346 | Due to some odd reason, I cannot go with JPA vendor like Hibernate, etc and **I must use MyBatis.**
Is there any implementation where we can enrich similar facility of CRUD operation in Mybatis?
(Like GenericDAO save, persist, merge, etc)
I have managed to come up with single interface implementation of CRUD type... | 2018/02/11 | [
"https://Stackoverflow.com/questions/48727346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1640241/"
] | The idea is still the same. Just that you will be looking for a specific attribute in the class object.
For your card class, you could do something like this:
```
hand = [ Card(10, 'H'), Card(2,'h'), Card(12,'h'), Card(13, 'h'), Card(14, 'h') ]
```
Then you could do
```
sorted_cards = sorted(hand, key=lambda x: x... | This is the object-oriented approach. At a minimum, you should specify `__eq__` and `__lt__` operations for this to work. Then just use `sorted(hand)`.
```
class Card(object):
def __init__(self, rank, suit):
self.rank = rank
self.suit = suit
def __eq__(self, other):
return self.rank =... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | I think you're looking for this:
```
from django.db.models.loading import get_model
model = get_model('app_name', 'model_name')
```
There are other methods, of course, but this is the way I'd handle it if you don't know what models file you need to import into your namespace. (Note there's really no way to safely ge... | For Django 1.7+, there is an [applications registry](https://docs.djangoproject.com/en/1.8/ref/applications/#module-django.apps). You can use the [`apps.get_model`](https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.apps.get_model) method to dynamically get a model.
```
from django.apps import apps
My... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | I think you're looking for this:
```
from django.db.models.loading import get_model
model = get_model('app_name', 'model_name')
```
There are other methods, of course, but this is the way I'd handle it if you don't know what models file you need to import into your namespace. (Note there's really no way to safely ge... | ```
from django.authx.models import User
model = User
model.objects.all()
``` |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | Classes are "first class" objects in Python, meaning they can be passed around and manipulated just like all other objects.
Models are classes -- you can tell from the fact that you create new models using class statements:
```
class Person(models.Model):
last_name = models.CharField(max_length=64)
class Anthrop... | If you have the model name passed as a string I guess one way could be
```
modelname = "User"
model = globals()[modelname]
```
But mucking about with globals() might be a bit dangerous in some contexts. So handle with care :) |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | I think you're looking for this:
```
from django.db.models.loading import get_model
model = get_model('app_name', 'model_name')
```
There are other methods, of course, but this is the way I'd handle it if you don't know what models file you need to import into your namespace. (Note there's really no way to safely ge... | >
> model = django.authx.models.User
>
>
> ? Django returns an error, "global
> name django is not defined."
>
>
>
Django does not return the error. Python does.
First, you MUST import the model. You must import it with
```
from django.authx.models import User
```
Second, if you get an error that `django` i... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | ```
from django.authx.models import User
model = User
model.objects.all()
``` | If you have the model name passed as a string I guess one way could be
```
modelname = "User"
model = globals()[modelname]
```
But mucking about with globals() might be a bit dangerous in some contexts. So handle with care :) |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | For Django 1.7+, there is an [applications registry](https://docs.djangoproject.com/en/1.8/ref/applications/#module-django.apps). You can use the [`apps.get_model`](https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.apps.get_model) method to dynamically get a model.
```
from django.apps import apps
My... | Classes are "first class" objects in Python, meaning they can be passed around and manipulated just like all other objects.
Models are classes -- you can tell from the fact that you create new models using class statements:
```
class Person(models.Model):
last_name = models.CharField(max_length=64)
class Anthrop... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | I think you're looking for this:
```
from django.db.models.loading import get_model
model = get_model('app_name', 'model_name')
```
There are other methods, of course, but this is the way I'd handle it if you don't know what models file you need to import into your namespace. (Note there's really no way to safely ge... | Classes are "first class" objects in Python, meaning they can be passed around and manipulated just like all other objects.
Models are classes -- you can tell from the fact that you create new models using class statements:
```
class Person(models.Model):
last_name = models.CharField(max_length=64)
class Anthrop... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | For Django 1.7+, there is an [applications registry](https://docs.djangoproject.com/en/1.8/ref/applications/#module-django.apps). You can use the [`apps.get_model`](https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.apps.get_model) method to dynamically get a model.
```
from django.apps import apps
My... | ```
from django.authx.models import User
model = User
model.objects.all()
``` |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | Classes are "first class" objects in Python, meaning they can be passed around and manipulated just like all other objects.
Models are classes -- you can tell from the fact that you create new models using class statements:
```
class Person(models.Model):
last_name = models.CharField(max_length=64)
class Anthrop... | >
> model = django.authx.models.User
>
>
> ? Django returns an error, "global
> name django is not defined."
>
>
>
Django does not return the error. Python does.
First, you MUST import the model. You must import it with
```
from django.authx.models import User
```
Second, if you get an error that `django` i... |
411,810 | Without having the full module path of a Django model, is it possible to do something like:
```
model = 'User' [in Django namespace]
model.objects.all()
```
...as opposed to:
```
User.objects.all().
```
EDIT: I am trying to make this call based on command-line input. Is it possible to avoid the import statement, ... | 2009/01/04 | [
"https://Stackoverflow.com/questions/411810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44440/"
] | For Django 1.7+, there is an [applications registry](https://docs.djangoproject.com/en/1.8/ref/applications/#module-django.apps). You can use the [`apps.get_model`](https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.apps.get_model) method to dynamically get a model.
```
from django.apps import apps
My... | If you have the model name passed as a string I guess one way could be
```
modelname = "User"
model = globals()[modelname]
```
But mucking about with globals() might be a bit dangerous in some contexts. So handle with care :) |
4,297,503 | In continuation to my question asked [here](https://stackoverflow.com/questions/4212105/how-to-get-and-display-the-list-of-youtube-videos-using-javascript), i have created a test app to check the json parsing using jquery.
It doesnt seem to work. I can append data in the click function. However getting data from that ... | 2010/11/28 | [
"https://Stackoverflow.com/questions/4297503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/372026/"
] | The callback is provided so that you can bypass the same origin policy. Thus retrieved JSON data is enclosed within the function name and cannot be parsed directly. Details of doing this with jquery are given [here](http://api.jquery.com/jQuery.ajax/). Please refer the example given below
```
<script>
$.ajax({
... | the url does not return a json like you would like try without the `callback=function`
with the callback it uses a method called jsonp:
<http://ajaxian.com/archives/jsonp-json-with-padding> |
43,066,698 | I'm studying UWP by Windows 10 development for absolute beginners, and I meet some problems.
Reflash my ObservableCollection<> data will cause the screen to flash. How do I fix it?
The program details are in [UWP beginner](https://channel9.msdn.com/Series/Windows-10-development-for-absolute-beginners/UWP-044-Adeptly-Ad... | 2017/03/28 | [
"https://Stackoverflow.com/questions/43066698",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7439395/"
] | Assuming
```
NewsItem.Clear();
filteredNewsItems.ForEach(p => NewsItem.Add(p));
```
should be
```
NewsItems.Clear();
filteredNewsItems.ForEach(p => NewsItems.Add(p));
```
I assume the "flash" you are seeing (can't be certain as you haven't provided a full repro) is due to what you're doing to show the updated li... | OK... I think I've found a solution for you.
Instead of updating the bindings in your user control with the lambda expression, try it this way:
```
public NewsContentControl()
{
this.InitializeComponent();
this.DataContextChanged += OnDataCtxChanged; //+= (s, e) => Bindings.Update();
}
private void OnDataCtx... |
128,817 | I am new to Ubuntu, and I have just installed Ubuntu 12.04 on a computer. I am using an automatic proxy server. When I select a software package to install and input my password, the progress icon displays for a few seconds, and then it stops. I tried to install different programs, and I always had the same problem. I ... | 2012/04/30 | [
"https://askubuntu.com/questions/128817",
"https://askubuntu.com",
"https://askubuntu.com/users/58882/"
] | Here is a work around. Once you find a game you want to install, you can search for it in the terminal with (for example \*\* Super Tux):
```
apt-cache search Super Tux
```
Then you can install one of the names it displays by for example:
```
sudo apt-get install supertux
```
If you want to install a game from *d... | I had the same problem with software. It's probably a permission thing.
On my menu the command to open uses software-center with pkexec, which command without parameters defaults to superuser. It seems to have issues.
By altermint the menu command to gksu software-center I found it worked and installed programs with... |
128,817 | I am new to Ubuntu, and I have just installed Ubuntu 12.04 on a computer. I am using an automatic proxy server. When I select a software package to install and input my password, the progress icon displays for a few seconds, and then it stops. I tried to install different programs, and I always had the same problem. I ... | 2012/04/30 | [
"https://askubuntu.com/questions/128817",
"https://askubuntu.com",
"https://askubuntu.com/users/58882/"
] | Just use synaptic package manager, even though it's not as fancy as the software center. To install it type: `sudo apt-get install synaptic` in the terminal. | I had the same problem with software. It's probably a permission thing.
On my menu the command to open uses software-center with pkexec, which command without parameters defaults to superuser. It seems to have issues.
By altermint the menu command to gksu software-center I found it worked and installed programs with... |
233,097 | The Premise
===========
* An earth-like world (gravity, 1 moon, distance from star)
* Oceans do not touch the ground (ignoring the how for this premise, but for consistency we'll say it's floating atop **1 km** of air)
* Oceans still in contact with shorelines (allowed to touch ground starting a maximum of 1km from sh... | 2022/07/22 | [
"https://worldbuilding.stackexchange.com/questions/233097",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/97249/"
] | It wouldn't change much
=======================
Your scenario is roughly equivalent to "There's a huge, 1 km deep, pocket of air at the bottom of the ocean, and all the ground below the continental shelf is dry"
Waves on the ocean are mostly governed by surface effects, so what is happening deep below the surface wil... | Same amount of fluid
====================
If the ocean is sitting atop a layer of air, then we still have the same volume of fluid. The "ceiling" of the air layer, where it meets the ocean, might fluctuate by a very small amount (centimeters at most) in some places.
"What about the density?"
The deep ocean has very ... |
233,097 | The Premise
===========
* An earth-like world (gravity, 1 moon, distance from star)
* Oceans do not touch the ground (ignoring the how for this premise, but for consistency we'll say it's floating atop **1 km** of air)
* Oceans still in contact with shorelines (allowed to touch ground starting a maximum of 1km from sh... | 2022/07/22 | [
"https://worldbuilding.stackexchange.com/questions/233097",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/97249/"
] | It wouldn't change much
=======================
Your scenario is roughly equivalent to "There's a huge, 1 km deep, pocket of air at the bottom of the ocean, and all the ground below the continental shelf is dry"
Waves on the ocean are mostly governed by surface effects, so what is happening deep below the surface wil... | There would be (virtually) no tsunamis
--------------------------------------
Tsunamis are caused by the land displacing large amounts of water when an earthquake occurs. With a 1km air buffer between land and sea, there would not be a direct land-water interface to move the water, and the air would likely absorb most... |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | Use an image relay script!
To serve a imagefile that is outside the public\_html folder you would have to do it by a php script. E.g make a image-relay.php that reads the image that is outside the public html...
```
<?php
header('Content-Type: image/jpeg');
$_file = 'myimage.jpg'; // or $_GET['img']
echo file_get_con... | Well, a web browser will only be able to access files and folders inside public\_html. |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | You want something that's basically impossible.
The way a browser loads a page (in a very basic sense) is this:
Step 1: Download the page.
Step 2: Parse the page.
Step 3: Download anything referenced in the content of the page (images, stylesheets, javascripts, etc)
Each "Download" event is atomic.
It seems like y... | Well, a web browser will only be able to access files and folders inside public\_html. |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | Use an image relay script!
To serve a imagefile that is outside the public\_html folder you would have to do it by a php script. E.g make a image-relay.php that reads the image that is outside the public html...
```
<?php
header('Content-Type: image/jpeg');
$_file = 'myimage.jpg'; // or $_GET['img']
echo file_get_con... | If the `public_html` directory is the root of the server for your users, Apache cannot serve anything that is not inside/below that dorectory.
If you want a file to be served by Apache directly, you'll have to put it in/below `public_html`. |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | You want something that's basically impossible.
The way a browser loads a page (in a very basic sense) is this:
Step 1: Download the page.
Step 2: Parse the page.
Step 3: Download anything referenced in the content of the page (images, stylesheets, javascripts, etc)
Each "Download" event is atomic.
It seems like y... | If the `public_html` directory is the root of the server for your users, Apache cannot serve anything that is not inside/below that dorectory.
If you want a file to be served by Apache directly, you'll have to put it in/below `public_html`. |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | Use an image relay script!
To serve a imagefile that is outside the public\_html folder you would have to do it by a php script. E.g make a image-relay.php that reads the image that is outside the public html...
```
<?php
header('Content-Type: image/jpeg');
$_file = 'myimage.jpg'; // or $_GET['img']
echo file_get_con... | I think your misunderstanding is in the fact that if you include an image in an `<img>` tag, your browser will send the exact same request to the webserver to fetch it, that will be sent to the webserver if you try to open the `src` url of the image in your browser directly.
Therefore, either both things work, or neit... |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | Use an image relay script!
To serve a imagefile that is outside the public\_html folder you would have to do it by a php script. E.g make a image-relay.php that reads the image that is outside the public html...
```
<?php
header('Content-Type: image/jpeg');
$_file = 'myimage.jpg'; // or $_GET['img']
echo file_get_con... | If you are using Apache or lighttpd you can use the X-Sendfile header to send files that are not in the web root(provided you haven't changed the configuration of mod\_xsendfile).
To learn more about X-sendfile see this [site](http://codeutopia.net/blog/2009/03/06/sending-files-better-apache-mod_xsendfile-and-php/).
... |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | You want something that's basically impossible.
The way a browser loads a page (in a very basic sense) is this:
Step 1: Download the page.
Step 2: Parse the page.
Step 3: Download anything referenced in the content of the page (images, stylesheets, javascripts, etc)
Each "Download" event is atomic.
It seems like y... | Use an image relay script!
To serve a imagefile that is outside the public\_html folder you would have to do it by a php script. E.g make a image-relay.php that reads the image that is outside the public html...
```
<?php
header('Content-Type: image/jpeg');
$_file = 'myimage.jpg'; // or $_GET['img']
echo file_get_con... |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | You want something that's basically impossible.
The way a browser loads a page (in a very basic sense) is this:
Step 1: Download the page.
Step 2: Parse the page.
Step 3: Download anything referenced in the content of the page (images, stylesheets, javascripts, etc)
Each "Download" event is atomic.
It seems like y... | I think your misunderstanding is in the fact that if you include an image in an `<img>` tag, your browser will send the exact same request to the webserver to fetch it, that will be sent to the webserver if you try to open the `src` url of the image in your browser directly.
Therefore, either both things work, or neit... |
1,415,973 | I am trying to secure my PHP Image upload script and the last hurdle I have to jump is making it so that users cannot directly excecute the images, but the server can still serve them in web pages. I tried changing ownership and permissions of the folders to no avail, so I am trying to store the images above public\_ht... | 2009/09/12 | [
"https://Stackoverflow.com/questions/1415973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84292/"
] | You want something that's basically impossible.
The way a browser loads a page (in a very basic sense) is this:
Step 1: Download the page.
Step 2: Parse the page.
Step 3: Download anything referenced in the content of the page (images, stylesheets, javascripts, etc)
Each "Download" event is atomic.
It seems like y... | If you are using Apache or lighttpd you can use the X-Sendfile header to send files that are not in the web root(provided you haven't changed the configuration of mod\_xsendfile).
To learn more about X-sendfile see this [site](http://codeutopia.net/blog/2009/03/06/sending-files-better-apache-mod_xsendfile-and-php/).
... |
15,105,461 | In my application, I want to open device default calendar using code/programatically. I am using this code :
```
private void viewAllCalender() {
// TODO Auto-generated method stub
Intent i = new Intent();
if(Build.VERSION.SDK_INT >= 8 && Build.VERSION.SDK_INT <= 14){
i.setClassName... | 2013/02/27 | [
"https://Stackoverflow.com/questions/15105461",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1114329/"
] | You gotta realise that you can't expect an Android device to have a certain application. Not even the play app can be expected to be installed. The correct way of doing this is simply not using .setClassName and then let the user decide what to do.
There is a dozen different calendar apps and the phone manufactures ea... | To open the calendar application refer to the intent-view guide <http://developer.android.com/guide/topics/providers/calendar-provider.html#intent-view> |
6,090,160 | Let's say I started Linux process, in the background. It is not a daemon, just a utility.
If it gets SIGHUP, it would be killed.
I did not take the "nohup" precaution. It is taking already much longer time than I thought.
After 4 hours of running, ssh session might get disconnected. But I don't want to lose the pro... | 2011/05/22 | [
"https://Stackoverflow.com/questions/6090160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/564524/"
] | Use `disown(1)`
>
> disown: disown [-h] [-ar] [jobspec
> ...]
> Remove jobs from current shell.
>
>
>
> ```
> Removes each JOBSPEC argument from the table of active jobs. Without
> any JOBSPECs, the shell uses its notion of the current job.
>
> Options:
> -a remove all jobs if JOBSPEC is not supplied
... | Diswon is the good solution for this time.
For the future, a nice workaround is to use "screen" tool : if ever your ssh session disconnects, you can reconnect and refetch your still running screen.
However, I don't know a way to pull a current process into a screen session, so it won't solve your current case. |
48,155,799 | I am trying to calculate the average number participants scored correct on a memory task. I have a column called `RecallType` which tells me if participants were assessed through forward memory recall (called `forwards`) or through backwards memory recall (called `backwards`). I also have a column called `ProbeState` w... | 2018/01/08 | [
"https://Stackoverflow.com/questions/48155799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8137074/"
] | THe problem is that you have a non virtual `foo()` so that `A::bar()` will call the only `foo()` it knows, being `A::foo()`, even if it's B that invokes it.
Try:
```
class A {
public:
A() { foo(); }
virtual ~A() { foo(); } // <<---------- recommendation
virtual void foo() { cout << 3; } //... | You must include virtual in order to override the functionality stored in A.
Add to A
```
virtual void foo() { cout << 3; }
```
and to B
```
void foo() override { cout << 2; }
```
Should do the trick. Virtual functions are member functions whose behavior can be overridden in derived classes. As opposed to non-v... |
48,155,799 | I am trying to calculate the average number participants scored correct on a memory task. I have a column called `RecallType` which tells me if participants were assessed through forward memory recall (called `forwards`) or through backwards memory recall (called `backwards`). I also have a column called `ProbeState` w... | 2018/01/08 | [
"https://Stackoverflow.com/questions/48155799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8137074/"
] | THe problem is that you have a non virtual `foo()` so that `A::bar()` will call the only `foo()` it knows, being `A::foo()`, even if it's B that invokes it.
Try:
```
class A {
public:
A() { foo(); }
virtual ~A() { foo(); } // <<---------- recommendation
virtual void foo() { cout << 3; } //... | Member `A::foo` is non-virtual and will therefore be statically bound wherever used. So when compiling `A::bar`, the call to `foo()` will be (statically) bound to the implementation `A::foo()`. This statical binding in `A::foo` will not be changed by the fact that you create an instance of derived class `B` later on.
... |
48,155,799 | I am trying to calculate the average number participants scored correct on a memory task. I have a column called `RecallType` which tells me if participants were assessed through forward memory recall (called `forwards`) or through backwards memory recall (called `backwards`). I also have a column called `ProbeState` w... | 2018/01/08 | [
"https://Stackoverflow.com/questions/48155799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8137074/"
] | Member `A::foo` is non-virtual and will therefore be statically bound wherever used. So when compiling `A::bar`, the call to `foo()` will be (statically) bound to the implementation `A::foo()`. This statical binding in `A::foo` will not be changed by the fact that you create an instance of derived class `B` later on.
... | You must include virtual in order to override the functionality stored in A.
Add to A
```
virtual void foo() { cout << 3; }
```
and to B
```
void foo() override { cout << 2; }
```
Should do the trick. Virtual functions are member functions whose behavior can be overridden in derived classes. As opposed to non-v... |
32,739,725 | I have a list of users and when I click on a list item I would like a sub section to slide down from beneath it. I'm fine with the animation and this isn't the area I need help on. My problem is that when I click on any list item, all drop-down sections appear underneath all list items.
So my approach now is to use th... | 2015/09/23 | [
"https://Stackoverflow.com/questions/32739725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1003632/"
] | what you can do is.. set the id to show on ng-click and check that id in ng-show
`ng-click="idToDisplay = user.id"`
and
`ng-show="idToDisplay == user.id"` | You can keep track of the user for which details are currently shown via a variable on the scope. You set this variable when you click on a user.
```
$scope.userDetailId = 0;
$scope.showUserDetail = function (id) {
$scope.userDetailId = id;
}
```
Then, inside your `ng-repeat` section, you can check if the curre... |
16,864,635 | How can I animate an MKMapView to certain lat and lng?
I have a map that is displayed when the user opens the app. When a user clicks a certain button I want the map to move to a specificc lat/lng.
Is there not an animateTo(CLLocation) method? | 2013/05/31 | [
"https://Stackoverflow.com/questions/16864635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/307428/"
] | This will animate to roughly the center of continental US:
```
MKCoordinateRegion region = mapView.region;
region.center.latitude = 39.833333;
region.center.longitude = -98.58333;
region.span.latitudeDelta = 60;
region.span.longitudeDelta = 60;
[mapView setRegion:region animated:YES];
```
set your "center" to your l... | This will scroll the map view to your new location:
```
CLLocationCoordinate2D yourCoordinate = CLLocationCoordinate2DMake(lat, lng);
[self.mapView setCenterCoordinate:yourCoordinate animated:YES];
``` |
15,259,830 | I am attempting to write a method that will output the content (i.e. HTML) for any renderings that happen to exist within a specific placeholder. The goal is to pass in a `Sitecore.Data.Items.Item` and the placeholder key that i'm interested in, and the method should return the rendered content.
The issue with this se... | 2013/03/06 | [
"https://Stackoverflow.com/questions/15259830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/185749/"
] | It is almost 8 years since the question was originally asked, and it turn to be [Uniform](https://uniform.dev/uniform-for-sitecore) - rendering any item/placeholder fragment!
Yes, it cuts the item you supply into placeholders/renderings:
[](https://i... | In my opinion, the best way to programmatically render a Sublayout is to use a repeater, and put a `<sc:Sublayout>` tag in the `<ItemTemplate>`.
From there you only have to do one or both of the following:
1. Set the `DataSource` property of the `<sc:Sublayout>` to be the string representation of the desired item's ... |
43,181,597 | I'm working on a magento project with a plugin changes the `onclick` attribute on the `(document).ready()`. I tried to access this attribute using jquery to update it after a user action but it returns `undefined`. And I've noticed that the onclick attribute is NOT visible in the inspector but visible in the page sourc... | 2017/04/03 | [
"https://Stackoverflow.com/questions/43181597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1290292/"
] | click event is binded to the button and the onclick attribute isn't set explicitly as a html attribute on the button so,
```
btn.attr('onclick')
```
will return **undefined**
and to solve this problem you need to off (unbind) the current click event and on (bind) the new click event as following:
```
btn.off('clic... | In your issue description you said you use a plugin which changes the onclick attribute. It seems that there is a JS code which actually deletes that attribute. Can you disable that plugin just to make sure the onclick attribute is NOT deleted? |
34,249,401 | I was trying to store a json string in local storage and retrieving the value in another function but its not working as expected
For storing
```
var data = '{"history":['+'{"keyword":"'+key+'","msg":"'+msg+'","ver":"'+ver+'"}]}';
localStorage.setItem("history",JSON.stringify(data));
```
For retr... | 2015/12/13 | [
"https://Stackoverflow.com/questions/34249401",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4066325/"
] | The variable you are trying to store is already a json encoded string. You can not `stringify` it again.
You can drop those `'` and reformat the json, then it would be a normal json, then you can call `stringify` on it.
```
var data = {"history":[{"keyword":key,"msg":msg,"ver":ver}]};
localStorage.setItem("history", ... | You have already a JSON string. After JSON.stringify you get a string from a string.
The array size is one, because the content in one object.
```js
var key = 'KEY', msg = 'MSG', ver = 'VER',
data = '{"history":[' + '{"keyword":"' + key + '","msg":"' + msg + '","ver":"' + ver + '"}]}',
obj = JSON.parse(data... |
29,067,083 | I already have this line for Linux box.
```
find . -type f -name '*.txt' -exec ls -l {} \;
```
It's getting all the TXT files in directory. But what I can't do and what I want to do is, to read all the .txt files on subfolder in one directory.
For example : ParentTxtFolder --> ChildTxtFolder --> Txtfolder1, Txtfold... | 2015/03/15 | [
"https://Stackoverflow.com/questions/29067083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4472008/"
] | In your shiro.ini set a web session manager and set that into your security manager. See that helps.
```
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
``` | I had the same problem and I solved it simple by cleaning the cache and cookies from local-host (or whatever is the server address) at the browser.
None of the suggestions above worked for me. |
71,453,541 | I am trying to deploy my app on Heroku with node.js. App is running fine on my local but when I try to deploy it on Heroku it gives the following error:
```
2022-03-13T00:12:16.474210+00:00 heroku[web.1]: Starting process with command `bin/boot`
2022-03-13T00:12:17.528943+00:00 app[web.1]: bash: bin/boot: No such file... | 2022/03/13 | [
"https://Stackoverflow.com/questions/71453541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17481832/"
] | I would recommend to switch from a web page that serves the sitemap when it's called, to a script that generates static XMLs and that you can optionally call via `crontab`.
Step 1: Define directory where sitemaps are saved
-------------------------------------------------
This will be used to write one static `xml` f... | You should start the array generated from the scandir with the 50001, but it would be better to split it into several scripts with a crontab, so you don't exhaust the server with excessive runtime; otherwise, increase the runtime of PHP scripts. |
51,889,794 | Here's my custom module stored in `util.py` that wrapps up 3-steps what I always gone-through to read images when using `tensorflow`
```
#tf_load_image from path
def load_image(image_path, image_shape, clr_normalize = True ):
'''returns tensor-array on given image path and image_shape [height, width]'''
impor... | 2018/08/17 | [
"https://Stackoverflow.com/questions/51889794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8889050/"
] | >
> But this is quite inefficient (...) since it generally calls `import tensorflow as tf` everytime I read "single image".
>
>
>
imported modules are cached in `sys.modules` on first import (I mean "the very first time a module is imported in a given process"), subsequent calls will retrieve already imported modu... | As @MatrixTai has suggested in the comments, you could make `utils.py` like this:
```
import tensorflow as tf
def load_image(.........):
............
```
and in `main.py`, you could `import util` as you want to. |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can't do it the way you want to because borders add pixels to the dimensions.
The closest thing you could do is remove one of the sides of each rectangle that otherwise would have double, [like this](http://jsfiddle.net/cyd4M/), but the container still has to be `153px` by `153px` because you have the border each... | the div falling out of the container is expected behavior because you are making a floating div. when the size of the screen grows the div is bound to be squeeze out of the container. |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your borders push it out. Set the border to the container and leave the height and width at 150px, as it should be with rectangles of 100x50 in the layout you posted. Cleaned up the code.
[**JSFiddle demonstration.**](http://jsfiddle.net/v8uR7/)
```
* {
margin:0px auto;
}
#main {
height:100%;
width:100%;... | You can't do it the way you want to because borders add pixels to the dimensions.
The closest thing you could do is remove one of the sides of each rectangle that otherwise would have double, [like this](http://jsfiddle.net/cyd4M/), but the container still has to be `153px` by `153px` because you have the border each... |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I did this and it worked:
html
```
<div id="container">
<div id="div1">1</div>
<div id="div2">2</div>
<div id="div3">3</div>
<div id="div4">4</div>
</div>
```
css:
```
* {
padding: 0;
margin: 0;
}
#container {
border: 1px dotted green;
width: 250px;
height: 250px;
margi... | the div falling out of the container is expected behavior because you are making a floating div. when the size of the screen grows the div is bound to be squeeze out of the container. |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your borders push it out. Set the border to the container and leave the height and width at 150px, as it should be with rectangles of 100x50 in the layout you posted. Cleaned up the code.
[**JSFiddle demonstration.**](http://jsfiddle.net/v8uR7/)
```
* {
margin:0px auto;
}
#main {
height:100%;
width:100%;... | I did this and it worked:
html
```
<div id="container">
<div id="div1">1</div>
<div id="div2">2</div>
<div id="div3">3</div>
<div id="div4">4</div>
</div>
```
css:
```
* {
padding: 0;
margin: 0;
}
#container {
border: 1px dotted green;
width: 250px;
height: 250px;
margi... |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | <http://jsfiddle.net/ku9bf/1/>
Use negative margins, ex:
```
#box3 { margin-top: -1px; }
```
and reduce the max-width of the container by 1px. | the div falling out of the container is expected behavior because you are making a floating div. when the size of the screen grows the div is bound to be squeeze out of the container. |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your borders push it out. Set the border to the container and leave the height and width at 150px, as it should be with rectangles of 100x50 in the layout you posted. Cleaned up the code.
[**JSFiddle demonstration.**](http://jsfiddle.net/v8uR7/)
```
* {
margin:0px auto;
}
#main {
height:100%;
width:100%;... | <http://jsfiddle.net/ku9bf/1/>
Use negative margins, ex:
```
#box3 { margin-top: -1px; }
```
and reduce the max-width of the container by 1px. |
21,769,489 | I'm attempting create the following using HTML and CSS only.
* Each rectangle is either `50px` by `100px` and `100px` by `50px`.
* The RGB are `#ffffff`, `#cccccc`, `#999999`, `#666666`, `#333333`, order does not
matter.
* The border is `1px` in color `#000000`.
* Place the product at the center of the page.
What I h... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21769489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your borders push it out. Set the border to the container and leave the height and width at 150px, as it should be with rectangles of 100x50 in the layout you posted. Cleaned up the code.
[**JSFiddle demonstration.**](http://jsfiddle.net/v8uR7/)
```
* {
margin:0px auto;
}
#main {
height:100%;
width:100%;... | the div falling out of the container is expected behavior because you are making a floating div. when the size of the screen grows the div is bound to be squeeze out of the container. |
1,326,572 | Let $X$ be a (possibly T1, that is, singleton subsets are closed) topological space. Suppose that there is a *proper* subset $D \subset X$ such that:
* $D$ is dense in $X$;
* $D$ is homeomorphic to $X$.
What can be said about $X$? | 2015/06/15 | [
"https://math.stackexchange.com/questions/1326572",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/248346/"
] | $$32(x + 1) = y^2 \implies 32 \mid y^2 \implies 4 \mid y$$ so let $y = 4z$. $$2(x+1) = z^2 \implies 2 \mid z$$ so let $z = 2w$ $$x + 1 = 2w^2 $$ so given any $w$ we can solve for $x$.
So the set of solutions is
$$\{(2w^2 - 1, 8w) \mid w \in \Bbb Z\}$$ | The answer by user3491648 gives a complete characterization of the full set of values $x$ for which $32x+32$ is a square numbers. This is really just an observation on the set of values
$$\{64,1600,53824,1827904,62094400,2109381184\}$$
reported by the OP.
These are not actually values that $x$ takes on. (As user34... |
1,326,572 | Let $X$ be a (possibly T1, that is, singleton subsets are closed) topological space. Suppose that there is a *proper* subset $D \subset X$ such that:
* $D$ is dense in $X$;
* $D$ is homeomorphic to $X$.
What can be said about $X$? | 2015/06/15 | [
"https://math.stackexchange.com/questions/1326572",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/248346/"
] | $$32(x + 1) = y^2 \implies 32 \mid y^2 \implies 4 \mid y$$ so let $y = 4z$. $$2(x+1) = z^2 \implies 2 \mid z$$ so let $z = 2w$ $$x + 1 = 2w^2 $$ so given any $w$ we can solve for $x$.
So the set of solutions is
$$\{(2w^2 - 1, 8w) \mid w \in \Bbb Z\}$$ | Solution for x such that 32x+32 is a square as follows:
For integral solution, x= (n2 -2)/2 such that x is in Natural number.(n is in natural number) |
1,326,572 | Let $X$ be a (possibly T1, that is, singleton subsets are closed) topological space. Suppose that there is a *proper* subset $D \subset X$ such that:
* $D$ is dense in $X$;
* $D$ is homeomorphic to $X$.
What can be said about $X$? | 2015/06/15 | [
"https://math.stackexchange.com/questions/1326572",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/248346/"
] | The answer by user3491648 gives a complete characterization of the full set of values $x$ for which $32x+32$ is a square numbers. This is really just an observation on the set of values
$$\{64,1600,53824,1827904,62094400,2109381184\}$$
reported by the OP.
These are not actually values that $x$ takes on. (As user34... | Solution for x such that 32x+32 is a square as follows:
For integral solution, x= (n2 -2)/2 such that x is in Natural number.(n is in natural number) |
18,024,759 | I want to prevent a ComboBox to resize acording to the size of the selected item. Consider this simplified example:
```
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="150" Width... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18024759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1094526/"
] | Edit:
-----
I looked again at the problem and found out much simpler solution than previously proposed. The idea is to override MeasureOverride function of the ComboBox class and provide limited space that is available, where width is equal to the MinWidth property of the ComboBox. In order to do that we create ComboB... | I had the same problem with a ComboBox inside a ScrollViewer. I did not want a horizontal scrolling but only vertical. But the ComboBox kept resizing itself to the selected item. I used aligators answer but replaced MinWidth with ActualWidth which keeps the CombobBox from resizing itself, but the selected item will alw... |
462,153 | I have thermoelectric modules and set it in series, then I connected to a DC to DC step up (CN6009) to enhance the voltage. Then I connected to my phone with usb charger to try charge with it, but the voltage suddenly drops. Should I change the step up or increase the amount of the module? | 2019/10/09 | [
"https://electronics.stackexchange.com/questions/462153",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/233718/"
] | You've got a couple of things going on that are causing your problems:
1. The output resistance of [TEG modules](https://en.wikipedia.org/wiki/Thermoelectric_generator#Practical_limitations) is fairly high. They act like a battery with a big resistor in series.
2. By boosting the voltage, you increase the needed curre... | I think that peltier devices act as current sources up to some maximum voltage. If you demand more current than the devices supply, the voltage will drop. Measure the current produced by one device and then calculate the number of peltier devices you need to deliver the target current into your boost converter. |
1,295,381 | I'm trying to convert a **mkv** file and add a watermark logo to it, but I tried a bunch of different instructions but it is always missing the logo after 24 seconds of the video.
Here's my code:
```
ffmpeg \
-i RTed83e104ac4d98c46383630d733a3282.mkv \
-i RT894ce44c6ba84eb98300566adae4e7bf.mka \
-i logo_whit... | 2018/02/15 | [
"https://superuser.com/questions/1295381",
"https://superuser.com",
"https://superuser.com/users/873164/"
] | WebRTC sourced inputs are often sloppy and may change parameters midstream resulting in surprises. In your case a lazy solution could be to loop the overlay image:
```
ffmpeg \
-i RTed83e104ac4d98c46383630d733a3282.mkv \
-i RT894ce44c6ba84eb98300566adae4e7bf.mka \
-loop 1 -i logo_white.png \
-filter_complex "[... | I was able to do what I was looking for, but I had to do it in steps. I think my problem was because my videos are from WebRTC as @LordNeckbeard explained bellow. Here's my **solution** if someone in the future needs it:
```
# convert student video + audio
ffmpeg \
-i RT0dcbc54f85d17eb6f7922f58f7b12079.mkv \
-i RT... |
73,937,079 | I have a table that contains this (HIght value, LOw value data according to a DatetTime):
```
mysql> select dt, hi, lo from mytable where dt >='2022-10-03 09:20:00' limit 20;
+---------------------+--------+--------+
| dt | hi | lo |
+---------------------+--------+--------+
| 2022-10-03 09:2... | 2022/10/03 | [
"https://Stackoverflow.com/questions/73937079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15157921/"
] | You have to use `(select rlo)` because you can't refer to a column alias in the same query
The more proper way to do this is with a self-join, then you don't need multiple selects for each calculation. You need to use `LEFT JOIN` to get null values when there's no matching row.
```
SELECT t1.dt as rdt, t1.hi as rhi, ... | ad 1) you've got to think of the logical execution order of SQL queries which is roughly: FROM (data source), WHERE (filter), SELECT (projection).
That is, the expressions in the SELECT clause are applied to the filtered data specified in the FROM and WHERE clauses. Therefore it makes perfect sense that an expression ... |
73,937,079 | I have a table that contains this (HIght value, LOw value data according to a DatetTime):
```
mysql> select dt, hi, lo from mytable where dt >='2022-10-03 09:20:00' limit 20;
+---------------------+--------+--------+
| dt | hi | lo |
+---------------------+--------+--------+
| 2022-10-03 09:2... | 2022/10/03 | [
"https://Stackoverflow.com/questions/73937079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15157921/"
] | Thanks to Barmar and Mihe, I understood LEFT JOIN and INNER JOIN.
And I think that INNER JOIN is what I often used without knowing it (without specifying INNER JOIN in the query):
-> Me, before:
```
mysql> SELECT t1.dt as rdt, t1.hi as rhi, t2.lo AS rlo, t1.hi - t2.lo AS rdif
-> FROM valtest_xpar_dbg_i AS t1, v... | ad 1) you've got to think of the logical execution order of SQL queries which is roughly: FROM (data source), WHERE (filter), SELECT (projection).
That is, the expressions in the SELECT clause are applied to the filtered data specified in the FROM and WHERE clauses. Therefore it makes perfect sense that an expression ... |
59,394,539 | When estimating the time complexity of a certain algorithm, let's say the following in pseudo code:
```
for (int i=0; i<n; i++) ---> O(n)
//comparison? ---> ?
//substitution ---> ?
for (int i=0; i<n; i++) ---> O(n)
//some function which is not recursive
```
In this case the time complexity of these instructio... | 2019/12/18 | [
"https://Stackoverflow.com/questions/59394539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4627565/"
] | First, read [this](http://kddlab.zjgsu.edu.cn:7200/students/lipengcheng/%E7%AE%97%E6%B3%95%E5%AF%BC%E8%AE%BA%EF%BC%88%E8%8B%B1%E6%96%87%E7%AC%AC%E4%B8%89%E7%89%88%EF%BC%89.pdf) book. Here is good explanation of this topic.
1. Comparsion. For instance, we have two variables **a** and **b**. And when we doing this `a==b... | >
> but how about the comparison and substitution operations are they
> constant time since they don't depend on n?
>
>
>
**Yes**. Comparison and substitution operations are a constant factor because their execution time doesn't depend on a size of the input. Their execution time takes time but, again, it's indep... |
59,394,539 | When estimating the time complexity of a certain algorithm, let's say the following in pseudo code:
```
for (int i=0; i<n; i++) ---> O(n)
//comparison? ---> ?
//substitution ---> ?
for (int i=0; i<n; i++) ---> O(n)
//some function which is not recursive
```
In this case the time complexity of these instructio... | 2019/12/18 | [
"https://Stackoverflow.com/questions/59394539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4627565/"
] | Both of the other answers assume you are comparing some sort of fixed-size data type, such as 32-bit integers, doubles, or characters. If you are using operators like `<` in a language such as Java where they can only be used on fixed-size data types, and cannot be overloaded, then that is correct. But your question is... | >
> but how about the comparison and substitution operations are they
> constant time since they don't depend on n?
>
>
>
**Yes**. Comparison and substitution operations are a constant factor because their execution time doesn't depend on a size of the input. Their execution time takes time but, again, it's indep... |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | To remove you can simply use:
```
[myTextField removeFromSuperview];
``` | You can use `[myTextField removeFromSuperview];` to get rid of a view. |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | try this one...
>
> Blockquote
>
>
>
UILabel \*t1;
```
NSArray *arr1=[YourView subviews];
for (UIView *v in arr1)
{
if([v isKindOfClass:[UILabel class]])
{
t1 = (UILabel *)v;
if (t1.tag==your_tag)
[t1 removeFromSuperview];
}
}
```
>
> Blockquote
>
>
> | You can use `[myTextField removeFromSuperview];` to get rid of a view. |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | To remove you can simply use:
```
[myTextField removeFromSuperview];
``` | ```
[myTextField removeFromSuperview]
```
See [UIView documentation](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html). |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | try this one...
>
> Blockquote
>
>
>
UILabel \*t1;
```
NSArray *arr1=[YourView subviews];
for (UIView *v in arr1)
{
if([v isKindOfClass:[UILabel class]])
{
t1 = (UILabel *)v;
if (t1.tag==your_tag)
[t1 removeFromSuperview];
}
}
```
>
> Blockquote
>
>
> | ```
[myTextField removeFromSuperview]
```
See [UIView documentation](http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html). |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | To remove you can simply use:
```
[myTextField removeFromSuperview];
``` | All controls inherited from UIView.
So you can remove all the controls which added on UIView using like this. By clicking the button action write like this
```
for(UIView *control in [self.view subviews])
{
[control removeFromSuperview];
}
``` |
17,365,606 | I am using FormView control, and I want to programmatically insert null value in OnItemInserting and OnItemUpdating event, by NewValues dictioanry in FormViewUpdateEventArgs parameter. But if I use
```
protected void FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
e.NewValues["EntityFrameworkEnti... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17365606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831219/"
] | try this one...
>
> Blockquote
>
>
>
UILabel \*t1;
```
NSArray *arr1=[YourView subviews];
for (UIView *v in arr1)
{
if([v isKindOfClass:[UILabel class]])
{
t1 = (UILabel *)v;
if (t1.tag==your_tag)
[t1 removeFromSuperview];
}
}
```
>
> Blockquote
>
>
> | All controls inherited from UIView.
So you can remove all the controls which added on UIView using like this. By clicking the button action write like this
```
for(UIView *control in [self.view subviews])
{
[control removeFromSuperview];
}
``` |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Windows RDP uses the executable mstsc.exe located in c:\windows\system32
Simply right click on this file, and go to properties, then click the version tab.
hope this helps. | or you could also click Start > Run > mstsc and when you see the Remote Desktop Connection window appear, click the top left hand corner "computer" icon and select "About". |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Or you could Right click on the window and select About
 | Windows RDP uses the executable mstsc.exe located in c:\windows\system32
Simply right click on this file, and go to properties, then click the version tab.
hope this helps. |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Windows RDP uses the executable mstsc.exe located in c:\windows\system32
Simply right click on this file, and go to properties, then click the version tab.
hope this helps. | Here's a PowerShell query you can use:
```
wmic datafile where name="C:\\windows\\system32\\mstsc.exe" get manufacturer, name, version
``` |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Windows RDP uses the executable mstsc.exe located in c:\windows\system32
Simply right click on this file, and go to properties, then click the version tab.
hope this helps. | There can be maybe better way with PowerShell.
First one need complete table of MSTSC build numbers and just compare to output of:
```
(Get-Item C:\Windows\System32\mstsc.exe).VersionInfo.FileVersion
```
And the second one is to read CLSID of registered components which contain also RDP binaries, like that:
```
$C... |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Or you could Right click on the window and select About
 | or you could also click Start > Run > mstsc and when you see the Remote Desktop Connection window appear, click the top left hand corner "computer" icon and select "About". |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | or you could also click Start > Run > mstsc and when you see the Remote Desktop Connection window appear, click the top left hand corner "computer" icon and select "About". | There can be maybe better way with PowerShell.
First one need complete table of MSTSC build numbers and just compare to output of:
```
(Get-Item C:\Windows\System32\mstsc.exe).VersionInfo.FileVersion
```
And the second one is to read CLSID of registered components which contain also RDP binaries, like that:
```
$C... |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Or you could Right click on the window and select About
 | Here's a PowerShell query you can use:
```
wmic datafile where name="C:\\windows\\system32\\mstsc.exe" get manufacturer, name, version
``` |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Or you could Right click on the window and select About
 | There can be maybe better way with PowerShell.
First one need complete table of MSTSC build numbers and just compare to output of:
```
(Get-Item C:\Windows\System32\mstsc.exe).VersionInfo.FileVersion
```
And the second one is to read CLSID of registered components which contain also RDP binaries, like that:
```
$C... |
118,458 | Does any know how to get the RDP version Windows is running with? | 2010/03/10 | [
"https://superuser.com/questions/118458",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Here's a PowerShell query you can use:
```
wmic datafile where name="C:\\windows\\system32\\mstsc.exe" get manufacturer, name, version
``` | There can be maybe better way with PowerShell.
First one need complete table of MSTSC build numbers and just compare to output of:
```
(Get-Item C:\Windows\System32\mstsc.exe).VersionInfo.FileVersion
```
And the second one is to read CLSID of registered components which contain also RDP binaries, like that:
```
$C... |
21,971,036 | I tried to export a settings.json as documented in the meteor.js documentation in order to connect my Meteor.js app with an external MongoHQ database :
```
{
"env": {
"MONGO_URL" : "mongodb://xxx:xxxx@troup.mongohq.com:10037/xxx"
}
}
```
with the command :
```
mrt deploy myapp.meteor.com --settings... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21971036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2917448/"
] | You are not able to use your own `MONGO_URL` with Meteor deploy hosting.
Meteor deploy hosting takes care of the Email with Mailgun (if you use it), and provides mongodb for all apps deployed there.
It is possible to change the `MAIL_URL`, but it is not possible to use a different mongodb.
You can try, though im not... | Regarded to the Unoficial Meteor.js FAQ, thats not possible to do it easily, that might be tricky.
So i signed up for a modulus Account, with MongoHQ Database.
It works right now. |
21,971,036 | I tried to export a settings.json as documented in the meteor.js documentation in order to connect my Meteor.js app with an external MongoHQ database :
```
{
"env": {
"MONGO_URL" : "mongodb://xxx:xxxx@troup.mongohq.com:10037/xxx"
}
}
```
with the command :
```
mrt deploy myapp.meteor.com --settings... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21971036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2917448/"
] | You are not able to use your own `MONGO_URL` with Meteor deploy hosting.
Meteor deploy hosting takes care of the Email with Mailgun (if you use it), and provides mongodb for all apps deployed there.
It is possible to change the `MAIL_URL`, but it is not possible to use a different mongodb.
You can try, though im not... | having a settings.json file is not enough you need to run with
```
meteor --settings settings.json
```
which is you cant do with meteor.com deploy. |
21,971,036 | I tried to export a settings.json as documented in the meteor.js documentation in order to connect my Meteor.js app with an external MongoHQ database :
```
{
"env": {
"MONGO_URL" : "mongodb://xxx:xxxx@troup.mongohq.com:10037/xxx"
}
}
```
with the command :
```
mrt deploy myapp.meteor.com --settings... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21971036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2917448/"
] | You are not able to use your own `MONGO_URL` with Meteor deploy hosting.
Meteor deploy hosting takes care of the Email with Mailgun (if you use it), and provides mongodb for all apps deployed there.
It is possible to change the `MAIL_URL`, but it is not possible to use a different mongodb.
You can try, though im not... | The application-configuration package (built in meteor package) contains the code to set mongo\_url. See my answer here <https://stackoverflow.com/a/23485319/2391620> |
21,971,036 | I tried to export a settings.json as documented in the meteor.js documentation in order to connect my Meteor.js app with an external MongoHQ database :
```
{
"env": {
"MONGO_URL" : "mongodb://xxx:xxxx@troup.mongohq.com:10037/xxx"
}
}
```
with the command :
```
mrt deploy myapp.meteor.com --settings... | 2014/02/23 | [
"https://Stackoverflow.com/questions/21971036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2917448/"
] | The application-configuration package (built in meteor package) contains the code to set mongo\_url. See my answer here <https://stackoverflow.com/a/23485319/2391620> | Regarded to the Unoficial Meteor.js FAQ, thats not possible to do it easily, that might be tricky.
So i signed up for a modulus Account, with MongoHQ Database.
It works right now. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.