qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
30,868,288 | I have elements with class **.tab** and hover for them:
```
.tab:hover {
background-color: #A9E59E;
}
```
Now, I'm adding additional class to some of those element in JS:
```
this.classList.toggle('tab2');
```
the problem is, I do not wan't hover to fire on those elements with two classes
**classList.lengt... | 2015/06/16 | [
"https://Stackoverflow.com/questions/30868288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2933141/"
] | Try this syntax.
```
[class="tab"]:hover{
background-color: #A9E59E;
}
```
Which will select the class tab ,if it has other class attributes it wont get selected. | I would do something like this:
```
.tab.tab2:hover{
/*apply the same style as for the non hover element */
}
``` |
3,031,110 | How can I set default value for DateTime in optional parameter?
```
public SomeClassInit(Guid docId, DateTime addedOn = DateTime.Now???)
{
//Init codes here
}
``` | 2010/06/13 | [
"https://Stackoverflow.com/questions/3031110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/132917/"
] | There is a workaround for this, taking advantage of nullable types and the fact that `null` is a compile-time constant. (It's a bit of a hack though, and I'd suggest avoiding it unless you really can't.)
```
public void SomeClassInit(Guid docId, DateTime? addedOn = null)
{
if (!addedOn.HasValue)
addedOn = ... | [.NET 4.0 does have optional parameters](http://msdn.microsoft.com/en-us/library/dd264739.aspx). ([google is also your friend](http://www.google.com.au/#hl=en&source=hp&q=optional+paramters+.net+4.0&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=6754f67ee51d4c5b), here.)
EDIT (because of Anthony Pegram correct, comment)...
And yes, ... |
6,047,996 | I'm using the Jersey Client library to run tests against a rest service running on jboss.
I have https set up fine on the server (running on localhost), using a self signed cert.
However whenever I run my tests with the https url I get the following error:
```
com.sun.jersey.api.client.ClientHandlerException: javax.... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6047996",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/105223/"
] | For Jersey 2.\*:
```
Client client = ClientBuilder.newBuilder()
.hostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
}).build()... | I noticed that when using the Apache http client configuration with a pooling manager, the accepted answer doesn't work.
In this case it appears that the `ClientConfig.sslContext` and `ClientConfig.hostnameVerifier` setters are silently ignored. So if you are using connection pooling with the apache client http client... |
45,084,255 | ```
if(!parent[0] || parent[0].style.display !== 'none') {
console.log('1');
}
```
I am trying to do this in one line, but it is failing in Firefox giving Type Error that parent[0] is undefined. But here I am trying to check and just do the if loop if it is. So my only solution to break it in two if's like this:
... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45084255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5390206/"
] | This should do the work:
```
if(parent[0] && parent[0].style.display !== 'none') {
console.log('1');
}
```
Using `someVariable && condition` means that `someVariable` is defined and condition is met.
In my opinion the most readable code is:
```
function doSomething() {
// if condition is not met we quit the ... | Change the logic to `&&`.
```
if(parent[0] && parent[0].style.display !== 'none') {
console.log('1');
}
``` |
58,739,513 | On GKE, K8s Ingress are LoadBalancers provided by Compute Engine which have some cost. Example for 2 months I payed 16.97€.
In my cluster I have 3 namespaces (`default`, `dev` and `prod`) so to reduce cost I would like to avoid spawning 3 LoadBalancers. The question is how to configure the current one to point to the... | 2019/11/06 | [
"https://Stackoverflow.com/questions/58739513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6643803/"
] | OK here is what I have been doing. I have only one ingress with one backend service to nginx.
```
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress
spec:
backend:
serviceName: nginx-svc
servicePort: 80
```
And In your nginx deployment/controller you can define the config-maps wi... | One alternative (and probably the most flexible GCP native) solution for http(s) load-balancing is the use [standalone NEGs](https://cloud.google.com/kubernetes-engine/docs/how-to/standalone-neg). This requires you to setup all parts of the load-balancer yourself (such as url maps, health-checks etc.)
There are multip... |
11,739,931 | .project files contain references to the project natures used in the project.
These project natures are dependent on the plugins installed on the local developers machine.
So, should this file be excluded from SVN?
Will nautures unknown to other developers cause problems?
Thanks | 2012/07/31 | [
"https://Stackoverflow.com/questions/11739931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1399539/"
] | Copy paste this:
```
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(... | I made this to emulate orbiting with human characteristics (jerky) but it can be used for other animations like object translations, positions and rotations.
```
function twController(node,prop,arr,dur){
var obj,first,second,xyz,i,v,tween,html,prev,starter;
switch(node){
case "camera": obj = camera... |
37,536,881 | I would like to move the code to customize `UIButtons` out of my `viewcontroller` classes as a best practice. The code I have below is to add a white border to `UIButtons` and I would like to easily call it on buttons throughout my project.
```
//White Border
let passwordBorder = CALayer()
let width = CGF... | 2016/05/31 | [
"https://Stackoverflow.com/questions/37536881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5412407/"
] | In helper class make method like
```
func customiseButton(button:UIButton){
//White Border
let passwordBorder = CALayer()
let width = CGFloat(5.0)
passwordBorder.borderColor = UIColor.whiteColor().CGColor
passwordBorder.frame = CGRect(x: 0, y: 0, width: button.frame.size.wid... | You can try with this Extension for round button:
```
extension UIButton{
func roundCorners(corners:UIRectCorner, radius: CGFloat){
let borderLayer = CAShapeLayer()
borderLayer.frame = self.layer.bounds
borderLayer.strokeColor = UIColor.green.cgColor
... |
6,044,818 | I have table in which a constraint has been set on a field called LoginId.While inserting a new row i am getting an error on this constratint associated with this field(LoginID)stating the below error.
The insert command is below:
Type 1 with sequence
```
insert into TemplateModule
(LoginID,MTtype, Startdate TypeId, ... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6044818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/682571/"
] | First, do a describe on LGN\_INDEX on that table to make absolutely certain you are looking at the right column. Is LGN\_INDEX a constraint+index or just an index? Try re-building your index to make sure it isn't corrupt. Make sure you don't have any other constraints that might be interfering.
Second, perform a `SELE... | I encountered the same problem.
An Insert statement populating an Integer value (not in the table) to the Primary Key column.
The problem was a before trigger tied to a sequence. The next\_val for the sequence was already present in the table.
The trigger fires, grabs the sequence number and fails with a Primary Key... |
118,483 | I'm trying to work out how best to design a home network which contains (potentially hostile) devices. I'm running into my limits of networking knowledge!
I have two challenges.
**Unsecure Devices**
On my home network I have a Lifx WiFi lightbulb. Lifx doesn't provide any security (no passwords) so any other device ... | 2016/03/24 | [
"https://security.stackexchange.com/questions/118483",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/13328/"
] | First you need to break the devices into classes of connectivity:
1. Need just a constant "cloud" connection to work properly
2. Need no connection except for initial config/updates, need local connection
3. Need both a cloud connection and a local connection to work
If you have a class of devices that are truly clou... | I bought for that purpose an Ubiquiti EdgeRouterX and UniFi AP AC LITE.
The access point supports up to 4 SSID, each goes to another VLAN.
I have set up a 'main' wireless network and 'guest' (that I also use for untrusted devices).
The router allows internet access for every VLAN, but does not allow traffic to cross ... |
18,802,491 | I have my incoming xml like
```
<?xml version="1.0" encoding="UTF-8"?>
<RootName>
<RandomRootNode>
<RandomNode>
<Identity>1</Identity>
<Name>abc</Name>
</RandomNode>
<RandomNode>
<Identity>2</Identity>
<Name>def</Name>
</RandomNode>
... | 2013/09/14 | [
"https://Stackoverflow.com/questions/18802491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2779255/"
] | I noticed this same problem. I haven't found a permanent solution yet, but what works for me is the following:
```
omxplayer -o local file.mp3
```
The audio comes out over HDMI, by the way, and the -o local flag forces it to line-out (local). | Run
```
sudo amixer cset numid=3 1
```
to re-direct the output to the 3.5 mm jack
```
last digit
0 = auto
1 = 3.5 mm
2 = HDMI
``` |
43,359,808 | **Test Data :-**
1)Java java version "1.8.0\_121" Java(TM) SE Run-time Environment (build 1.8.0\_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
2)Eclipse Eclipse IDE for Java Developers Version: Neon.2 Release (4.6.2) Build id: 20161208-0600
3)OS Microsoft Windows 10 Home - 64-Bit
**myFea... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43359808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7712486/"
] | I tried with this in my POM.XML and it's works
```
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<m... | This is a maven project and *javac* is not the way to compile/build the project.
Correct me if I am wrong, but I would assume that you are not aware of maven. These are few tutorials on maven.
* <https://www.tutorialspoint.com/maven/>
* <http://tutorials.jenkov.com/maven/maven-tutorial.html>
Try running `mvn clean ... |
64,854,545 | ```
def num(x=[], y=[],result=[]):
x.append(120), y.append(0)
result.append(print("Progress"))
x.append(0), y.append(120)
result.append(print("Exclude"))
print(len(result))
print(result)
num()
``` | 2020/11/16 | [
"https://Stackoverflow.com/questions/64854545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14646535/"
] | print is build\_in function and after call the function it print its argument and return None.So when you append print("Progress") to a list actually you append None to list. | Try adding a return statement to the function:
```
return (x, y, result)
``` |
31,313,925 | i have a website and i want to restrict that the user should not use the previous 3 password as a new password when resetting password. | 2015/07/09 | [
"https://Stackoverflow.com/questions/31313925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4856983/"
] | ```
#if defined(Q_OS_ANDROID)
QAndroidJniObject activity = QtAndroid::androidActivity();
if (activity.isValid()) {
QAndroidJniObject window = activity.callObjectMethod("getWindow", "()Landroid/view/Window;");
if (window.isValid()) {
const int FLAG_KEEP_SCREEN_ON = 128;
window.callMethod<void>("... | I ended up doing this in Java instead.
Here is java code:
```
package org.qtproject.visualization;
import org.qtproject.qt5.android.bindings.*;
import android.os.Bundle;
import android.view.WindowManager;
public class ScreenOnActivity extends QtActivity
{
@Override
public void onCreate(Bundle savedInstanceS... |
6,435,213 | How can I find the next `<div>` with the same class as the current one.
I have a `<div>` with `class="help"`, now when some clicks on a button inside this `<div>` I want to select the next `<div>` with the same "help" class.
```
<div class="help">
<div>....OTHER HTML CONTENT......<div>
<input type='submit... | 2011/06/22 | [
"https://Stackoverflow.com/questions/6435213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/406659/"
] | [.next()](http://api.jquery.com/next/) - Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
Example :
```
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li class="third-item">list it... | well, provide some basic scripts, the classic handler of cls made by Andrew Hayway && Simon Willison
```
function cls(c,tag){
var r=[];
var reg=new RegExp("(^|\s)"+c+"($|\s)");
var e=document.getElementsByTagName(tag||"*");
for(var i=0;i<e.length;i++){
if(e[i].className.match(reg))
r.pu... |
250,442 | I've installed Django multiple ways, via `apt-get` and `pip install`. They all say I have the most recent version of Django. Now whenever I run python in Terminal and type in import django, I receive
```
ImportError: No module named django
```
However, when I run `django-admin --version` I receive
```
1.4.3
```
I... | 2013/02/02 | [
"https://askubuntu.com/questions/250442",
"https://askubuntu.com",
"https://askubuntu.com/users/79507/"
] | I had the same problem when I was using PyCharm Community Edition for making Django projects.
For me, the following steps worked:
It turns out that python wants you to create a virtual environment, install django in that and then run the server. To do this,
### Create a Virtual Environment
>
> 1) Install virtual e... | I've got this problem when I renamed the project folder in PyCharm.
1. Terminal tab stopped getting into the Virtual Environment (`venv` folder). To fix that, I went to the `Settings -> Project -> Project` Interpreter and changed the folder there.
2. Django "disappeared". `django-admin --version` did not respond. To f... |
6,663,039 | `If` logic given below works well in C language but it doesn't work in java....Why..??
It gives an error in java while compiling.
```
class test
{
public static void main(String[] args)
{
int i;
if(i=4)
System.out.println("hello");
}
}
``` | 2011/07/12 | [
"https://Stackoverflow.com/questions/6663039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/776084/"
] | You need to use the comparison operator (`==`) instead of the assignment operator (`=`) in your if statement.
In C, the result of a valid assignment operator [is the value that is assigned](http://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Value_of_an_assignment). If your example was in C, the resultant c... | It will compile in C because the condition of and if statement in C can be of type int. However, you assign 4 to `i` in your condition, and it will not do what you expect it to do in C either. |
22,570,887 | Assume we have a class `Car` with subclasses mini and sedan, both have same safety checks to I call a common function called safety() which is like a template. So:
```
class Car {
safety() {
check1();
check2();
check3();
check4();
}
}
class Mini extends Car {
// use the saf... | 2014/03/21 | [
"https://Stackoverflow.com/questions/22570887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2458372/"
] | **Forget patterns** and implement your classes in a way that fits your **use case**. In your example, I would argue, that safety is not really a property of a Car, but rather the *result* of some procedure *applied to* a Car.
```
class CrashTestDummy
{
public Safety check(Car car) {...}
public Safety check(Mini ... | In my opinion very suitable would be a Visitor pattern <http://en.wikipedia.org/wiki/Visitor_pattern>
There are two basic interfaces:
```
public interface Visitable {
void accept(Visitor visitor);
}
public interface Visitor {
void visit(Mini mini);
void visit(Sedan sedan);
}
```
Example implementa... |
3,422,220 | I'm confused with the next exercise:
Take $\left\{ 1,e^t,e^{-t}\right\}$ a basis for a vector space $V$ (note that $V$ is a space of continuous functions). Take a linear transformation $T:V\to V$ defined by $T(f)=f'$ (derivative). The question is: find all the invariant subspaces of $V$ under $T$.
After a lot of tim... | 2019/11/04 | [
"https://math.stackexchange.com/questions/3422220",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/356536/"
] | $\require{cancel}$The $n^{\textrm{th}}$ partial sum is
$$S\_n =\sum\limits\_{k=1}^n\left(\frac{1}{2k}-\frac{1}{2(k+2)}\right)$$
$$=\sum\limits\_{k=1}^n\frac{1}{2k} - \sum\limits\_{k=1}^n\frac{1}{2(k+2)}$$
$$=\sum\limits\_{k=1}^n\frac{1}{2k} - \sum\limits\_{k=3}^{n+2}\frac{1}{2k}$$
$$=\left(\underbrace{\frac12 + \frac14... | In the partial fraction decomposition:
$$\frac1{n(n+2)}=\frac12\biggl(\frac1n-\frac1{n+2}\biggr)$$
the first term is cancelled by the term with a minus sign in the second group before this group, and conversely the term with a minus sign is cancelled by the first term in the second group after:
$$\sum\_{k\ge 1}\frac1{k... |
21,673,861 | If you were to look at the following website in Chrome, you would see the printers in 2 rows. Which is how it is supposed to be. But in FireFox and Internet Explorer the 4th product is aligned on the right by itself.
I have tried everything I can think of, and scoured the web. I would really welcome any help anybody ... | 2014/02/10 | [
"https://Stackoverflow.com/questions/21673861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2746483/"
] | Change `float: left` to `display: inline-block` on the items (`.shop-main li`, to be exact).
If you float items to do this, then the height of the items needs to be exactly the same. In this case, the items are rendered in such a fashion that the 3rd item is slightly less high than the second. That is causing the fou... | Have you tried to make the elements float or give them a relative positioning? The way i'm seeing it is that they inherit their positions from the parent div but on ie and firefox it's rendered differently.
I've had this problem and the solution for me was to make everything float left and give it margins and clearing... |
38,566 | I'm having some trouble solving a couple of problems:
* I know this one must be pretty easy but can't find the way to solve it.
I need to find the arc length of a curve described by $ r=1- \theta ; 1\leq \theta \leq 2.$
From my notes, this should be solved with $$\int\_{C} f(\sigma
(t)) \left \|\sigma
'(t)\right... | 2011/05/11 | [
"https://math.stackexchange.com/questions/38566",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/9852/"
] | Let $x=(\Theta-1)$,
$dx= d\Theta$,
$r=(1-\Theta)$,
$\frac{dr}{d\Theta}=-1$,
and $s= \int\sqrt{(-1)^2 +(1-\Theta)^2}d\Theta$
We know that
$$\int\sqrt{x^2+a^2}dx=\frac{x\sqrt{x^2+a^2}}{2}+\frac{a^2}{2}\ln(x+\sqrt{x^2+a^2})+C$$.
With substitution of $x$ for $(\Theta-1)$ and taking the limits between 1 and 2, we get... | You want to find the arc-length of the curve given in polar form by the equation $r = 1- \theta$ for $1 \le \theta \le 2.$ Well, if you have a polar equation, say $r = f(\theta)$, and you want to find the arc-length of the resulting curve for $\theta\_1 \le \theta \le \theta\_2$ then you need to use the following formu... |
24,954,374 | I'm developing an ASP.NET MVC 4 Web Api, with C#, .NET Framework 4.0, Entity Framework Code First 6.0 and Ninject.
I have two different `DbContext` custom implementations to connect with two different databases.
This is my `NinjectConfigurator` class (partial):
```
private void AddBindings(IKernel container)
{
c... | 2014/07/25 | [
"https://Stackoverflow.com/questions/24954374",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68571/"
] | Let's start with the basics.
As far as i know named bindings work only with constant values attributed in code, like the `[Named("foo")]` attribute, or otherwise by using "service location" like `IResolutionRoot.Get<T>(string name)`. Either does not work for your scenario, so a named binding is out of the question.
Th... | If you say that `IUnitOfWork` depends on `TEntity` why not make `IUnitOfWork` generic too?
```
public class TRZIC {}
public class INIC {}
public interface IUnitOfWork<TEntity> {}
public class TRZICDbContext : DbContext, IUnitOfWork<TRZIC> {}
public class INICDbContext : DbContext, IUnitOfWork<INIC> {}
public inte... |
51,767,935 | I'm currently making a frontend app for a project using angular 4, from the backend I get some actions called with a POST that are the same:
>
> actions.response.ts
>
>
>
```
export class actions{
AGREEMENTS_VIEW :string;
PROSPECTS_VIEW :string;
AGREEMENTS_INSERT_UPDATE :string;
... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51767935",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10133710/"
] | In my current project we created a permission directive. You give it some conditions and it deletes the tags from the view when it doesn't match.
Here is a sample of it :
```js
export class HasPermissionDirective implements OnInit, OnDestroy {
private permissionSub: Subscription;
constructor(private templateRe... | For what i understand you want to activate or deactivate access to a component or button regarding some rules. For example if the user is logged in or not or if your form is properly validated.
If you want to deactivate a button you can use this directive here [disabled]:
```
<button class="btn btn-lg btn-primary bt... |
57,822,215 | I am creating a new React Native app but facing errors like "No bundle URL present" while running it on iOS Simulator.
*Command to Run App on iOS:*
```
react-native run-ios --port=8089
```
I tried every possible solution suggested on the below links.
[What is the meaning of 'No bundle URL present' in react-native?... | 2019/09/06 | [
"https://Stackoverflow.com/questions/57822215",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/706020/"
] | Finally, I resolved the above issue. Below is the solution which helps me to resolve this issue.
So As I mentioned in my question I tried all most every solution posted on SO or another portal but didn't succeed. So I investigate more on generated iOS code and come to know the below points.
1. My `main.jsbundle` gene... | I would like to add the solution that I found as I had initially buried but not solved the error using the build:ios method. This answer is for others also struggling and might be a solution:
My main.bundle.js wasn't present because the node\_modules/react-native/scripts/react-native-xcode.sh failed to bundle because ... |
28,605,833 | Is there a simple way I can easily override an autowired bean in specific unit tests? There is only a single bean of every type in the compile classes so it's not a problem for autowiring in this case. The test classes would contain additional mocks. When running a unit test I'd simply like to specify an additional Con... | 2015/02/19 | [
"https://Stackoverflow.com/questions/28605833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/447522/"
] | In Spring Boot 1.4 there's a simple way for doing that:
```
@RunWith(SpringRunner.class)
@SpringBootTest(classes = { MyApplication.class })
public class MyTests {
@MockBean
private MyBeanClass myTestBean;
@Before
public void setup() {
...
when(myTestBean.doSomething()).thenReturn(som... | As mats.nowak commented, `@ContextConfiguration` is useful for this.
Say a parent test class is like:
```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/some-dao-stuff.xml"
,"classpath:spring/some-rest-stuff.xml"
,"classpath:spring/some-common-stuff.xml"
,"cla... |
2,394,603 | For the past couple of months I've been working on a game in java for a university project. It's coming up to the end of the project and I would like to compile the project into a single file which is easy to distribute. The game currently runs from inside the IDE and relies on the working directory being set somewhere... | 2010/03/07 | [
"https://Stackoverflow.com/questions/2394603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/108234/"
] | Here is the code I promised in another comment... it isn't quite what I remember but it might get you started.
Essentially you call: String fileName = FileUtils.getFileName(Main.class, "foo.txt");
and it goes and finds that file on disk or in a JAR file. If it is in the JAR file it extracts it to a temp directory. Y... | yes ! put your compiled .class files and your resources with folders in a jar file .. you ll have to build a manifest file as well .. you can find the tutorial about making a .jar file on
google. most probably you ll be referred to java.sun.com . |
41,486,855 | I have a string with a bunch of values like `aaa, bbb, ccc, ddd, eee, fff`. The length is always different.
I need to the remove the last value without the `,` so it should be like:
```
aaa, bbb, ccc, ddd, eee,
```
Is there a way to do that? | 2017/01/05 | [
"https://Stackoverflow.com/questions/41486855",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6444381/"
] | You can use regex to do that:
```
"aaa, bbb, ccc, ddd, eee, fff".replace(/[^,]+$/, "");
```
Here I replace as much possible characters `+` that are not `,` : `[^,]` and are at the end of the string: `$` | You could replace the last word and the whitespace before.
```js
var string = 'aaa, bbb, ccc, ddd, eee, fff';
console.log(string.replace(/\s+\w+$/, ''));
``` |
38,286,022 | Question (My problem is with B) :
Assuming DX = 0XDB00
A) What is the value of DH after these commands :
```
SHR DX, 1
OR DH,DL
XOR DL, DL
```
B) Write 1 line to replace the above 3 lines
And this is what I got to :
[](https://i.stack.imgur.co... | 2016/07/09 | [
"https://Stackoverflow.com/questions/38286022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168837/"
] | Is the answer supposed to be `ror dh, 1`?
That gives the same result as your sequence when `dl` is already 0, but doesn't work in the general case where DX holds an arbitrary 16bit value. If you can't assume that, I don't think the question is answerable (unless you take it literally as "one line", and just put multip... | `ADD DX,1200` will get the same result into the DX register as the 3 lines above.
Used ollydbg for this, opened up one of my programs and edited it.
First I tested the code that you have given me.
`MOV DX,0xDB00
SHR DX,1
OR DH,DL
XOR DL,DL`
and after this I checked the DX register.
Once I had the value I just nee... |
23,130,529 | I am using PHP mail and trying to send BCC, but for some reason since I've added the lines with //ADDED NEW on it , it's just now sending any emails at all.
Here is the full code:
```
$to = "me@gmail.com";
$bcc = $row['recipients']; //ADDED NEW
$subject = $row['subject'];
$message = $row['text_body'];
$headers ... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23130529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683553/"
] | This behaviour could come if you use implicit injection, instead of explicit declaring your dependencies. In my experience I faced this kind of problem with particular kind of Angular.js services that return instantiable class (for example to create abstract controller Classes or some other particular cases).
For exam... | For the ones that doesn't like CoffeeScript.
I just took some of my code and put it in.
```
$stateProvider
.state('screen', {
url: '/user/',
templateUrl: 'user.html',
controller: 'UserController',
controllerAs: 'user',
location: "User",
resolve: ['$q', 'UserServic... |
94,144 | I understand that it is hard to define when pasta is properly 'cooked'. It's a subjective topic.
But I think that 'really not cooked enough' is a state that most of use would agree on.
I noticed that regardless of the continent, city, stove type (electric or gas) and pasta type, pasta will never be 'cooked enough to ... | 2018/11/21 | [
"https://cooking.stackexchange.com/questions/94144",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/59283/"
] | Obviously those figures can only be a guideline. There's a good measure of subjectivity to pasta cooking, but most likely the package directions are not totally random, and you should be getting pretty close to a good state if you were following them to the letter. Still, the real method to tell whether your pasta is c... | I am Italian and I agree with you.
Following the box instruction leads to an almost uncooked pasta.
The issue is certainly matter of taste but the same is said by all the persons to whom I share meals with or I have discussed this subject.
I do personally got to know pasta based on format and company.
Spaghetti ... |
2,130 | When crocheting, there are 2 grips for holding the hook: like a knife or like a pen. The choice is - of course - a matter of what you've been taught and what you prefer, but can anything in general be said about the (dis)advantages of both grips?
For instance,
* is any grip better for your finger joints and wrist... | 2016/08/26 | [
"https://crafts.stackexchange.com/questions/2130",
"https://crafts.stackexchange.com",
"https://crafts.stackexchange.com/users/137/"
] | I crochet using knife grip, and tried to learn pen grip, since it is considered 'right' in my country.
When learning, I found that pen grip allows you smaller hand movements, so it is better joints and wrists. It was also easier when working with fine yarns; when I tried to crochet thicker yarns, my hand would quickly... | I use knife grip for most stitches, but for a few, such as crab stitch (reverse single crochet), the pen grip works much better. |
45,279,115 | How can I update/replace a value on a comma separated string column?
i.e:
```
121720 | 121716 | false,true,34,1,1,true,1,true
118220 | 118191 | false,true,731,11,11,true,11,true
142125 | 142037 | false,true,34,28,28,true,28,true
182105 | 182012 | false,true,34,3,3,true,3,true,,
185268 | 185191 | f... | 2017/07/24 | [
"https://Stackoverflow.com/questions/45279115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8357214/"
] | [`ShellExecute()`](https://www.autoitscript.com/autoit3/docs/functions/ShellExecute.htm) is perfect for calls like this. But if you really want to go through a Run Prompt window you can use this too :
```
Local $shell = ObjCreate("shell.application")
$shell.FileRun()
```
The benefit is that you don't have to use an ... | This works like expected:
```
Send('{LWINDOWN}r{LWINUP}')
```
Your question was'nt clear. You want to open the windows Run-box with its native function call, is it?
Do it so:
```
ShellExecute(@SystemDir & '\rundll32.exe', 'shell32.dll #61')
``` |
25,887,448 | I have next code:
```
void f(int){}
struct A
{
void f()
{
f(1);
}
};
```
This code is not well-formed with the error message (GCC): `error: no matching function for call to ‘A::f(int)’` or (clang) `Too many arguments to function call, expected 0, have 1; did you mean '::f'?`
**Why do I need to ... | 2014/09/17 | [
"https://Stackoverflow.com/questions/25887448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336578/"
] | >
> Why do I need to use :: to call the non-member function with the same name as the member function, but with different signature? What is the motivation for this requirement?
>
>
>
That is the whole point of having namespaces. A local (closer-scoped) name is preferred and more visible over a global name. Since ... | To understand the reason of your error and why you need to explicitly use the `::f()` syntax, you may want to consider some aspects of the C++ compiler process:
The first thing the compiler does is **name lookup**.
Unqualified name lookup starts from the current scope, and then moves outwards; it stops as soon as it ... |
744,527 | My professor would like me to solve a system similar to the following:
$$ dx\_i=[f\_i(x\_1,x\_2,...x\_n)]dt + g\_ix\_idW\_i$$
Where $g\_i$ are positive constants that measure the amplitude of the random perturbations, and $W\_i$ are random variables normally distributed.
Im not sure how I can implement this in Matla... | 2014/04/08 | [
"https://math.stackexchange.com/questions/744527",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/91951/"
] | You absolutely cannot use `ode45` to simulate this. ODEs and [SDEs](http://en.wikipedia.org/wiki/Stochastic_differential_equation) are different beasts. Also note that [`rand`](http://www.mathworks.com/help/matlab/ref/rand.html) in Matlab is uniformly, not normally, distributed, so you're also not even generating prope... | Unfortunately, I don't think you can use `ode45` to solve it, whereas, since $dW$ distributes like $N(0,\sqrt{dt})$ you must use the following discretisation:
$$
x\_{n+1,i}=x\_{n,i}+f\_i(x\_{n,i})\Delta t+g\_i(x\_{n,i})x\_{n,i}\sqrt{\Delta t}\cdot\epsilon\_i,
$$
$$
\epsilon\_i=\mbox{randn()}
$$
$$
x\_{n,i}\approx x\_i(... |
12,202,986 | I've inherited an MVC asp.net app using framework 4.0.
I'm getting the dreaded "A potentially dangerous Request.Form value was detected from the client" error and all my research leads me to believe that this should fix it:
```
<system.web>
<httpRuntime requestValidationMode="2.0" />
<pages validateRequest="f... | 2012/08/30 | [
"https://Stackoverflow.com/questions/12202986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1612706/"
] | In addition to what you did you also have to decorate your methods with the `ValidateInput` attribute.
```
[ValidateInput(false)]
public ActionResult MyActionMethod(string myParameter)
{
// Method implementation goes here...
}
```
There is an alternative though, you can implement your own request validator and ... | The simplest way is to remove the characters you want from the validation system.
Here is the `requestPathInvalidCharacters` attribute from the [`httpRuntime` element](https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx) with its default value.
```
<httpRuntime requestPathInvalidCharacters="<,>,*,%... |
12,509,284 | >
> **Possible Duplicate:**
>
> [How to get screen size and respond to it?](https://stackoverflow.com/questions/6577430/how-to-get-screen-size-and-respond-to-it)
>
>
>
Can I get the size of the screen android phone, similar to the same method in the computer. I'm interested in the screen resolution and (or) di... | 2012/09/20 | [
"https://Stackoverflow.com/questions/12509284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1651851/"
] | <http://developer.android.com/reference/android/util/DisplayMetrics.html>
You can use it as follows:
```
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
```
for ... | use this code:
```
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
int wwidth = displaymetrics.widthPixels;
``` |
17,827,753 | Is there any in-built feature is there in spree or we only need to customize that? | 2013/07/24 | [
"https://Stackoverflow.com/questions/17827753",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2515588/"
] | I recently published a blog post about this topic, hope it helps.
<http://nebulab.it/blog/one-page-checkout-with-spree>
The approach describes how to:
1. change the checkout/edit.html.erb view to display all relevant checkout steps.
2. add a `:remote => true` to all form\_for but the last one.
3. create a js view in... | you can try our the [spree\_one\_page\_checkout gem](https://github.com/RacoonsGroup/spree_one_page_checkout)
But i really don't know if its worked correctly. |
6,310,688 | I always try to create my Applications with memory usage in mind, if you dont need it then don't create it is the way I look at it.
Anyway, take the following as an example:
```
Form2:= TForm2.Create(nil);
try
Form2.ShowModal;
finally
Form2.FreeOnRelease;
end;
```
I actually think Form2.Destroy is probably the ... | 2011/06/10 | [
"https://Stackoverflow.com/questions/6310688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The idiomatic usage is
```
procedure SomeProc;
var
frm: TForm2;
begin
frm := TForm2.Create(nil);
try
frm.ShowModal;
finally
frm.Free;
end;
end;
```
or, unless you hate the `with` construct,
```
with TForm2.Create(nil) do
try
ShowModal;
finally
Free;
end;
```
You should never call `... | the other way is passing caFree to Action of formonclose
```
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end
``` |
30,267,316 | I am using lodash to split up usernames that are fed to me in a string with some sort of arbitrary separator. I would like to use \_.words() to split strings up into words, except for hyphens, as some of the user names contain hyphens.
Example:
```
_.words(['user1,user2,user3-adm'], RegExp)
```
I want it to yield:
... | 2015/05/15 | [
"https://Stackoverflow.com/questions/30267316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1294591/"
] | The initial case can be solved by this:
```
_.words(['user1,user2,user3-adm'], /[^,]+/g);
```
Result:
```
["user1", "user2", "user3-adm"]
```
---
**[EDITED]**
If you want to add more separators, add like this:
```
_.words(['user1,user2,user3-adm.user4;user5 user7'], /[^,.\s;]+/g);
```
Result:
```
["user1", ... | `words` accept a regex expression to match the words and **not to split** them, being so, just use a regex that matches everything besides a comma, i.e.:
```
_.words(['user1,user2,user3-adm'], /[^,]+/g);
```
---
Alternatively, you can use `split`.
```
result = wordlist.split(/,/);
```
---
<https://lodash.com/do... |
50,667,509 | I'm using the selenium library in python to open google chrome and visit google.com automatically, this is how my script looks like at the moment
```
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chromedriver = "/usr/bin/chromedriver"
os.environ["webdriver.chrome.dri... | 2018/06/03 | [
"https://Stackoverflow.com/questions/50667509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7705100/"
] | make sure the returned form of the snapshot you get is json that matches what was read. If the return from the snapshot is in the form of an array [] then it must match, if it is an array object [{ }] then it must also match | change the name of the collection in the cloud firestore and in each query you have in the project.
that will change the name on the firebase page, at least that solved my problem
```
stream: Firestore.instance.collection("colection").snapshots(),
```
to
```
stream: Firestore.instance.collection("collection").snap... |
35,486,439 | That's my code. What i'm trying to do here is a code that Asks for a name ( like a pass ) if the name is wrong, then the program says those 3 error messages and asks the name again, until one of the 2 white-listed names is given, then just keep going with the code.
```
int main(void)
{
setlocale(LC_ALL, "Portuguese");... | 2016/02/18 | [
"https://Stackoverflow.com/questions/35486439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5946129/"
] | The logic in the `do-while` loop is flawed. Instead of
```
continue;
```
you need
```
break;
```
`continue;` continues with the next iteration of the loop. `break;` breaks the loop.
Also, the `while` statement logic incorrect. You need to use:
```
while (Name != "ighor" && Name != "ind... | Thanks for all the answers i did changed
```
continue;
```
for
```
`break;`
```
and it worked perfect =)
But as the code was too confusing i may study a bit the other tips you guys gave me so i can make it cleaner =D
I just have another doubt with this piece of code
```
cin >> RPI;
if (RPI == "Sim"||RPI == "sim"... |
49,469,258 | I am currently doing some tasks in Javascript.
I created a 2D Array at the beginning, completely empty:
```
let stonearray =[[]];
```
Now whenever the user clicks on a certain position, i save the values and want to push them into the array so that the values are saved there:
```
var posx2 = Math.floor(x/colSize)... | 2018/03/24 | [
"https://Stackoverflow.com/questions/49469258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7912377/"
] | Using a string to define the name of a method within the scope of a class or a JS Object is acceptable.
```
j@j-desktop:~$ node
> function 'add'(x, y) {
function 'add'(x, y) {
^^^^^
SyntaxError: Unexpected string
> 'add'(x, y) {
... function 'add'(x, y) {
^^^^^
SyntaxError: Unexpected string
> 'a... | The `Metor.methods()` defines the server-side methods of your Meteor application.
It is not a simple function calling. With that you are defining which functions are going to be called by the client.
This is a way to your templates interact your dataBase, check, validate and make changes.
You can only call: `Meteor.c... |
43,463,246 | Basically here im using url connection to connect to php, everything is work find in log in and register phase, now i want to fetch the json object that i create in php file and then display it in a string view, so anyone got idea regarding this?
```
@Override
protected void onCreate(Bundle savedInstanceState) {
s... | 2017/04/18 | [
"https://Stackoverflow.com/questions/43463246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7881785/"
] | add style to `.tab-item-active` class like this
```
.tab-item-active {
background:green;
}
```
see this codepen:<http://codepen.io/edisonpappi/pen/aWvmjz> | You can also use the SCSS **`$tabs-ios-tab-icon-color-active`** var inside your **theme/variables.scss**, for example :
```
// App iOS Variables
// --------------------------------------------------
// iOS only Sass variables can go here
$tabs-ios-tab-icon-color: #00f;
$tabs-ios-tab-icon-color-active: #f00;
// App ... |
22,367,794 | I am currently debugging a DB application originally written in VBA 2005 that doesn't work with VBA 2010 and above versions. One of the (many) problems is that it uses the function IsNothing to test if an object variable has an object attached to it. This function seems to have been deprecated in 2010 and 2013. Is ther... | 2014/03/13 | [
"https://Stackoverflow.com/questions/22367794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3413388/"
] | As others have indicated, `IsNothing` has never been a VBA function and was likely written as syntactic sugar for `Is Nothing`.
[VB has an `IsNothing` function](http://msdn.microsoft.com/en-us/library/5adx7fxz%28v=vs.90%29.aspx) that serves the same purpose. In my experience, defining VBA functions that mirror familia... | IsNothing itself has never been a VBA function...
```
If obj Is Nothing Then...
```
may work for you, but may not yield the same results as the IsNothing function you are expecting. You may need to code more specific checks depending on what you want to determine. |
31,704,845 | Let's say I have a non-empty vector `z`.
I would like to replicate and shape this vector into a matrix with dimensions `[r, c, length(z)]`.
For example:
```
z = 1:5;
r = 3;
c = 3;
```
I am looking for a function that gives me:
```
ans(:, :, 1) =
[ 1 1 1 ]
[ 1 1 1 ]
[ 1 1 1 ]
ans(:, :, 2) =
[ 2 2 ... | 2015/07/29 | [
"https://Stackoverflow.com/questions/31704845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3427580/"
] | What about a subquery ?
```
SELECT * FROM tableA
LEFT JOIN (SELECT tableB.id FROM tableB
JOIN tableC
ON tableC.id=tableB.id) tableZ
ON tableZ.id=tableA.id
``` | I think you might want this logic:
```
SELECT *
FROM tableA LEFT JOIN
(tableB JOIN
tableC
ON tableC.id = tableB.id
)
ON tableB.id = tableA.id ;
```
Normally, with `LEFT JOIN` you want to chain them, but there are some exceptions. |
626,641 | I would like to have a LED indicator that is on when the fuse is not blown and off when the fuse is blown. This is not hard to do as you can place a LED on the output of the fuse. What makes it very hard for me is that the bus that is fused has variable voltage, from 5 to 24 V. This still can be done with the method I ... | 2022/07/08 | [
"https://electronics.stackexchange.com/questions/626641",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/250358/"
] | LM334 is the ideal solution, although two transistors will do a plenty acceptable job in this application:

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fpAgZg.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)... | Here is a circuit with a zener diode that will keep the LED current constant.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fEY2EI.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)
Note the differences to Lun... |
6,626,038 | How can I print the contents of an NSData object using NSLog:
```
-(void) post:(NSString*) msg to:(NSString*) link{
NSString *myRequestString = [NSString stringWithFormat:@"message=%@", msg];
NSData *myRequestData = [NSData dataWithBytes: [myRequestString UTF8String] length: [myRequestString length]];
NSMu... | 2011/07/08 | [
"https://Stackoverflow.com/questions/6626038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559142/"
] | If you do this:
```
NSLog(@"%@", returnData);
```
The NSData will be logged in hex format. I think that is probably what you are after.
If you want to turn it into a string and log the string, you first need to find out what character set was used. **The default character set for HTTP is not UTF-8, it is ISO-8859-... | Check this answer if you need to have your data bytes as string
<https://stackoverflow.com/a/7520655/1344237> |
13,841,404 | I am trying to convert from Hex To BCD in Verilog. I am not using any clocks. In my program, I give one input at a time and convert it and show the result. But, my program is giving undefined result. How can I fix it?
```
module HexToBCD(num,result);
input num;
output [7:0]result;
assign result[0]=num%2;
assign num... | 2012/12/12 | [
"https://Stackoverflow.com/questions/13841404",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1830544/"
] | I see a few unusual things with your module.
1. `num` is 1 bit wide, but you are trying to divide it by 2.
2. You are assigning to an `input`.
3. You make the same assignment to `num` 8 times. Verilog does not work that way; all continuous assignments are evaluated in parallel. | The following code do the conversion of a 8 bit binary number to a BCD equivalent. For explanation about the algorithm refer to [this link](http://www.eng.utah.edu/~nmcdonal/Tutorials/BCDTutorial/BCDConversion.html).
```
module bcd (
input [7:0] binary,
output reg [3:0] hundreds,
output reg [3:0] tens,
... |
37,987,798 | In my app, I'm getting JSON data from a php script. When I get the data, I have an `onClick()` method in my Fragment which changes a `TextView` to the parsed JSON.
However, when I swipe to a different fragment(it's a swipe/tabbed activity) my `TextView` does not retain the value I gave it, it changes to the original v... | 2016/06/23 | [
"https://Stackoverflow.com/questions/37987798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6495580/"
] | ```
my_df <- data.frame(matrix(nrow=3,ncol=10))
my_df
# X1 X2 X3 X4 X5 X6 X7 X8 X9 X10
# 1 NA NA NA NA NA NA NA NA NA NA
# 2 NA NA NA NA NA NA NA NA NA NA
# 3 NA NA NA NA NA NA NA NA NA NA
class(my_df)
# [1] "data.frame"
dim(my_df)
# [1] 3 10
# If column names are a... | Using the previously suggested answer of
```
as.data.frame(matrix(0, nrow = ?, ncol = ?))
```
the parameter can be entered to create the predefined data frame
```
Components = 3
Forecast.Days = 200
Share.of.Room.Nights = as.data.frame(matrix(0, nrow = Forecast.Days, ncol = Components))
```
Using `if("Desti... |
106,295 | Let's say given an angle A = 46 °, side a = 2.29 and b = 2.71
I figured that the angle B = 58.4 by saying:
$$B = \sin^{-1} \left(\frac{ 2.71 \sin{46^{\circ}}}{2.29}\right)=58.4^{\circ}$$
But I think that angle C is incorrect:
$$C = \sin^{-1} \left(\frac{2.29 \sin{58.4^{\circ}}}{2.71}\right)=46.03^{\circ}$$
Someone... | 2012/02/06 | [
"https://math.stackexchange.com/questions/106295",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24410/"
] | While the other answers have covered the basic use of the Law of Sines, they've all missed a critical point: there are **two** triangles that fit your given information. Here is the triangle you've found:

But, when you're solve $\sin B=\frac{b\sin A}... | According to Sine Law :
$$\frac{b}{\sin \beta} =\frac{a}{\sin \alpha} \Rightarrow \beta = \arcsin \left(\frac{b\cdot \sin \alpha}{a}\right)$$
Once you find angle $\beta$ you can calculate $\gamma$ from :
$$\gamma = 180° - (\alpha + \beta)$$ |
58,593,768 | I want to be able to check if one list contains 2 elements of another list (that in total has 3 elements)
e.g:
```
list1 = ["a", "b", "c"]
list2 = ["a", "f", "g", "b"]
if #list2 contains any 2 elements of list1:
print("yes, list 2 contains 2 elements of list 1")
else:
print("no, list 2 does not contain 2 ele... | 2019/10/28 | [
"https://Stackoverflow.com/questions/58593768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12087286/"
] | I would use a similar description of the one described in the following question, only this time check the length of the sets intersection:
[How to find list intersection?](https://stackoverflow.com/questions/3697432/how-to-find-list-intersection)
```
list1 = ["a", "b", "c"]
list2 = ["a", "f", "g", "b"]
if len(list(s... | ```
count = 0
for ele in list2:
if ele in list1:
count += 1
if count == 2:
print ("yes, list 2 contains 2 elements of list 1")
else:
print ("no, list 2 does not contain 2 elements of list 1")
``` |
15,841,916 | If I put my service and activity in the same package, Can I exchange data between them using some global variables? I want optimized performance, so, global variables idea seems good but is it possible? If not, what is the best option. If intents is the way to go, then would the performance be good enough? BTW, the ser... | 2013/04/05 | [
"https://Stackoverflow.com/questions/15841916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1176304/"
] | ```
SELECT rating, ratetext, date, first
FROM rating r INNER JOIN client c
ON r.clientid = c.id
WHERE r.userid = 3;
``` | Presumably you want to select ratings with the explicitly specified ID, and the corresponding clients because on the `clientid` stored in the `rating` record:
```
SELECT rating,ratetext,date,first FROM rating r
INNER JOIN client c ON c.id = r.clientid
WHERE r.userid = 3;
``` |
52,593,859 | I want convert "Thu Jan 18 00:00:00 CET 2018" to "2018-01-18" -> yyyy-mm-dd.
But I get error -> java.text.ParseException: Unparseable date: "Thu Jan 18 00:00:00 CET 2018".
```
switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC:
stringValue = String.valueOf(cell.getDateCellValue());
DateFormat for... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52593859",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8658782/"
] | You can use the Microsoft.Recognizers.Text.DataTypes.TimexExpression package [from NuGet](https://www.nuget.org/packages/Microsoft.Recognizers.Text.DataTypes.TimexExpression/). It's part of the Microsoft Recognizers Text project [here on github](https://github.com/microsoft/Recognizers-Text)
I found two ways you can u... | Use a custom format pattern:
```
using System;
using System.Globalization;
class MainClass {
public static void Main (string[] args) {
var format = "1234-10-30";
var date = DateTime.ParseExact(format, "yyyy-MM-dd", CultureInfo.InvariantCulture);
Console.WriteLine (date.ToString("dd/MM/yyyy"));
}
}
```... |
43,904,295 | I have a function that is giving me some trouble. The code below returns the error message "Cannot read property 'value' of undefined". The function should just search through the values in the accountlist and return the one that starts with the submitted string. In the example, submitting "000555" should return 0.
``... | 2017/05/10 | [
"https://Stackoverflow.com/questions/43904295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2093112/"
] | You could use the find function:
```js
var accountlist = [{
"value": "000555 - TEST ACCOUNT NAME1",
"data": "184"
}, {
"value": "006666 - TEST ACCOUNT NAME2",
"data": "450"
}, {
"value": "007777 - TEST ACCOUNT NAME2",
"data": "451"
}];
var searchString = '000555';
var result = accoun... | You should use **filter** & **startsWith** method.
---
The filter() method creates a new array with all elements that pass the test implemented by the provided function.
---
The startsWith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.
... |
1,810,083 | This question goes out to the C gurus out there:
In C, it is possible to declare a pointer as follows:
```
char (* p)[10];
```
.. which basically states that this pointer points to an array of 10 chars. The neat thing about declaring a pointer like this is that you will get a compile time error if you try to assign... | 2009/11/27 | [
"https://Stackoverflow.com/questions/1810083",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220177/"
] | Maybe I'm missing something, but... since arrays are constant pointers, basically that means that there's no point in passing around pointers to them.
Couldn't you just use `void foo(char p[10], int plen);` ? | On my compiler (vs2008) it treats `char (*p)[10]` as an array of character pointers, as if there was no parentheses, even if I compile as a C file. Is compiler support for this "variable"? If so that is a major reason not to use it. |
147,302 | I want to manage Document permission in document library using SharePoint Designer workflow like manage item level permission of list using workflow.
Can I manage permission of document using SharePoint Designer?
I got some [resources](http://spcycle.blogspot.in/2012/01/how-to-create-workflow-to-change-item.html) to... | 2015/06/25 | [
"https://sharepoint.stackexchange.com/questions/147302",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/43176/"
] | There is a workflow feature in the standard SP designer 2010 template (you have it if you are on sp 2010 or 13 or online, you do not have it if you are on SP 2007) called impersonation step.
This is one of the many pages that explain it
<http://blogs.sharepoint911.com/blogs/jennifer/Lists/Posts/Post.aspx?ID=91>
If y... | However, there is another way to handle your problem using a list and placing the document as attachment. This only if you do not need any feature on the document (versioning, approval etc).
This is a workaround if you want to avoid depending on a workflow. I have tested and if you send the link to a person that does ... |
5,201,282 | I'm trying to find an easy and slick way to do the following requirement.
I have a XML message with this arrangement:
```
<persons>
<person>
<firstName>Mike</firstName>
<middleName>K.</middleName>
<lastName>Kelly</lastName>
</person>
<person>
<firstName>Steve</firstName>
... | 2011/03/05 | [
"https://Stackoverflow.com/questions/5201282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/645681/"
] | How about this?
```
foreach (Node person in xmlDoc.SelectNodes("persons/person", nsmgr))
{
firstNameNodeList.Add(person.SelectSingleNode("firstName", nsmgr));
middleNameNodeList.Add(person.SelectSingleNode("middleName", nsmgr));
lastNameNodeList.Add(person.SelectSingleNode("lastName", nsmgr));
}
``` | You just have to iterate over `persons/person` and handle each individually - this would work:
```
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"test.xml");
var persons = xmlDoc.SelectNodes("persons/person");
foreach (XmlNode person in persons)
{
string firstName = person.SelectSingleNode("firstName").Inne... |
62,198,198 | I have one-to-many relation between tables user and tag:
```
Users:
id username
--------------
1 Bob
2 Alice
3 Eve
Tags:
id user_id name
--------------------
1 1 java // Bobs tags...
2 1 java script
3 1 C#
4 2 java // Alices ... | 2020/06/04 | [
"https://Stackoverflow.com/questions/62198198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1589723/"
] | Try this one:
```
const to = moment("2020-06-30T00:00:00");
const toNextDay = moment(to.add(1, 'days').toDate());
```
As moment is modifying the original moment object, either use toString() or toDate() to get the modified date.
```js
const to = moment("2020-06-30T00:00:00");
const toNextDay = moment(to.add(1, 'da... | Check the rest of the code because this part is correct
```
const to = moment("2020-06-30T00:00:00")
//undefined
to.format()
//"2020-06-30T00:00:00+02:00"
const nextDay = to.add(1, "day")
//undefined
nextDay.format()
//"2020-07-01T00:00:00+02:00"
to.format()
//"2020-07-01T00:00:00+02:00"
```
A little warnin... |
26,764,320 | My question is: how do I delete all the lowercase words from a string that is an element in a list? For example, if I have this list: `s = ["Johnny and Annie.", "She and I."]`
what do I have to write to make python return `newlist = ["Johnny Annie", "She I"]`
I've tried this, but it sadly doesn't work:
```
def test(... | 2014/11/05 | [
"https://Stackoverflow.com/questions/26764320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3869552/"
] | use `filter` with `str.title` if you just want the words starting with uppercase letters:
```
from string import punctuation
s = ["Johnny and Annie.", "She and I."]
print([" ".join(filter(str.istitle,x.translate(None,punctuation).split(" "))) for x in s])
['Johnny Annie', 'She I']
```
Or use a lambda not x.isuppe... | Translate is not the right tool here. You can do it with a loop:
```
newlist = []
for elem in s:
newlist.append(' '.join(x for x in elem.split(' ') if x.lower() == x))
``` |
778,803 | I installed a Windows XP x86 on my PC. But when I open the system information window in the *System Summary* tab, in the right-hand pane and at bottom the following are written:
*Total Physical memory 768.00 MB
Available Physical memory 270.41 MB !!*
Why *Available Physical memory* is 270.41 MB please?
PS: My system... | 2014/07/09 | [
"https://superuser.com/questions/778803",
"https://superuser.com",
"https://superuser.com/users/337339/"
] | The Operating System will always consume some amount of memory to do it's work and reserve some for caching data.
Furthermore, any programs that you might have installed and have components that load on startup will consume memory. Eg: Antivirus.
Memory is also consumed by the inbuilt graphics capabilities of your ... | * I assume your harddisk is working overtime as well ?
* You can reduce memory usage. Firstly, install a program called CLEANMEM (from PcWinTech) and let the program also collapse the filecache. Reduced memory usage also means that Win XP doesn't need to access the harddisk that often. It improves overall system perfor... |
5,959,825 | What is purpose of the following code?
```
preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
```
What kind of **$string** match this expression?
Why there is a character **@**? | 2011/05/11 | [
"https://Stackoverflow.com/questions/5959825",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/672470/"
] | `@` is used as a delimiter like `/`, and it's totally acceptable.
The pattern is matching *script* and *style* tags I assume. | *[Is there anything like RegexBuddy in the open source world?](https://stackoverflow.com/questions/89718/is-there-anything-like-regexbuddy-in-the-open-source-world)* (now deleted) lists a few tools which analyze regular expressions. There are also online tools, *[Is there an online RegexBuddy-like regular expression an... |
11,786,050 | I'm using `ArrayAdapter` to bind my data from my `ArrayList`to my `ListView` and i use an `AlertDialog`to insert data into my `Arraylist`. My problem is that i'm unable to refresh my `ListView` after the changes done.
**Code**
```
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceSt... | 2012/08/02 | [
"https://Stackoverflow.com/questions/11786050",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1382540/"
] | If you have a small ArrayList, to force update a ListView when the ArrayList changes you can use this code snippet:
```
ArrayAdapter.clear();
ArrayAdapter.addAll(ArrayList);
ArrayAdapter.notifyDataSetChanged();
``` | Every click you create new adapter. You don't need to do this. You can modify existing adapter data and call notifyDataSetChanged(). In your case you should call listView.setAdapter(adapter) in onClick method. |
56,038,135 | I am trying to create a query which - when executed - will show a date, status (where there are there are several status options) and the number of events on that date - distinguished by status.
I was able to create a query which shows all data I desire, but I am getting repetitions in dates. I think the way to do it ... | 2019/05/08 | [
"https://Stackoverflow.com/questions/56038135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11079649/"
] | You can do conditional aggregation :
```
select cast(event_date AS date) AS date,
sum(case when status = 'Yes' then 1 else 0 end) as Positive,
sum(case when status <> 'Yes' then 1 else 0 end) as Negative
from events e
group by cast(event_date AS date);
```
However, `mariaDB` has shorthand version fo... | Use `case` and `Sum` like:
```
SELECT cast(event_date AS date) AS date,
SUM(CASE WHEN status='YES' THEN 1 ELSE 0 END) as POSITIVE,
SUM(CASE WHEN status !='YES' THEN 1 ELSE 0 END) as NEGATIVE
FROM events
GROUP BY date
``` |
20,863 | Scenario
--------
I have a bunch of standalone PSTricks files. Each of those files can be compiled by `latex-dvips-ps2pdf-pdfcrop-pdftops` to produce a PDF image. I have made a batch file to do `latex-dvips-ps2pdf-pdfcrop-pdftops`.
In my main input file, I will iterate through the PSTricks files.
For each iteration,... | 2011/06/15 | [
"https://tex.stackexchange.com/questions/20863",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/2099/"
] | I wrote the `filemod` package just for this task which I also need for the upcoming version of `standalone`. It requires pdf(La)TeX or Lua(La)TeX but doesn't work with Xe(La)TeX.
Basic Usage:
```
\Filemodcmp{<file 1>}{<file 2>}{<1 is newer>}{<2 is newer>}
```
There is also a fully expandable version called `\filemo... | ```
\def\comparetimestamp#1#2{%
\ifnum\pdfstrcmp{\pdffilemoddate{#1}}{\pdffilemoddate{#2}}<0
\message{#1 is older than #2}%
\fi}
```
Change the `\message` line to what you need. Not usable with XeLaTeX, only with (pdf)latex. It may give problems if there's a change in the time zone (for example when changing ... |
2,461,521 | I need to express the solution of this initial value problem about vibration below using Convolution Integral;
>
> $$my''+cy'+ky=f(t) \quad y(0)=0,\quad y'(0)=0$$
>
>
>
But don't have any idea where do i use the Convolution Integral. So how do I do it?
I tried to take laplace transform of both sides.
$$
(ms^2+cs... | 2017/10/07 | [
"https://math.stackexchange.com/questions/2461521",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/488616/"
] | >
> **Obtaining a Series Representation of the Inverse Laplace Transform**
>
>
>
Given the expression $s\bar x(s)-1=\frac1s(1-e^{-s})+e^{-s}\bar x(s)$, we find directly that
$$\begin{align}
\bar x(s)&=\frac{\frac1s(1-e^{-s})+1}{s-e^{-s}}\\\\&=\frac1s\left( \frac{\frac1s(1-e^{-s})+1}{1-\frac{e^{-s}}{s}}\right)\ta... | From $$s\bar{x}(s)-1= \frac{1}{s}(1-e^{-s})+e^{-s}\bar{x}(s)$$
you get
$$s\bar{x}(s)-e^{-s}\bar{x}(s)=1+\frac{1}{s}(1-e^{-s})$$
collect $\bar{x}(s)$
$$(s-e^{-s})\bar{x}(s)=1+\frac{1}{s}(1-e^{-s})$$
$$\color{red}{\bar{x}(s)=\frac{1+s-e^{-s}}{s(s-e^{-s})}}$$
Now prove the second part
$$\sum \_{k=0}^{\infty } \fra... |
34,337,811 | Isn't it a generally a bad idea to convert from a larger integral type to a smaller signed if there is any possibility that overflow errors could occur? I was surprised by this code in C++ Primer (17.5.2) demonstrating low-level IO operations:
```
int ch;
while((ch = cin.get()) != EOF)
cout.put(ch); //overflow co... | 2015/12/17 | [
"https://Stackoverflow.com/questions/34337811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5627734/"
] | There are rules for integer demotion.
>
> When a long integer is cast to a short, or a short is cast to a char,
> the least-significant bytes are retained.
>
>
>
As seen in: <https://msdn.microsoft.com/en-us/library/0eex498h.aspx>
So the least significant byte of `ch` will be retained. All good. | Use [itoa](http://www.cplusplus.com/reference/cstdlib/itoa/), if you want to convert the integer into a null-terminated string which would represent it.
```
char * itoa ( int value, char * str, int base );
```
or you can convert it to a string , then char :
```
std::string tostr (int x){
std::stringstream str;... |
58,391 | I am a bit rubbish at CSS and have mainly based my website off another website, in hope it would look different, although it didn't. I just want comments and tips how to change things but still keep it looking nice.
I just want advice about the [home page](http://prntscr.com/86svoc) at the moment.
[
df
```
Output:
```
group ... | 2020/08/18 | [
"https://Stackoverflow.com/questions/63460465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12384851/"
] | Try:
```
df2 = pd.DataFrame(list(product(df.group.unique(), df.animal.unique())), columns=['group', 'animal'])
df2['val'] = df2['group'].map(df.set_index('group')['val'].to_dict())
df2.merge(df.drop('val', axis=1).assign(occurred=1), how='outer').fillna(0, downcast='infer')
``` | You want to make a pivot table.
This is done in Pandas with the pandas.pivot\_table(data, values=None, index=None, columns=None, aggfunc='mean', fill\_value=None, margins=False, dropna=True, margins\_name='All', observed=False) command.
As you can see there are many arguments that pandas.pivot\_table() takes, but the... |
16,453,468 | Why is this printing 1??? Its driving me INSANE. Should be printing 1.01005016708
I am using bloodshed dev c++ to compile
```
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
double rate = .05;
double time = (1/5);
double p = exp(rate*time);
cout<<p<<endl;... | 2013/05/09 | [
"https://Stackoverflow.com/questions/16453468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1681664/"
] | ```
double time = (1/5);
```
should be
```
double time = (1.0/5);
```
Otherwise, `time` will get `0.0` because of integer division truncation. Therefore, `p = exp(0.0)` will be 1. | Sorry this isn't the answer to your question, but Thomas and tacop got that covered.
You should look for a new IDE to use, i myself switched to code::blocks and i think it's great, but here are some reasons why:
>
> 1. Dev-C++ has not been updated since 2005, and is not currently maintained. The software is very bug... |
7,080 | Think of the following balls as individuals of populations.
Say I have $U$ urns, and some balls. Both numbers are *really* large. So large, that authors like Blanchard and Diamond have approximated the binomial operations that follow with Poisson probabilities.
The balls are either red ($R$) or green ($G$). At the b... | 2015/08/30 | [
"https://economics.stackexchange.com/questions/7080",
"https://economics.stackexchange.com",
"https://economics.stackexchange.com/users/43/"
] | *(If urns are vacancies and balls are unemployed, what distinction between unemployed workers does the Red/Green dichotomy reflects?)*
Each ball has in front of it an identical box, each with the exact same lottery tickets, its ticket has a number on it, and each number corresponds to an urn.
We say "Go!" and each ... | This is a complement/comment to Alecos' answer, who said that
>
>
> >
> > Note that the requirement that the probabilities are Uniform, impose the condition that, if we want to have proper distributions, the number of urns must be finite
> >
> >
> >
>
>
>
Denote the total size of the world as $N$. Denote ur... |
57,423,057 | I want to remove the max `2` value(outliers) of each column and then analyze the left dataframe.
```
> data.frame(q1 = c(2, 4, 5,8,8), q2 = c(1, 6, 3,8,5), q3 = c(5, 3, 6,5,2))
q1 q2 q3
1 2 1 5
2 4 6 3
3 5 3 6
4 8 8 5
5 8 5 2
```
The max 2 value in `q1`:8,8,then row 5,4 should be removed
The max... | 2019/08/09 | [
"https://Stackoverflow.com/questions/57423057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7936836/"
] | The only way I found until now is to run an npm script to copy sass files on dist folder (using copyfiles) before package the .tgz for internal use.
**Here my package.json:**
```
{
...
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"l... | **Update for Angular 9**:
In the library, next to the `lib`-directory, create a `styles`-directory and then add it as assets to `ng-rollout.yaml` like so:
```
"assets": [
"styles/**/*.scss"
]
```
This will copy all SCSS-files found recursively in the `styles`-directory into a `styles` directory in the output dire... |
16,026,858 | I'm trying to retrieve the coordinates of cursor in a VT100 terminal using the following code:
```
void getCursor(int* x, int* y) {
printf("\033[6n");
scanf("\033[%d;%dR", x, y);
}
```
I'm using the following ANSI escape sequence:
>
> Device Status Report - ESC[6n
>
>
> Reports the cursor position to the
> ... | 2013/04/16 | [
"https://Stackoverflow.com/questions/16026858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/657401/"
] | I ask for the cursor position. If I do not have answer after 100ms (this is arbitrary) I suppose the console is not ansi.
```
/* This function tries to get the position of the cursor on the terminal.
It can also be used to detect if the terminal is ANSI.
Return 1 in case of success, 0 otherwise.*/
int console_try_t... | ```
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
void readCoord(void* row, void* col){
int i = 0;
char* input = malloc(10);
printf("\e[6n");
while(!_kbhit()) _sleep(1);
while(_kbhit()) *(input + (i++)) = getch();
*(input + i) = '\0';
sscanf(input, "\e[%d;%dR", row, col);
}
voi... |
49,099,637 | Is it possible to tell if there was an exception once you're in the `finally` clause? Something like:
```
try:
funky code
finally:
if ???:
print('the funky code raised')
```
I'm looking to make something like this more DRY:
```
try:
funky code
except HandleThis:
# handle it
raised = True... | 2018/03/04 | [
"https://Stackoverflow.com/questions/49099637",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674039/"
] | Okay, so what it sounds like you actually just want to either modify your existing context manager, or use a similar approach: `logbook` actually has something called a [`FingersCrossedHandler`](https://github.com/getlogbook/logbook/blob/bcae0a58177476c395c73d343c7d6f4320ec594c/logbook/handlers.py#L1723) that would do ... | If it was me, I'd do a little re-ordering of your code.
```
raised = False
try:
# funky code
except HandleThis:
# handle it
raised = True
except Exception as ex:
# Don't Handle This
raise ex
finally:
if raised:
logger.info('funky code was raised')
```
I've placed the raised boolean a... |
309,495 | I'm currently using `Win32ShellFolderManager2` and `ShellFolder.getLinkLocation` to resolve windows shortcuts in Java. Unfortunately, if the Java program is running as a service under Vista, `getLinkLocation`, this does not work. Specifically, I get an exception stating "Could not get shell folder ID list".
Searching ... | 2008/11/21 | [
"https://Stackoverflow.com/questions/309495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15255/"
] | I can recommend this repository on GitHub:
<https://github.com/BlackOverlord666/mslinks>
There I've found a simple solution to **create** shortcuts:
`ShellLink.createLink("path/to/existing/file.txt", "path/to/the/future/shortcut.lnk");`
If you want to **read** shortcuts:
```
File shortcut = ...;
String pathToExistingF... | I've also worked( now have no time for that) on '.lnk' in Java. My code is [here](http://kac-repo.xt.pl/cgi-bin/gitweb.cgi?p=jshortcut.git;a=summary "git repo")
It's little messy( some testing trash) but local and network parsing works good. Creating links is implemented too. Please test and send me patches.
Parsing ... |
9,574,971 | I have a text field in my UI that when it's selected presents a UIDatePicker instead of the default keyboard, how could I set up a button as to dismiss the picker when the user is done? | 2012/03/05 | [
"https://Stackoverflow.com/questions/9574971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478108/"
] | Create a UIView (namely customDatePickerView) and in that view ,create datepicker and a done button and a cancel button in the xib.
In the textfield delegate:
```
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
if (textField == textfieldName) {
[textfieldName resignFirstResponder];
//s... | I've done a similar thing where I've created a view with a button and the `UIDatePicker`, then presented that view instead of the `UIDatePicker` alone. Then the button is just connected to an `IBAction` that moves the view out.
This way, the button moves in with the `UIDatePicker` view and they look "connected" to the... |
271,059 | How do you do a neutral special/attack with the right joystick on the Wii-u-Gamepad/ProController/GamecubeController? When you change the right joystick to special. | 2016/06/23 | [
"https://gaming.stackexchange.com/questions/271059",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/138083/"
] | **Yes, it is possible, but quite difficult.**
From [Smash Wiki](http://www.ssbwiki.com/C-Stick) (emphasis mine):
>
> In Brawl and Smash U, functions that can be assigned to the C-stick are:
>
> [...]
>
> Special: Tilt the stick to do the special that corresponds to that direction. This is known as B-stickin... | You can't, neutral/special attacks (assuming you've got the default layout on your controller) are made pressing the B or A button without moving the left joystick. The right joystick is only used to do smash attacks, and, smash attacks are all directional and there is no neutral smash.
This is the default layout of t... |
219,758 | I never use Siri, but when I look what has been draining my battery it says it's Siri!
[](https://i.stack.imgur.com/iwPaQ.jpg) | 2015/12/15 | [
"https://apple.stackexchange.com/questions/219758",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/106120/"
] | None of these suggestions helped me. What caused this problem was that my phone was set to automatically connect to a WiFi network that required a separate webpage-based login. They're called "captive networks" like the ones in restaurants and coffee shops, where you have to first open your web browser, and then fill i... | I don't have an answer, but I have a theory. I'm having a hard time believing "Siri" is really "Siri". I have a phone that is waiting for a number port and sitting on my desk doing nothing. After 24 hours of sitting off Wi-Fi and looking for a network, not using it for anything, with the screen off, it says 90% of the ... |
5,142,065 | Main model classes are as follows :
```
public class UserAddressesForm {
@NotEmpty
private String firstName;
@NotEmpty
private String lastName;
private List<AddressForm> addresses;
// setters and getters
}
```
---
```
public class AddressForm {
@NotEmpty
private String customN... | 2011/02/28 | [
"https://Stackoverflow.com/questions/5142065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612925/"
] | Adding to @Ritesh answer, `@Valid` constraint will instruct the Bean Validator to delve to the type of its applied property and validate all constraints found there. Answer with code to your question, the validator, when seeing a `@Valid` constraint on `addresses` property, will explore the `AddressForm` class and vali... | In the class UserAddressesForm add the following lines
```
@Valid
private List<AddressForm> addresses;
``` |
20,444,062 | I have a function which given a `Name` of a function it augments it, yielding another function applied to some other stuff (details not very relevant):
```
mkSimple :: Name -> Int -> Q [Dec]
mkSimple adapteeName argsNum = do
adapterName <- newName ("sfml" ++ (capitalize . nameBase $ adapteeName))
adapteeFn <- varE... | 2013/12/07 | [
"https://Stackoverflow.com/questions/20444062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479553/"
] | Sure, you should be able to do
```
do (VarI _ t _ _) <- reify adapteeName
-- t :: Type
-- e.g. AppT (AppT ArrowT (VarT a)) (VarT b)
let argsNum = countTheTopLevelArrowTs t
...
where
countTheTopLevelArrowTs (AppT (AppT ArrowT _) ts) = 1 + countTheTopLevelArrowTs
countTheTopLevelArrowTs _ = 0
... | A slight improvement on jberryman's answer that deals with type constraints such as `(Ord a) -> a -> a` is:
```
arity :: Type -> Integer
arity = \case
ForallT _ _ rest -> arity rest
AppT (AppT ArrowT _) rest -> arity rest +1
_ -> 0
```
usage:
```
do (VarI _ t _ _) <- reify adapteeName
let argsNum = ... |
428,117 | I am having a real brain fart here, and I would appreciate some help.
Now, I read this here - <http://grammartips.homestead.com/adverbs2.html> - but for some reason, in several cases my head just can't make the connection between the provided example for an adverb just modifying the verb and not the whole clause.
The... | 2018/01/26 | [
"https://english.stackexchange.com/questions/428117",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/278088/"
] | [Ellipsis](https://en.m.wikipedia.org/wiki/Ellipsis_(linguistics)) is the omission of a word or words from a clause as understood, redundant, or superfluous:
>
> Did you buy any chocolate milk? No, the store was out [*of chocolate milk*].
>
>
> When they were children, John learned French and his brother [*learned*... | This is quite a coincidence. [I just mentioned this in chat not too long ago.](https://chat.stackexchange.com/transcript/95?m=42482184#42482184) There are a few terms that could be used for this, but I think the word ellipsis is the one you probably want to use the most:
>
> In grammar, omission; a figure of syntax b... |
16,338,669 | I've a method , that retrieves to me some data according to some type I passed in parameter, like this :
```
protected void FillList<TEntity>()
{
doWorkForTEntity();
}
```
I Need to dynamically call this method :
```
Type[] entities = System.Reflection.Assembly.GetAssembly(typeof(Us... | 2013/05/02 | [
"https://Stackoverflow.com/questions/16338669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2154952/"
] | You need to do that with reflection as well, so it won't fail in compile time (compiler checks):
**Generic class:**
```
Type[] entities = System.Reflection.Assembly.GetAssembly(typeof(User)).GetTypes();
Type currentEntity = (from entity in entities
where entity.Name.Equals(this.targetEntity... | Change your method to take an instance of the Type TEntity:
```
protected void FillList<TEntity>(TEntity instance)
{
doWorkForTEntity();
}
```
Create a dynamic instance from the Type name and then call the modified method:
```
dynamic instance = Activator.CreateInstance(this.targetEntity);
FillList(instance);
... |
18,645,740 | I'm using the following stub to protect against leaving console.log statements in a production application:
```
// Protect against IE8 not having developer console open.
var console = console || {
"log": function () {
},
"error": function () {
},
"trace": function () {
}
};
```
This works fi... | 2013/09/05 | [
"https://Stackoverflow.com/questions/18645740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/633438/"
] | PHP has separate `boolean` type, its values of `TRUE` and `FALSE` (case-insensitive constants) are not identical to integer values of 1 and 0.
When you use strict comparison (`===`), it does not work: `TRUE !== 1` and `FALSE !== 0`.
When you use type juggling, `TRUE` is converted to 1 and `FALSE` is converted to 0 (a... | Please do not use a bunch of `assertTrue` or `assertFalse` checks with the real logic embedded in a complicated function call when there are more specific test functions available.
PHPUnit has a very vast set of assertions that are really helpful in the case they are not met. They give you a bunch of context of what w... |
16,655,010 | For my current purposes I have a Maven project which creates a `war` file, and I want to see what actual classpath it is using when creating the `war`. Is there a way to do that in a single command -- without having to compile the entire project?
One idea is to have Maven generate the `target/classpath.properties` fil... | 2013/05/20 | [
"https://Stackoverflow.com/questions/16655010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10608/"
] | To get the classpath all by itself in a file, you can:
```
mvn dependency:build-classpath -Dmdep.outputFile=cp.txt
```
Or add this to the POM.XML:
```
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>... | This is a **single command solution** but **does compile the code**.
```
mvn -e -X -Dmaven.test.skip=true clean compile | grep -o -P '\-classpath .*? ' | awk '{print $2}'
```
* It's based in [Philip Helger](https://stackoverflow.com/users/15254/philip-helger)'s previous [answer](https://stackoverflow.com/a/16655088/... |
8,999 | Given a graph $G$ we will call a function $f:V(G)\to \mathbb{R}$ discrete harmonic if for all $v\in V(G)$ , the value of $f(v)$ is equal to the average of the values of $f$ at all the neighbors of $v$. This is equivalent to saying the discrete Laplacian vanishes.
Discrete harmonic functions are sometimes used to appro... | 2009/12/15 | [
"https://mathoverflow.net/questions/8999",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2384/"
] | The answer is no.
I first describe the graph $G$. Let $N\_i$ be a sequence of positive integers; we will choose $N\_i$ later. Let $T$ be an infinite tree which has one root vertex, the root has $N\_1$ children; the children of that root have $N\_2$ children, those children have $N\_3$ children and so forth. Let $V\_0... | [Benjamini and Schramm](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.48.5100) proved that an infinite, bounded degree, planar graph is non-Liouville if and only if it is transient. |
49,033,398 | Hi I want to remove certain words from a long string, there problem is that some words end with "s" and some start with a capital, basically I want to turn:
`"Hello cat Cats cats Dog dogs dog fox foxs Foxs"`
into:
`"Hello"`
at the moment I have this code but I want to improve on it, thanks in advance:
```
... | 2018/02/28 | [
"https://Stackoverflow.com/questions/49033398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9318281/"
] | Maybe you can try to match everything except the word `Hello`.
Something like:
```
string.replaceAll("(?!Hello)\\b\\S+", "");
```
You can test it in [this link](https://regex101.com/r/XUwzM1/1).
The idea is to perform a negative lookahead for `Hello` word, and get any other word present. | So you could pre-compile a list of the words you want and make it case insensitive something like:
```
String str = "Hello cat Cats cats Dog dogs dog fox foxs Foxs";
Pattern p = Pattern.compile("fox[s]?|dog[s]?|cat[s]?", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(str);
String result = m.replaceAl... |
8,488,442 | I want to drag an image on the screen.
how can i do this?
In my case, the image is simply download from the URL and placed on an activity.
I just want to drag this.
Thanks in advance!! | 2011/12/13 | [
"https://Stackoverflow.com/questions/8488442",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/829066/"
] | This is not inheritance that you are doing. In your ViewController implementation, you have the following code
```
NewClass *myClass = [[[NewClass alloc] init] autorelease];
[myClass setLabelText];
```
This is just creating an instance of the class NewClass and setting the labelText on that instance. You are never ... | Wait... from the looks of it you are going to have some serious issues with stack overflows: when you load a ViewController, it in turn creates myClass. Because myClass is a subclass of ViewController, this in turn will create it's own variable 'myClass' when loaded... etc. This will continue forever, or until you get ... |
2,932,110 | A view with a table gets pushed onto the screen and I want it to scroll to a certain row in the table before the screen actually displays. I use this code within the final viewcontroller.
```
NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0];
[theTable scrollToRowAtIndexPath:scrollToPath atScrol... | 2010/05/28 | [
"https://Stackoverflow.com/questions/2932110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/121646/"
] | Thanks to Shaggy and Dying Cactus for pointing me in the right direction. The answer is to load the table and scroll in viewWillAppear:
```
-(void)viewWillAppear:(BOOL)animated
{
[theTable reloadData];
NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0];
[theTable scrollToRowAtIndexPat... | I just finished wrestling with this. Mine was adding a search bar to the top of the list, initially tucked under the top... ala some of the core apps. I was actually going to ask this same question!
I fear to offer this up, as it seems those who offer things up get pounded down.. but... I was surprised that there was ... |
54,277,735 | While preparing for a test, I am solving tests from previous years.
Write the function `compress(lst)` that receives a non empty list of repetitive letters and returns a list of tuples, each tuple containing the letter and the number or subsequent repetitions. ( see example)
e.g.:
for:
```
['a','a', 'b', 'b', 'b', ... | 2019/01/20 | [
"https://Stackoverflow.com/questions/54277735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10666115/"
] | Use [**`groupby`**](https://docs.python.org/3/library/itertools.html#itertools.groupby) from `itertools` module which perfectly fits here:
```
from itertools import groupby
lst = ['a','a', 'b', 'b', 'b', 'c', 'a', 'a']
print([(k, len(list(v))) for k, v in groupby(lst)])
# [('a', 2), ('b', 3), ('c', 1), ('a', 2)]
``... | The issue is that the `while` loop correctly counts occurrences, the `for` loop marches on inexorably, one character at a time. Since you're already incrementing the index correctly in the `while` loop, the simplest thing would be to get rid of either the `for` or `while` loop entirely. The only purpose to having multi... |
1,107,672 | I am trying to access member variables of a class without using object. please let me know how to go about.
```
class TestMem
{
int a;
int b;
public:
TestMem(){}
void TestMem1()
{
a = 10;
b = 20;
}
};
void (TestMem::*pMem)();
int main(int argc, char* argv[])
{
TestMem o1;... | 2009/07/10 | [
"https://Stackoverflow.com/questions/1107672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/38038/"
] | Simple answer: Don't do it.
There just can not be any situation where you can justify accessing like this. There just has to be a different solution. | I wanted to comment the answer provided by John Kugelman, being a new member didn't have enough reputation, hence posting it like an answer.
offsetof - is a C function used with structures where every member is a public, not sure whether we can refer the private variables as referred in the answer.
However the same c... |
407,569 | I have a trouble with estimation of logic utilization.
I am Ph.D student who research the efficient implementation of signal processing algorithms. So, I have to compare the logic utilization of proposed method with conventional method.
Therefore, the comparison of gate counts for each methods is the best way to eval... | 2018/11/19 | [
"https://electronics.stackexchange.com/questions/407569",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/204825/"
] | Definitely point 3 is wrong. Memory has a totally different structure from gates. in the ASIC world, where I come from, the area of a block is always split in gates-area and memory-area.
The reason is that the size of a memory is non-linear. Small memories use up a lot more area per cell then large ones. Very small me... | >
> I am Ph.D student who research the efficient implementation of signal
> processing algorithms.
>
>
>
This will be an interesting topic - first you need to define "efficient". As others have noted, you cannot really compare "area" using LUTs anymore (and that's been the case for a very long time!).
As a prac... |
22,810,644 | I a using Spring security with an HTML page using thymeleaf. I have a problem to use the "sec:authorize" property in this case:
```
<ul class="nav nav-tabs margin15-bottom">
<li th:each="criteriaGroup,iterGroups : ${aGroupList}"
th:class="${iterGroups.index == 0}? 'active'">
<a th:href="'#' + ${cri... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22810644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3458613/"
] | Remove th: in front of sec:authorize
The Spring Security 3 integration module is a Thymeleaf dialect. More information can be found [here](https://github.com/thymeleaf/thymeleaf-extras-springsecurity3). | Perhaps you'd want to use the #authentication object instead of the sec dialect.
From the docs:
```
<div th:text="${#authentication.name}">
The value of the "name" property of the authentication object should appear here.
</div>
``` |
16,237,471 | i'm kinda new to regular expressions. I have this case where i want to split many words like
"foo\_bar\_21", "bla\_keks\_38", etc. to
["foo\_bar", "21"], ["bla\_keks", "38"]
basically i want the last element which is always a number to be separated and the underscore before only that number removed.
How do I do t... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16237471",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/957370/"
] | ```
-(IBAction)goRestore
{
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}
```
//delegate Methods
```
- (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
{
NSLog(@"Access Apple successfully");
N... | ```
You need handle in this method
-(void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error
{
// Wrote Your code Here
}
```
Please refer [apple doc](http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/MakingaPurchase/Mak... |
17,234,558 | I have a code for my project in Java and one of the classes is as shown below but when I want to run this code I will get compile error in this class one part of code is:
```
package othello.view;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionL... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17234558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2298069/"
] | Change the below lines
```
public JComboBox<Object> leftAICombo;
public JComboBox<Object> rightAICombo;
```
to
```
public JComboBox leftAICombo;
public JComboBox rightAICombo;
```
Here `JComboBox<Object>` type parameter introduced in java7 only.if you are using jdk below 7 it gives error | Generics were added to `JComboBox` in Java 7. It appears you are using an eariler version of the JDK. Either upgrade to Java 7 or remove the generics. The former is recommended as it offers more features/fixes as well as being up-to-date. |
15,758 | I have a collection of REST API tests, WebDriver based tests, Appium based tests and additional tests that run via shell. All written in C#.
All tests are written as VS unit tests, and in the case of the shell tests, are executed via a visual studio unit test.
Currently all I have is a collection of VS unit tests, w... | 2015/11/22 | [
"https://sqa.stackexchange.com/questions/15758",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/15369/"
] | I run my Coded UI tests from the commandline with `/Logger:trx` this generates a .trx file
```
vstest.console.exe "MyApp\Debug\MyApp.CodedUI.Test.dll" /tests:TestCase1,TestCase2 /Logger:trx
```
You find the vstest.console.exe in your VS directory: `C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Com... | As far as I know, we couldn’t get the .trx file when we run the coded UI test in the VS 2012 IDE now, one solution is that you could run it in [command line](https://msdn.microsoft.com/en-us/library/ms182488.aspx) eg.
```
MSTest /testmetadata:Bank.vsmdi /resultsfile:BanktestResults.trx
``` |
168,451 | How do i disable remote access for non-root users over ssh? i would like to do this on demand if possible. | 2010/08/09 | [
"https://serverfault.com/questions/168451",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Everyone is doing this the hard way.. he said deny for all non-root users.. so just edit
```
/etc/ssh/sshd_config
```
Add the following
```
AllowGroups wheel root
```
Then restart ssh
Anyone in the wheel or root group will be allowed to ssh in | If you want it to be on-demand, the standard way is to use `/etc/nologin` (have a look at `man 5 nologin`).
Creating this file (with an optional message inside) will deny non-admin logins and display the message instead; removing the file will allow logins back.
It can be applied to ssh, local logins, and anything el... |
60,909 | >
> I would look strange on your body,
>
>
> but not on your phone.
>
>
> You appreciate me most
>
>
> when you're not home.
>
>
> There's not enough clues,
>
>
> so let's make this a twofer...
>
>
> I watch what you do,
>
>
> and I have no future.
>
>
> **What am I?**
>
>
>
---
**Edit History:** ... | 2018/02/23 | [
"https://puzzling.stackexchange.com/questions/60909",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | I think it should be
>
> Camera
>
>
>
I would look strange on your body,
>
> Picture from CCTV is always look strange or it would be weird if you wore a camera. (credit to [rm-vanda](https://puzzling.stackexchange.com/users/4616/rm-vanda))
>
>
>
but not on your phone.
>
> Picture from Mobile is almost ... | This will probably not be what you were searching for but you never know.
Are you:
>
> Free Wifi?
>
>
>
I would look strange on your body,
>
> This would be a weird Tattoo!
>
>
>
but not on your phone.
>
> Wifi on the phone is normal
>
>
>
You appreciate me most when you're not home.
>
> Fre... |
3,557,489 | >
> **Possible Duplicate:**
>
> [Is there a performance difference between i++ and ++i in C++?](https://stackoverflow.com/questions/24901/is-there-a-performance-difference-between-i-and-i-in-c)
>
>
>
In terms of usage of the following, please rate in terms of execution time in C.
In some interviews i was asked... | 2010/08/24 | [
"https://Stackoverflow.com/questions/3557489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196146/"
] | The circumstances where these kinds of things actually matter is very rare and few in between. Most of the time, it doesn't matter at all. In fact I'm willing to bet that this is the case for you.
What is true for one language/compiler/architecture may not be true for others. And really, the fact is irrelevant in the ... | Well, you could argue that `a++` is short and to the point. It can only increment `a` by one, but the notation is very well understood. `a=a+1` is a little more verbose (not a big deal, unless you have `variablesWithGratuitouslyLongNames`), but some might argue it's more "flexible" because you can replace the `1` or ei... |
13,867,035 | If you take a look at [this website](http://hockeyapp.net/), you'll see that as you scroll and hit certain areas, a fade in animation plays, and brings the content to view. I've tried looking through the source to try to understand how they do this, but I haven't found any luck yet.
I'm guessing they use Javascript/jQ... | 2012/12/13 | [
"https://Stackoverflow.com/questions/13867035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/458960/"
] | It's in <http://hockeyapp.net/javascripts/jquery.features.js>
Here it is *slightly* prettier:
```
function f_scrollTop() {
return f_filterResults(
window.pageYOffset ? window.pageYOffset : 0,
document.documentElement ? document.documentElement.scrollTop : 0,
document.body ? document.body.s... | You can track to see how far down the page the user has scrolled with a little bit of jQuery like this:
```
$(window).scroll(function(e){
if($(this).scrollTop() > 150) //the 150 here is the height in pixels
{
$('#element').addClass('animation');
}
});
```
In this code, the height in pixels is whe... |
102,492 | Using a DEM, I assigned slope values to individual segments in a street network feature class. In some areas the slope values seem suspect, such as where a highway overpasses a local road. Is there a method to find those segments whose slope is radically different from adjoining segments (e.g. 5 to 25%) to locate possi... | 2014/06/18 | [
"https://gis.stackexchange.com/questions/102492",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/32575/"
] | I would imagine that the most efficient way would be to 1) convert your "house" values to a point feature class, 2) create a grouping attribute using a minimum distance criteria with the [near](http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000001q000000) tool, 3) loop through each group to generate mi... | I recently had a similar problem where I needed to recognize clusters of items. I ended up using a hierarchical clustering algorithm provided by the [clusterfck](http://harthur.github.io/clusterfck/) library. Demo [here](http://bl.ocks.org/ryanthejuggler/10911656).
To apply this to your problem, you'd first traverse t... |
1,384,908 | Prove that, for $n \geq 3$, the sum of the residues of all the isolated singularities of
$$\frac{z^n}{1+z+z^2+\cdots+z^{n-1}}$$
is 0
Can someone show me how to do this problem. Thank you. | 2015/08/05 | [
"https://math.stackexchange.com/questions/1384908",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/176662/"
] | Let
$$
F(z)=\frac{z^n}{1+z+z^2+\ldots+z^{n-1}}=\frac{P(z)}{Q(z)}.
$$
Since $Q(1)=n\ne 0$, then, for every $z\ne 1$ we have
$$
Q(z)=\frac{1-z^n}{1-z},
$$
and $F$ can be redefined as
$$
F(z)=\begin{cases}
\frac{(z-1)z^n}{z^n-1} &\mbox{ for } z\ne 1\\
\frac1n &\mbox{ for } z=1
\end{cases}
$$
Therefore, the set of isolated... | Let $\lambda\_j, j = 1,\ldots,n-1$ be $j^{th}$ root of $1 + z+ \cdots + z^{n-1}$ and $\alpha\_j$ be the corresponding residue. The key is $\lambda\_j$ are all distinct. We have following partial fraction decomposition:
$$\frac{z^n}{1+z+\cdots+z^{n-1}} = \frac{z^n}{z^n - 1}(z-1)
= z - 1 + \frac{z-1}{z^n-1}
= z - 1 + \... |
153,829 | Following [the advice of Dave Ramsey](https://en.wikipedia.org/wiki/Dave_Ramsey#Teachings), I'm getting rid of my credit cards. The problem is, the alternatives don't seem safe. There are people who stand around the cash machines watching people take out large sums of cash. And there are merchants who have personal sca... | 2022/11/25 | [
"https://money.stackexchange.com/questions/153829",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/6443/"
] | In the US (I can't vouch for elsewhere) debit cards are under different regulations than credit cards and are not as safe, but can be used in most places credit cards can be. You do have to maintain a high enough balance in the account behind the debit card to cover all anticipated purchases/holds/whatever.
Personally... | **PREPAID CREDIT CARD**
If your goal is just to protect your bank account by minimizing how frequently you directly access it while also avoiding building up debt and interest on a credit card, you can buy yourself a prepaid credit card.
You can only spend the amount of money you put onto the prepaid credit card and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.