qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | If this is a transient issue then in most cases I have found restarting Android Studio fixed the issue.
In one case a Windows restart seemed to fix the problem. A reboot of the device did not.
It was a transient issue which happened just occasionally for a few days but eventually started happening every time and ther... | add those lines into your manifest file
```
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
```
inside your activity tag |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | The activity has to be exported to be accessible from adb. If the Activity has an `intent-filter` it is exported by default. Otherwise add the exported flag:
```
<activity
android:name=".my.MyActivity"
android:exported="true"/>
```
This is the error you get when the activity is not exported and you run
`adb... | Using Android Studio 3.4.1 you might get:
```
No apk changes detected since the last installation, skipping installation of /apk/debug/app-debug.apk
$ adb shell am force-stop
$ adb shell am start -n ".StartingScreenActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet...
`... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | **[This answer is obsolete for latest versions of Android Studio]**
This worked for me :
Tools > Android > Enable ADB Integration
You need to **tick** *Enable ADB Integration* | add those lines into your manifest file
```
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
```
inside your activity tag |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | **[This answer is obsolete for latest versions of Android Studio]**
This worked for me :
Tools > Android > Enable ADB Integration
You need to **tick** *Enable ADB Integration* | If this is a transient issue then in most cases I have found restarting Android Studio fixed the issue.
In one case a Windows restart seemed to fix the problem. A reboot of the device did not.
It was a transient issue which happened just occasionally for a few days but eventually started happening every time and ther... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | If this is a transient issue then in most cases I have found restarting Android Studio fixed the issue.
In one case a Windows restart seemed to fix the problem. A reboot of the device did not.
It was a transient issue which happened just occasionally for a few days but eventually started happening every time and ther... | Using Android Studio 3.4.1 you might get:
```
No apk changes detected since the last installation, skipping installation of /apk/debug/app-debug.apk
$ adb shell am force-stop
$ adb shell am start -n ".StartingScreenActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet...
`... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | The activity has to be exported to be accessible from adb. If the Activity has an `intent-filter` it is exported by default. Otherwise add the exported flag:
```
<activity
android:name=".my.MyActivity"
android:exported="true"/>
```
This is the error you get when the activity is not exported and you run
`adb... | Check Run/Debug Configurations.
Go to **Run/Debug Configurations** > **Launch Options** > **Launch** and select ***Default* Activity**.
I accidentally switched it to **Nothing** and the application stopped running after installation.
[](https://i.stack.i... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | **[This answer is obsolete for latest versions of Android Studio]**
This worked for me :
Tools > Android > Enable ADB Integration
You need to **tick** *Enable ADB Integration* | If the error does **NOT** come from AndroidManifest (like my situation), you can try this:
* Tool -> Android -> TURN OFF [Enable ADB Integration]
* Run -> Run "appname"
* When you app shows the message "Waiting for debug", select Run -> **Attach Debugger to Android process** -> Choose the package name of your app unde... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | If this is a transient issue then in most cases I have found restarting Android Studio fixed the issue.
In one case a Windows restart seemed to fix the problem. A reboot of the device did not.
It was a transient issue which happened just occasionally for a few days but eventually started happening every time and ther... | Check Run/Debug Configurations.
Go to **Run/Debug Configurations** > **Launch Options** > **Launch** and select ***Default* Activity**.
I accidentally switched it to **Nothing** and the application stopped running after installation.
[](https://i.stack.i... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | **[This answer is obsolete for latest versions of Android Studio]**
This worked for me :
Tools > Android > Enable ADB Integration
You need to **tick** *Enable ADB Integration* | Check Run/Debug Configurations.
Go to **Run/Debug Configurations** > **Launch Options** > **Launch** and select ***Default* Activity**.
I accidentally switched it to **Nothing** and the application stopped running after installation.
[](https://i.stack.i... |
34,525,954 | While launching an app, I am getting a message " Client not ready yet". Also, my device is showing" Waiting for debugger to attach ", followed by "Unfortunately, android app has stopped working". I have tried every possible solution available on discussion forums, but no solution is applying here.I also tried running a... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34525954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5538739/"
] | The activity has to be exported to be accessible from adb. If the Activity has an `intent-filter` it is exported by default. Otherwise add the exported flag:
```
<activity
android:name=".my.MyActivity"
android:exported="true"/>
```
This is the error you get when the activity is not exported and you run
`adb... | **[This answer is obsolete for latest versions of Android Studio]**
This worked for me :
Tools > Android > Enable ADB Integration
You need to **tick** *Enable ADB Integration* |
267,194 | **My Situation :**
I have a custom post type in my theme, called `article`.
My website has a dozen of categories, which i publish my posts in, and 1 **specific** category (named `BLOG`) just to publish `article` in it (has no `post` in it, only `article`).
My articles have different structure, so i can't show them ... | 2017/05/17 | [
"https://wordpress.stackexchange.com/questions/267194",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/94498/"
] | The reason your code isn't working is because by the time archive.php runs, the `pre_get_posts` hook has already fired.
You can easily accomplish the task in your functions.php file:
```
add_action( 'pre_get_posts', 'wpse_pre_get_posts' );
function wpse_pre_get_posts( $query ) {
remove_action( 'pre_get_posts', 'wps... | The problem in your scenario is that you can't know what changes need to be made to the query until after the query runs. Of course, after it runs, it's too late to make the changes!
You mentioned that you don't know what that single category all the articles are in might be. Well, the simplest way to solve this is to... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | Another example using ncurses and POSIX timers and signals (and global variables).
```
#include <ncurses.h>
#include <signal.h>
#include <time.h>
int changed, value;
void timer(union sigval t) {
(void)t; // suppress unused warning
changed = 1;
value--;
}
int main(void) {
int ch;
... | If you're not bothered about portability, and you'll always be using Windows, you can use [`PeekConsoleInput`](https://learn.microsoft.com/en-us/windows/console/peekconsoleinput), which tells you what console input events are waiting.
You can't (easily) use `ReadConsoleInput`, because it blocks until there is at least... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | If you're not bothered about portability, and you'll always be using Windows, you can use [`PeekConsoleInput`](https://learn.microsoft.com/en-us/windows/console/peekconsoleinput), which tells you what console input events are waiting.
You can't (easily) use `ReadConsoleInput`, because it blocks until there is at least... | Your code has two problems; one serious, one not.
The first problem, as you have found out, is that getch() is a blocking function. In other words, the function call will not return until a key had been pressed.
The second problem, although minor, is that the program only responds to input every second.
I've modifie... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | The following short program requires neither ncurses or threads. It does, however, require changing the terminal attributes - using `tcsetattr()`. This will work on Linux and Unix-like systems, but not on Windows - which does not include the `termios.h` header file. (Perhaps see [this post](https://stackoverflow.com/qu... | If you're not bothered about portability, and you'll always be using Windows, you can use [`PeekConsoleInput`](https://learn.microsoft.com/en-us/windows/console/peekconsoleinput), which tells you what console input events are waiting.
You can't (easily) use `ReadConsoleInput`, because it blocks until there is at least... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | The following short program requires neither ncurses or threads. It does, however, require changing the terminal attributes - using `tcsetattr()`. This will work on Linux and Unix-like systems, but not on Windows - which does not include the `termios.h` header file. (Perhaps see [this post](https://stackoverflow.com/qu... | Here is a pthread example that works on linux. The concept is ok, but there are probably existing loops/libraries for this.
```
#include <stdio.h>
#include<pthread.h>
void *timer(void* arg){
int* counter = (int*)arg;
while(*counter > 0){
int a = *counter;
printf("counter: %d \n", a);
*... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | Here is another way that uses `select` to check if input exists and also to wait. Not a pretty solution but it works. Linux only though.
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/select.h>
#define WAIT_TIME 1000 //Delay time in milliseconds
... | If you're not bothered about portability, and you'll always be using Windows, you can use [`PeekConsoleInput`](https://learn.microsoft.com/en-us/windows/console/peekconsoleinput), which tells you what console input events are waiting.
You can't (easily) use `ReadConsoleInput`, because it blocks until there is at least... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | The following short program requires neither ncurses or threads. It does, however, require changing the terminal attributes - using `tcsetattr()`. This will work on Linux and Unix-like systems, but not on Windows - which does not include the `termios.h` header file. (Perhaps see [this post](https://stackoverflow.com/qu... | This could be done with multithreading as already suggested, but there are other possibilities.
[ncurses](https://www.gnu.org/software/ncurses/) for example has the possibility to wait for input with a [timeout](http://www.manpagez.com/man/3/curs_inopts/).
An example for ncurses [(written by Constantin)](https://stac... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | The following short program requires neither ncurses or threads. It does, however, require changing the terminal attributes - using `tcsetattr()`. This will work on Linux and Unix-like systems, but not on Windows - which does not include the `termios.h` header file. (Perhaps see [this post](https://stackoverflow.com/qu... | Here is another way that uses `select` to check if input exists and also to wait. Not a pretty solution but it works. Linux only though.
```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/select.h>
#define WAIT_TIME 1000 //Delay time in milliseconds
... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | This could be done with multithreading as already suggested, but there are other possibilities.
[ncurses](https://www.gnu.org/software/ncurses/) for example has the possibility to wait for input with a [timeout](http://www.manpagez.com/man/3/curs_inopts/).
An example for ncurses [(written by Constantin)](https://stac... | If you're not bothered about portability, and you'll always be using Windows, you can use [`PeekConsoleInput`](https://learn.microsoft.com/en-us/windows/console/peekconsoleinput), which tells you what console input events are waiting.
You can't (easily) use `ReadConsoleInput`, because it blocks until there is at least... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | The following short program requires neither ncurses or threads. It does, however, require changing the terminal attributes - using `tcsetattr()`. This will work on Linux and Unix-like systems, but not on Windows - which does not include the `termios.h` header file. (Perhaps see [this post](https://stackoverflow.com/qu... | Another example using ncurses and POSIX timers and signals (and global variables).
```
#include <ncurses.h>
#include <signal.h>
#include <time.h>
int changed, value;
void timer(union sigval t) {
(void)t; // suppress unused warning
changed = 1;
value--;
}
int main(void) {
int ch;
... |
52,715,823 | I can not get this problem figured out and I am getting frustrated. I want to do a basic search for a person in the database and the following is working fine
```
IQueryable<VwSomeView> dbresult = db.vwSomeView.FromSql("select * from vwSomeView where firstname like '%" + searchfor + "%' or lastname like '%" + searchf... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52715823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10293477/"
] | You need use thread, and need use \_\_sync\_add\_and\_fetch and \_\_sync\_sub\_and\_fetch to avoid concurrency problem
```
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <iostream>
static void* thread(void* p) {
int* counter = (int*)p;
while (1) {... | Your code has two problems; one serious, one not.
The first problem, as you have found out, is that getch() is a blocking function. In other words, the function call will not return until a key had been pressed.
The second problem, although minor, is that the program only responds to input every second.
I've modifie... |
25,349,864 | ```
#include <stdio.h>
int main()
{
int a;
printf("%d\n",a);
}
```
The statement in the above example: `int a;` — is it a declaration or definition? If it is a declaration, the `printf()` statement should give an error, but it prints a garbage value. So we cannot call it a declaration. But as per the sy... | 2014/08/17 | [
"https://Stackoverflow.com/questions/25349864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3950062/"
] | It's a definition.
For a variable in C, you'd have to use the 'extern' keyword if you wanted to only declare it, not define it. A good article can be found [here](http://www.cprogramming.com/declare_vs_define.html) | Declaration means we are just creating a variable or method. Defination means we are assigning some value for a variable & doing some functions in method |
25,349,864 | ```
#include <stdio.h>
int main()
{
int a;
printf("%d\n",a);
}
```
The statement in the above example: `int a;` — is it a declaration or definition? If it is a declaration, the `printf()` statement should give an error, but it prints a garbage value. So we cannot call it a declaration. But as per the sy... | 2014/08/17 | [
"https://Stackoverflow.com/questions/25349864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3950062/"
] | There's no way around the fact that this is a declaration. Every definition in C language is a declaration at the same time. In the reverse direction: some declarations are definitions and some are not.
`int a;` in your code is a declaration that happens to be a definition as well. | Declaration means we are just creating a variable or method. Defination means we are assigning some value for a variable & doing some functions in method |
25,349,864 | ```
#include <stdio.h>
int main()
{
int a;
printf("%d\n",a);
}
```
The statement in the above example: `int a;` — is it a declaration or definition? If it is a declaration, the `printf()` statement should give an error, but it prints a garbage value. So we cannot call it a declaration. But as per the sy... | 2014/08/17 | [
"https://Stackoverflow.com/questions/25349864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3950062/"
] | When you declare a local variable in c, space on the stack is created for the variable. When you declare `int a` without giving `a` a specific value, it's value will be whatever is already in memory in the location set aside for it on the stack. That is most likely a garbage value, which is why you're seeing strange nu... | Declaration means we are just creating a variable or method. Defination means we are assigning some value for a variable & doing some functions in method |
23,140,968 | Koa and Express 4.0 are both fairly new, and from what I've read, Koa was made by the Express team.
From what I understand, Koa requires features of node that are only available in 0.11 (the unstable branch) of node, and also uses generators. Express 4.0 seems to only be the next version of the Express framework.
Are... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23140968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701791/"
] | Search engines should be your first resort before posting open-ended questions.
[From the Koa docs](https://github.com/koajs/koa/blob/master/docs/koa-vs-express.md):
>
> **Koa vs Express**
>
>
> Philosophically, Koa aims to "fix and replace node", whereas Express "augments node". Koa uses co to rid apps of callbac... | * Koa does not provides functionalities like Routing, Templating, Sending files and JSONP while the express does.
* koa exposes its own ctx.request and ctx.response objects instead of node's req and res objects i.e. functions of the form (req, res, next), are incompatible with Koa.
* Koa can be viewed as an abstraction... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | I think it comes down to what you're about to do. Are you writing a web APPLICATION? Then I think you're bound to use javascript and/or something like [GWT](http://code.google.com/webtoolkit/). Just have a look at all the social sites, and google aplications like gmail. If you're writing a webpage with product descript... | You should be tying the functionality of your website to your audience. That being said, every modern browser (save for the mobile platform) includes javascript, and so unless your audience includes luddites with decade old computers, you can assume they *have* javascript.
The people you need to worry about, then, are... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | Just as long as you're aware of the accessibility limitations you might be introducing, ie for users of screen-reading software, etc.
It's one thing to exclude people because they choose to turn off JS or use a browser which doesn't support it, it's entirely another to exclude them because of a disability. | I agree with the majority of the stackoverflow respondents. JavaScript has matured and offers an "extra" level of functionality to a webpage, especially for forms. Those who turn off cookies and JS have likely been bitten while surfing in dangerous waters. For the corporate power users that pay my way either in B2B or ... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | Two simple questions to help you decide...
1. Does using javascript provide some
core functionality of your site?
2. Are you prepared to limit your
potential users to those who have
JS? (ie. Most people)
If you answer yes to both of those, go for it!
Websites are moving (have moved?) from static pages of information... | Some corporate environments won't allow Javascript, by policy or by firewall. It closes the door to one avenue of virus infection.
Whether you think this is a good idea or not, realize that not everyone has full control over their browser and it might not be their choice. |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | I think Javascript implementations in most modern browsers have now reached a reasonable level of maturity and there are a bunch of Javascript UI frameworks which let you build very attractive Javascript based web applications using web-services and such (regardless of the back-end server platform).
An example is [Ext... | You should be tying the functionality of your website to your audience. That being said, every modern browser (save for the mobile platform) includes javascript, and so unless your audience includes luddites with decade old computers, you can assume they *have* javascript.
The people you need to worry about, then, are... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | It's reasonable to design sites that use JavaScript but it is not safe to assume that all clients have support for Javascript and therefore it is important that you provide a satisfactory experience even when JavaScript is not available | There's addon for Firefox called [NoScript](https://addons.mozilla.org/en-US/firefox/addon/722) which have 27,501,701 downloads. If you site won't work without JavaScript most of those guys wouldn't want to use it.
Why you would install that addon? Ever wanted to get rid of the popup on the site that cover the most of... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | JavaScript is great for extending the browser to do things like google maps. But it's a pointy instrument, so use it with care.
My bank web site uses JavaScript for basic navigation between pages. **Sigh**. As a result, it's not usable from my mobile device.
Make sure you're familiar with the [Rule of Least Power](ht... | I think it comes down to what you're about to do. Are you writing a web APPLICATION? Then I think you're bound to use javascript and/or something like [GWT](http://code.google.com/webtoolkit/). Just have a look at all the social sites, and google aplications like gmail. If you're writing a webpage with product descript... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | There is a gradient between web sites and web applications. However, you should alway be able to say "we are building a web site" or "we are building a web application".
Web sites should be readable down to plain HTML (no CSS, no images, no JavaScript).
Web applications, of course, could just say "Sorry, JavaScript ... | I would say that you should look at your target audience. If you can reasonably expect that they will have js enabled, and making everything work without any js is too much of a pain, then by all means - go ahead and ignore the non-js crowd, if, on the other hand you have to create a site that will be used by a very la... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | Just as long as you're aware of the accessibility limitations you might be introducing, ie for users of screen-reading software, etc.
It's one thing to exclude people because they choose to turn off JS or use a browser which doesn't support it, it's entirely another to exclude them because of a disability. | Search Engines don't support JavaScript. They're also blind and don't support CSS. So my suggestion to you is to make sure that the part of your product that needs to be indexable by search engines works without JavaScript and CSS. After that, it really depends on the needs of your users.
If you have a very limited su... |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | Just as long as you're aware of the accessibility limitations you might be introducing, ie for users of screen-reading software, etc.
It's one thing to exclude people because they choose to turn off JS or use a browser which doesn't support it, it's entirely another to exclude them because of a disability. | if you want your site viewable by the top 100 companies in the US. I would write without javascript. |
62,784 | It's fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.
I understand that you should develop sites that degrade gracefully when JS is not present/on. But at what point do you not include funcitonality that can only be powered by JS?
I guess the question comes do... | 2008/09/15 | [
"https://Stackoverflow.com/questions/62784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6957/"
] | I think the days of "content sites only" are gone. What we see now is WWW emerging as the platform of web applications, and the latest developments in the browser front (speeding up JS in particular) ar indication of this.
There can be no yes/no answer to your question - you should decide, where on content site<---->w... | Some corporate environments won't allow Javascript, by policy or by firewall. It closes the door to one avenue of virus infection.
Whether you think this is a good idea or not, realize that not everyone has full control over their browser and it might not be their choice. |
964,194 | Does the series $$\sum\_{n=1}^\infty \frac{(-1)^{n+1}}{n}\sin\frac{1}{nx}$$
converge uniformly on $(0,+\infty)$? First, I guessed that it does, but Abel's test is not applicable here because $\sin\frac{1}{nx}$ is not monotonic, other tools didn't seem to help either. Now I think that there's no uniform convergence, but... | 2014/10/08 | [
"https://math.stackexchange.com/questions/964194",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/158274/"
] | Here is a proof that there is *no* uniform convergence.
For any integer $s$ divisible by $2^t$ but not by $2^{t+1}$, let me denote $\tau(s)=s/2^t$. Now consider a sufficiently large integer $m=4u$. I denote $g(m)=\tau(m+1)\cdot\ldots\cdot\tau(2m)$ and $\xi(m)=2g(m)+ \pi m/2$, and also $$\alpha\_n(m)=(-1)^{n+1}\sin\fra... | this is an alternate series, and for a fixed x, we can find an No such as $\frac{1}{n\*x}$ is always smaller than pi/2 (I want the monotony of sin), if n>=No.
So if we write the general term $(-1)^\left(n+1\right)\*Vn(x)$, we have:
(Vn(x)) decreases, Vn(x)-->0, when n--> ∞, so the theorem about the rest of alternate ... |
2,896,118 | When input the apropriate data is subbed into the equation we get:
$$NPV=\sum\_{t=0}^\infty\frac{200}{1.1^t}$$
I have been told that the second term looks like
$$\sum\_{t=0}^\infty\frac{200}{1.1^t} =\frac{200}{0.1}=2000$$
Could someone explain how the second term can end up being written as $\frac{200}{0.1}$? | 2018/08/27 | [
"https://math.stackexchange.com/questions/2896118",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/583440/"
] | This is true in any metric space. If $F$ is a closed set in a metric space then $F$ is the intersection of the sets $G\_n=\{x: d(x,F) <\frac 1 n\}$ where $d(x,F)=\inf \{d(x,y): y \in F\}$. Also, each $G\_n$ is open. | First part of (2):
Take
$$
G\_j = \{x \colon \inf\_{y\in F} |x - y| < 1/j\}
$$
[suppose we are working on $\mathbb R$]. |
2,896,118 | When input the apropriate data is subbed into the equation we get:
$$NPV=\sum\_{t=0}^\infty\frac{200}{1.1^t}$$
I have been told that the second term looks like
$$\sum\_{t=0}^\infty\frac{200}{1.1^t} =\frac{200}{0.1}=2000$$
Could someone explain how the second term can end up being written as $\frac{200}{0.1}$? | 2018/08/27 | [
"https://math.stackexchange.com/questions/2896118",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/583440/"
] | This is true in any metric space. If $F$ is a closed set in a metric space then $F$ is the intersection of the sets $G\_n=\{x: d(x,F) <\frac 1 n\}$ where $d(x,F)=\inf \{d(x,y): y \in F\}$. Also, each $G\_n$ is open. | You can take
$$ F\_{k} = \left\{ x+y \, : \, x \in F, \, |y| < \frac{1}{k} \right\}, $$
so that $F\_k \supset F\_{k+1}$ for all $k \geq 1$, and
$$ \bigcap\_{k=1}^\infty F\_k = F. $$ |
2,896,118 | When input the apropriate data is subbed into the equation we get:
$$NPV=\sum\_{t=0}^\infty\frac{200}{1.1^t}$$
I have been told that the second term looks like
$$\sum\_{t=0}^\infty\frac{200}{1.1^t} =\frac{200}{0.1}=2000$$
Could someone explain how the second term can end up being written as $\frac{200}{0.1}$? | 2018/08/27 | [
"https://math.stackexchange.com/questions/2896118",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/583440/"
] | First part of (2):
Take
$$
G\_j = \{x \colon \inf\_{y\in F} |x - y| < 1/j\}
$$
[suppose we are working on $\mathbb R$]. | You can take
$$ F\_{k} = \left\{ x+y \, : \, x \in F, \, |y| < \frac{1}{k} \right\}, $$
so that $F\_k \supset F\_{k+1}$ for all $k \geq 1$, and
$$ \bigcap\_{k=1}^\infty F\_k = F. $$ |
32,339,056 | Let's say I want to find, for each purchase category, the top 3 most frequently occurring zip codes. In this example, the categories are *home*, *townhouse*, and *condo*. I have transactional data like:
```
set.seed(1234)
d <- data.table(purch_id = 1:3e6,
purch_cat = sample(x = c('home','townhouse','co... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32339056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2573061/"
] | Edit: improved.
===============
I think you were exactly on the right track. One key thing you're missing, however, is the function `frank`, which has been optimized and should speed up your code considerably (runs almost instantaneously on your 3m row sample data):
```
d[ , .(purch_count = .N),
by = .(purch_cat, ... | One approach would be
```
d[ , .N, by=.(purch_cat, purch_zip)][
order(-N),
.SD[ N >= unique(N)[3] ]
,by=purch_cat]
```
which gives
```
purch_cat purch_zip N
1: townhouse 39587 33
2: townhouse 80365 30
3: townhouse 37360 30
4: townhouse 83099 28
5: townhouse 33518 28
6: townhouse ... |
1,311,806 | How many distinct $4$-digits distinct Integers one can make from the digits $1$,$3$,$3$,$7$,$7$,$8$ ?
Do we have to enumerate all possibilities for such questions and then go by that?
Case $1$: All unique digits, would give me $4$!
Case $2$: Two identical digits and two unique ..and so on for other cases as well ? | 2015/06/04 | [
"https://math.stackexchange.com/questions/1311806",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99961/"
] | Twice a $3$ and twice a $7$ gives $\binom{4}{2}=6$ possibilities.
Twice a $3$ and not more than once a $7$ gives $\binom{4}{2}\times3\times2=36$
possibilities.
Twice a $7$ and not more than once a $3$ gives $\binom{4}{2}\times3\times2=36$
possibilities.
All distinct gives (as you said) $4!=24$ possibilities. | The number of distinct integers is 102. Here are two solutions, one short, one long.
For the short solution, the exponential generating function for the number of distinct r-digit permutations of 1,3,3,7,7,8 is
$$f(x) = (1+x)^2 (1+x+ \frac{1}{2!} x^2)^2$$
The coefficient of $x^4$, when $f(x)$ is expanded, is $17/4$; s... |
1,311,806 | How many distinct $4$-digits distinct Integers one can make from the digits $1$,$3$,$3$,$7$,$7$,$8$ ?
Do we have to enumerate all possibilities for such questions and then go by that?
Case $1$: All unique digits, would give me $4$!
Case $2$: Two identical digits and two unique ..and so on for other cases as well ? | 2015/06/04 | [
"https://math.stackexchange.com/questions/1311806",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99961/"
] | Twice a $3$ and twice a $7$ gives $\binom{4}{2}=6$ possibilities.
Twice a $3$ and not more than once a $7$ gives $\binom{4}{2}\times3\times2=36$
possibilities.
Twice a $7$ and not more than once a $3$ gives $\binom{4}{2}\times3\times2=36$
possibilities.
All distinct gives (as you said) $4!=24$ possibilities. | Case 1: all are distinct ans:4!=24.
Case 2: 2 are same and the other 2 are different. Which digit is to be repeated can be decided in 2 ways. The other 2 digits can be selected in 3 ways. The selected digits can be arranged in 12 ways. Total ways in this case=2×3×12=72.
Case 3: 4 digit number formed by 3,3,7,7
Number... |
1,311,806 | How many distinct $4$-digits distinct Integers one can make from the digits $1$,$3$,$3$,$7$,$7$,$8$ ?
Do we have to enumerate all possibilities for such questions and then go by that?
Case $1$: All unique digits, would give me $4$!
Case $2$: Two identical digits and two unique ..and so on for other cases as well ? | 2015/06/04 | [
"https://math.stackexchange.com/questions/1311806",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99961/"
] | The number of distinct integers is 102. Here are two solutions, one short, one long.
For the short solution, the exponential generating function for the number of distinct r-digit permutations of 1,3,3,7,7,8 is
$$f(x) = (1+x)^2 (1+x+ \frac{1}{2!} x^2)^2$$
The coefficient of $x^4$, when $f(x)$ is expanded, is $17/4$; s... | Case 1: all are distinct ans:4!=24.
Case 2: 2 are same and the other 2 are different. Which digit is to be repeated can be decided in 2 ways. The other 2 digits can be selected in 3 ways. The selected digits can be arranged in 12 ways. Total ways in this case=2×3×12=72.
Case 3: 4 digit number formed by 3,3,7,7
Number... |
23,125,426 | I've got some data which has the login and logout times for a series of users.
Input:
```
Login Logout
User_1 10:25AM 6:01PM
User_2 8:58AM 5:12PM
User_3 9:23AM 1:35PM
User_3 3:10PM 4:49PM
```
I'd like to be able to find out the number of users that were logged in during a t... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23125426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1367459/"
] | Look at [Arrow Module](http://crsmithdev.com/arrow/) - it provides very universal DateTime objects with high level methods.
Ranges & spans
Get the timespan of any unit:
```
>>> arrow.utcnow().span('hour')
(<Arrow [2013-05-07T05:00:00+00:00]>, <Arrow [2013-05-07T05:59:59.999999+00:00]>)
```
Or just get the floor an... | Your best bet would be to convert the times using something like strptime:
```
import time
t = time.strptime("5:24pm", "%H:%M%p")
>>> t.tm_hour
5
>>> t.tm_min
24
```
That way you can get everything in the same hour, for example, like you wanted. |
23,125,426 | I've got some data which has the login and logout times for a series of users.
Input:
```
Login Logout
User_1 10:25AM 6:01PM
User_2 8:58AM 5:12PM
User_3 9:23AM 1:35PM
User_3 3:10PM 4:49PM
```
I'd like to be able to find out the number of users that were logged in during a t... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23125426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1367459/"
] | I found an approach that seems to work well:
Assuming we can transform our Login/Logout data into two DataFrames indexed by time:
```
Login UserLogin
-------- ---------
8:58AM User_2
9:23AM User_3
10:25AM User_1
3:10PM User_3
Logout UserLogout
-------- ----------
1:35PM User_3
4:49PM ... | Your best bet would be to convert the times using something like strptime:
```
import time
t = time.strptime("5:24pm", "%H:%M%p")
>>> t.tm_hour
5
>>> t.tm_min
24
```
That way you can get everything in the same hour, for example, like you wanted. |
23,125,426 | I've got some data which has the login and logout times for a series of users.
Input:
```
Login Logout
User_1 10:25AM 6:01PM
User_2 8:58AM 5:12PM
User_3 9:23AM 1:35PM
User_3 3:10PM 4:49PM
```
I'd like to be able to find out the number of users that were logged in during a t... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23125426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1367459/"
] | I found an approach that seems to work well:
Assuming we can transform our Login/Logout data into two DataFrames indexed by time:
```
Login UserLogin
-------- ---------
8:58AM User_2
9:23AM User_3
10:25AM User_1
3:10PM User_3
Logout UserLogout
-------- ----------
1:35PM User_3
4:49PM ... | Look at [Arrow Module](http://crsmithdev.com/arrow/) - it provides very universal DateTime objects with high level methods.
Ranges & spans
Get the timespan of any unit:
```
>>> arrow.utcnow().span('hour')
(<Arrow [2013-05-07T05:00:00+00:00]>, <Arrow [2013-05-07T05:59:59.999999+00:00]>)
```
Or just get the floor an... |
33,857,313 | I am trying to create node js template using express --ejs .
I have create folder in "C:\MEAN\_Stack"
then open power shell as admin
run command npm install express-generator -g
then go to my app folder
then run the command **npm install express --ejs .** but this command just create the node\_modules folder not othe... | 2015/11/22 | [
"https://Stackoverflow.com/questions/33857313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2170891/"
] | When you want to create a project scaffolding with express, you need to execute:
```
express --ejs .
```
`npm` is used to install the express generator (and after to install dependencies with `npm install`). | Install express-generator first :
```
npm install express-generator -g
```
Then create your app with :
```
express nameofapp
``` |
27,410,227 | I am very new to android just started to learn. I have installed android Studio. When I do launch it, it tries to update components, but it fails to update anything. A message does appear saying there is nothing to update and when I click finish, nothing happens.
I have attached a screenshot of error. Please let me kn... | 2014/12/10 | [
"https://Stackoverflow.com/questions/27410227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4347424/"
] | This is how i fixed the problem with my installation -
Go to your C:\Users\"User\_NAME"\.AndroidStudio\config\options directory and open 'other.xml'.
then either update value for option USE\_PROXY\_PAC as true
OR
Set up values for PROXY settings there.
Launch Android Studio after this. | Had the same problem. visited different diffident Stack-overflow questions but nothing helped me. you will have to update these things manually from SDK manager. SDK Manager is by default located at C:\Users[Your-User-Name]\AppData\Local\Android\sdk and AppData folder is by default hidden so you will have to make it vi... |
7,109 | I want to know what do you think of personal pictures of yourself on portfolios.
I will soon be taking a photoshoot with a proper photographer for my portfolio, I mainly want it for my hero image and one for a profile pictures on popular freelance sites.
Do you think it adds any benefits for conversion? and if what... | 2017/08/10 | [
"https://freelancing.stackexchange.com/questions/7109",
"https://freelancing.stackexchange.com",
"https://freelancing.stackexchange.com/users/17836/"
] | Personal opinion....
**No**. There's no reason anyone hiring me needs to know what I look like.
There's a *very old* resume rule which states that you *never* put your photo on your resume. There is a *very* good reason for this.. bias or outright discrimination. Not just based on sex or race, but on age, attitude, ... | Be dressed in formal business attire for your area, or just your face as in a passport photo. It must not set up a picture that can backfire on you in a few years time.
A certain "G\_\_\_\_" employee later found that his 'cool picture' caused problems when he wanted to change jobs. Leave the casual photos to your Face... |
7,109 | I want to know what do you think of personal pictures of yourself on portfolios.
I will soon be taking a photoshoot with a proper photographer for my portfolio, I mainly want it for my hero image and one for a profile pictures on popular freelance sites.
Do you think it adds any benefits for conversion? and if what... | 2017/08/10 | [
"https://freelancing.stackexchange.com/questions/7109",
"https://freelancing.stackexchange.com",
"https://freelancing.stackexchange.com/users/17836/"
] | Personal opinion....
**No**. There's no reason anyone hiring me needs to know what I look like.
There's a *very old* resume rule which states that you *never* put your photo on your resume. There is a *very* good reason for this.. bias or outright discrimination. Not just based on sex or race, but on age, attitude, ... | Depends on how you want to portray yourself, you want to be a "business owner" or a "freelancer for hire"?
For freelancer focus on personality, fresh, young, creative.
Fur business the focus is on serious, clean, reliable, professional.
good luck |
2,150,220 | I'd like to have vim highlight entire lines that match certain patterns. I can get all the text in a line to highlight (by doing `syn match MyMatch "^.*text-to-match.*$"`), but it always stops at the end of the text. I'd like to to continue to the end of the term, like highlighting CursorLine.
I've tried replacing `$`... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2150220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239690/"
] | From the documentation on `syn-pattern`:
>
> The highlighted area will never be
> outside of the matched text.
>
>
>
I'd count myself surprised if you got this to work, but then again, Vim is always full of surprises. | could also try
:set cursorline
:set cursorcolumn
change colors like this:
:hi cursorline
:hi cursorcolumn
using the usual term=, ctermfg=, ctermbg= etc
see this answer
[VIM Highlight the whole current line](https://stackoverflow.com/questions/8750792/vim-highlight-the-whole-current-line) |
2,150,220 | I'd like to have vim highlight entire lines that match certain patterns. I can get all the text in a line to highlight (by doing `syn match MyMatch "^.*text-to-match.*$"`), but it always stops at the end of the text. I'd like to to continue to the end of the term, like highlighting CursorLine.
I've tried replacing `$`... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2150220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/239690/"
] | It's not very adaptive as the filename (buffer) and line to full row highlight needs to be explicitly identified, but apparently the **[sign](http://vimdoc.sourceforge.net/htmldoc/sign.html)** command can be used:
>
> It is possible to highlight an entire
> line using the **:sign** mechanism.
>
> An example can ... | could also try
:set cursorline
:set cursorcolumn
change colors like this:
:hi cursorline
:hi cursorcolumn
using the usual term=, ctermfg=, ctermbg= etc
see this answer
[VIM Highlight the whole current line](https://stackoverflow.com/questions/8750792/vim-highlight-the-whole-current-line) |
162,097 | How would I solve the following trig questions.
1. A tree broken over by the winds forms a right angle with the ground.If the broken part makes angle of 50 degrees with the ground and if the top of the tree is now 20 feet from the base how tall was the tree?
2. Two straight roads intersect to form an angle 0f 75 degre... | 2012/06/23 | [
"https://math.stackexchange.com/questions/162097",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34342/"
] | $1.$ Draw a picture. Let $b$ be the current (broken) height of the tree, that is, the distance from the ground to the break, which is really only a sharp bend. Then
$$\frac{b}{20}=\tan(50^\circ).$$
Let $\ell$ be the length of the "leaning" part. Then
$$\frac{20}{\ell}=\cos(50^\circ).$$
Finally, the original height of t... | Cos75= 1000/OP OP=1000/Cos75 = 3863.70
PG= √3863^2 – 1000^2 = 3732.05
The coordinate is taken from the previous answer by Andre |
66,576,146 | My django project is correctly enable the timezone in settings.
However, the datetime field of Django ORM object is a naive datetime object as shown in Block 3.
The expected result should be same as the output of Block 4 without any manually conversion.
```py
In [1]: from django.conf import settings
...: settings... | 2021/03/11 | [
"https://Stackoverflow.com/questions/66576146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6434396/"
] | The root-cause is a bug from a connection pool library `django_postgrespool2==2.0.1`.
When you use the your connection engine with "django\_postgrespool2", it will *NOT* correctly handle the timezone settings. [Releated Issue](https://github.com/lcd1232/django-postgrespool2/issues/22)
TLDR: use engine `django.db.back... | You can use `django.utils.timezone.localtime` to convert the datetime received from the DB to localtime:
```
from django.utils.timezone import localtime
q = Quota.objects.get(pk=1)
print(localtime(q.create_date), localtime(q.write_date))
``` |
33,630,153 | How to change opacity of the background image while hovering over a div with text? I tried to add opacity to hover but it affected text too so I assume It can be done only using jQuery since I can't change the HTML structure.
```css
.wrapper {
margin: 0 auto;
max-width: 940px;
background: #EBEBEB;
}
.border... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33630153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5312814/"
] | you can use a trick like this
set the background to the `:after`
```
.one:after {
background: url('http://carwallstar.com/wp-content/uploads/2014/11/ford-car-images2015-ford-mustang--2015-ford-mustang-29-----froggpondcom-w8lqchv6.jpg') 100% 100% no-repeat;
background-size: cover;
content: "";
opacity: 0.5;
... | You can't change the opacity of a background image.
You can:
* Use a background *colour* specified with an alpha channel
* Set the opacity of an entire *element*
* Use an image format with a built in opacity (such as PNG)
One approach is to restructure your content so that the background image is on an element that ... |
33,630,153 | How to change opacity of the background image while hovering over a div with text? I tried to add opacity to hover but it affected text too so I assume It can be done only using jQuery since I can't change the HTML structure.
```css
.wrapper {
margin: 0 auto;
max-width: 940px;
background: #EBEBEB;
}
.border... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33630153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5312814/"
] | My suggestion to you would be to use a picture editing software (such as PhotoShop) in order to change the opacity on the background images. Then, save these images into another file and in your CSS, change the background: url() to the less opaque images. | You can't change the opacity of a background image.
You can:
* Use a background *colour* specified with an alpha channel
* Set the opacity of an entire *element*
* Use an image format with a built in opacity (such as PNG)
One approach is to restructure your content so that the background image is on an element that ... |
33,630,153 | How to change opacity of the background image while hovering over a div with text? I tried to add opacity to hover but it affected text too so I assume It can be done only using jQuery since I can't change the HTML structure.
```css
.wrapper {
margin: 0 auto;
max-width: 940px;
background: #EBEBEB;
}
.border... | 2015/11/10 | [
"https://Stackoverflow.com/questions/33630153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5312814/"
] | you can use a trick like this
set the background to the `:after`
```
.one:after {
background: url('http://carwallstar.com/wp-content/uploads/2014/11/ford-car-images2015-ford-mustang--2015-ford-mustang-29-----froggpondcom-w8lqchv6.jpg') 100% 100% no-repeat;
background-size: cover;
content: "";
opacity: 0.5;
... | My suggestion to you would be to use a picture editing software (such as PhotoShop) in order to change the opacity on the background images. Then, save these images into another file and in your CSS, change the background: url() to the less opaque images. |
60,588,426 | I have two lists of the same length, one containing integers and one floats. I want to assign every float number to an integer number - **relatively**.
By **relative**, I mean:
* **higher** integer numbers are supposed to have a **higher chance** to receive a **low** float number
* **lower** integer numbers are suppo... | 2020/03/08 | [
"https://Stackoverflow.com/questions/60588426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6822649/"
] | If you inspect **original html source** of this webpage (CTRL + U on google Chrome webbrowser, !!!not html code from Crhome developer tools /elements section)
you will see 2 important things:
1. Images in tags like `<div class="lazy-image listing-slider-carousel-item lazy-image-loaded">` as well as other data don't... | `/*` is to look for child element, try without it
```
response.xpath('//div[@class="lazy-image-background"][starts-with(@style,"background-image")]')
``` |
60,588,426 | I have two lists of the same length, one containing integers and one floats. I want to assign every float number to an integer number - **relatively**.
By **relative**, I mean:
* **higher** integer numbers are supposed to have a **higher chance** to receive a **low** float number
* **lower** integer numbers are suppo... | 2020/03/08 | [
"https://Stackoverflow.com/questions/60588426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6822649/"
] | If you inspect **original html source** of this webpage (CTRL + U on google Chrome webbrowser, !!!not html code from Crhome developer tools /elements section)
you will see 2 important things:
1. Images in tags like `<div class="lazy-image listing-slider-carousel-item lazy-image-loaded">` as well as other data don't... | You can use the xpath as:
```
//div[@class="lazy-image-background" and contains(@style, "background-image: url")]
```
This will get you all the **div** elements containing images with url on the page. Then you can add some code to extract image url from each element |
10,265,047 | The login system I have created logs the user in fine initially, the user is redirected to an index as expected. However when the user clicks on a navigation link to navigate to another page (which is restricted) the user is redirected to the login page. When they login for a second time, every and any page can be acce... | 2012/04/22 | [
"https://Stackoverflow.com/questions/10265047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/885097/"
] | You should definitely split the in\_words into an array as a first step.
Your query is still a tricky one.
Next consider using a [$regex](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-RegularExpressions) query against that array field.
Constructing the regex will be a bit hard since you want t... | You can solve this by splitting the long string into seperate tokens and put them in to the separate array. And use `$all` query to effectively find the matching keywords.
Check out the sample
```
> db.splitter.insert({tags:'John Doe is from Florida and is a fan of American Express'.split(' ')})
> db.splitter.insert(... |
18,824,952 | I have following script in jQuery:
```
var cval5 = ' ';
$(':input[value^="ltrDataColumn"]').filter(':checked').each(function (index) {
var val = (this).value;
val = val.replace('ltrDataColumn', '');
cval5 = cval5 + val + '@@';
});
```
HTML:
```
<select multiple="multiple" style="width:370px">
<optio... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18824952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2674368/"
] | Since it is a `select` element, you need to use the :selected filter not :checked
```
$('select option[value^="ltrDataColumn"]:selected').each(function (index) {
var val = this.value;
val = val.replace('ltrDataColumn', '');
cval5 = cval5 + val + '@@';
});
```
Demo: [Fiddle](http://jsfiddle.net/arunpjohny... | You are using a select element. So, your script should look like that:
```
var cval5 = ' ';
var select = $("select[multiple='multiple']");
var value = select.val();
if(value != null) {
for(var i=0; val=value[i]; i++) {
val = val.replace('ltrDataColumn', '');
cval5 = cval5 + val + '@@';
}
}
aler... |
18,824,952 | I have following script in jQuery:
```
var cval5 = ' ';
$(':input[value^="ltrDataColumn"]').filter(':checked').each(function (index) {
var val = (this).value;
val = val.replace('ltrDataColumn', '');
cval5 = cval5 + val + '@@';
});
```
HTML:
```
<select multiple="multiple" style="width:370px">
<optio... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18824952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2674368/"
] | Since it is a `select` element, you need to use the :selected filter not :checked
```
$('select option[value^="ltrDataColumn"]:selected').each(function (index) {
var val = this.value;
val = val.replace('ltrDataColumn', '');
cval5 = cval5 + val + '@@';
});
```
Demo: [Fiddle](http://jsfiddle.net/arunpjohny... | [DEMO HERE](http://jsfiddle.net/AhmfX/)
---------------------------------------
First , you confuse `checked` and `selected` and you don't use the good selectors , Look at the console to see the output , try this :
**HTML:**
```
<select multiple="multiple" style="width:370px">
<option value="ltrDataColumnred" se... |
25,021,015 | I have the following code in a Chrome extension I wrote:
```
chrome.tabs.update(newTab.id, {url: "javascript:window.print()"}, doAftermath);
} //End of a function
<snip!>
//Do nothing upon errors
function doAftermath(){
if(chrome.runtime.lastError){
//If the user doesn't Print or Cancel, but closes t... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25021015",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/772758/"
] | Actually I had the correct jQuery function all along:
```
$('form').removeData("validator").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parse($('form'));
```
However my page was displaying the default MVC validation errors for my nested class properties, instead of those I've specified in the data a... | I believe jquery validate initializes based on classes on your elements when the form initially loads.
Because you are dynamically adding elements that need validate you will have to register them for validation yourself when you load them.
```
$('#elementID').rules('add', 'required');
```
Try calling that after yo... |
69,824,638 | I have a table login like below :
| Idlogin | userid. | Date |
| --- | --- | --- |
| 1. | 12A. | 22/03/2021 |
| 2. | 12B. | 22/04/2021 |
| 3. | 12A. | 29/03/2021 |
I have a table users that contains a list of all the users
| Iduser |
| --- |
| 12A |
| 12B |
| 23k |
| Jk8 |
| Kl9 |
And a table dimdates that contains... | 2021/11/03 | [
"https://Stackoverflow.com/questions/69824638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14863832/"
] | **Cartesian Join** to list all users with all dates and use **NOT EXIST** to exclude the rows using login table:
```
select u.Iduser, d.date from
dimdates d,
users u
where not exists
(
select 1 from login l
where l.date = d.date
and l.Idlogin=u.Iduser
)
``` | Anti-semi join:
```
select *
from [users] U
where not exists
(
select 1
from [login] L
inner join dimdates D on L.[Date]=D.[Date]
where L.Idlogin=U.Iduser
)
``` |
33,770,212 | These are two errors I get, can someone explain to me why my thinking is wrong?
```none
HW3.c: In function ‘newStack’:
HW3.c:23:3: error: invalid use of undefined type ‘struct stack’
myStack.list = malloc(sizeof(job) * 16);
HW3.c:24:3: error: invalid use of undefined type ‘struct stack’
&job1 = myStack.list;
`... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33770212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5360240/"
] | The reason for the error is that you `typedef` an anonymous `struct` and the try to declare it as if it were not anonymous or `typedef`ed, you need to change the declarations to
```
stack myStack;
```
because the `struct` has no name, you only defined a type named `stack` which is what you can use to declare a vari... | You have two types `stack` and `job` defined via `typedef`, not `struct stack` nor `struct job`.
```
&job1 = myStack.list;
```
is bad because `&job1` is just a pointer value, not an variable, and the compiler won't know where to store the data.
Not knowing what is meant by "add more jobs",
```
&job2 = myStack.list... |
33,770,212 | These are two errors I get, can someone explain to me why my thinking is wrong?
```none
HW3.c: In function ‘newStack’:
HW3.c:23:3: error: invalid use of undefined type ‘struct stack’
myStack.list = malloc(sizeof(job) * 16);
HW3.c:24:3: error: invalid use of undefined type ‘struct stack’
&job1 = myStack.list;
`... | 2015/11/18 | [
"https://Stackoverflow.com/questions/33770212",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5360240/"
] | If you use `typedef`, as in:
```
typedef struct {
// (your fields here)
}stack;
```
then, after that you use your struct as just `stack`, like this:
```
stack myStack;
```
...because you have **defined** `stack` to be an equivalent of `struct {...`. does it make sense?
Alternatively, if you want to keep us... | You have two types `stack` and `job` defined via `typedef`, not `struct stack` nor `struct job`.
```
&job1 = myStack.list;
```
is bad because `&job1` is just a pointer value, not an variable, and the compiler won't know where to store the data.
Not knowing what is meant by "add more jobs",
```
&job2 = myStack.list... |
71,154,261 | I am trying to push a event towards GA3, mimicking an event done by a browser towards GA. From this Event I want to fill Custom Dimensions(visibile in the user explorer and relate them to a GA ID which has visited the website earlier). Could this be done without influencing website data too much? I want to enrich someo... | 2022/02/17 | [
"https://Stackoverflow.com/questions/71154261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810199/"
] | Use `find` instead of `find_one` .
<https://www.w3schools.com/python/python_mongodb_find.asp> | I assumed you're using `pymongo`, just change `find_one` to `find` method. Like this:
```py
async def fetch_store_by_name(store_name):
document = collection.find({"name":store_name})
return document
```
Here some documentation : <https://pymongo.readthedocs.io/en/stable/tutorial.html#querying-for-more-than-one-d... |
71,154,261 | I am trying to push a event towards GA3, mimicking an event done by a browser towards GA. From this Event I want to fill Custom Dimensions(visibile in the user explorer and relate them to a GA ID which has visited the website earlier). Could this be done without influencing website data too much? I want to enrich someo... | 2022/02/17 | [
"https://Stackoverflow.com/questions/71154261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810199/"
] | Use `find` instead of `find_one` .
<https://www.w3schools.com/python/python_mongodb_find.asp> | Using variables such as name, address, zip code to identify a document is not a good approach as there may be the same names, names with different cases, spaces ex: LG, lg.
You can use the default mongo \_id as a unique property to find the doc. Still you want to get the document then use `collection.find({"name":stor... |
71,154,261 | I am trying to push a event towards GA3, mimicking an event done by a browser towards GA. From this Event I want to fill Custom Dimensions(visibile in the user explorer and relate them to a GA ID which has visited the website earlier). Could this be done without influencing website data too much? I want to enrich someo... | 2022/02/17 | [
"https://Stackoverflow.com/questions/71154261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810199/"
] | Use `find` instead of `find_one` .
<https://www.w3schools.com/python/python_mongodb_find.asp> | You can use `collection.find({"name":store_name})`
Reference:
<https://www.w3schools.com/python/python_mongodb_find.asp> |
71,154,261 | I am trying to push a event towards GA3, mimicking an event done by a browser towards GA. From this Event I want to fill Custom Dimensions(visibile in the user explorer and relate them to a GA ID which has visited the website earlier). Could this be done without influencing website data too much? I want to enrich someo... | 2022/02/17 | [
"https://Stackoverflow.com/questions/71154261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810199/"
] | I assumed you're using `pymongo`, just change `find_one` to `find` method. Like this:
```py
async def fetch_store_by_name(store_name):
document = collection.find({"name":store_name})
return document
```
Here some documentation : <https://pymongo.readthedocs.io/en/stable/tutorial.html#querying-for-more-than-one-d... | Using variables such as name, address, zip code to identify a document is not a good approach as there may be the same names, names with different cases, spaces ex: LG, lg.
You can use the default mongo \_id as a unique property to find the doc. Still you want to get the document then use `collection.find({"name":stor... |
71,154,261 | I am trying to push a event towards GA3, mimicking an event done by a browser towards GA. From this Event I want to fill Custom Dimensions(visibile in the user explorer and relate them to a GA ID which has visited the website earlier). Could this be done without influencing website data too much? I want to enrich someo... | 2022/02/17 | [
"https://Stackoverflow.com/questions/71154261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810199/"
] | You can use `collection.find({"name":store_name})`
Reference:
<https://www.w3schools.com/python/python_mongodb_find.asp> | Using variables such as name, address, zip code to identify a document is not a good approach as there may be the same names, names with different cases, spaces ex: LG, lg.
You can use the default mongo \_id as a unique property to find the doc. Still you want to get the document then use `collection.find({"name":stor... |
17,502 | I have a basic table :
```
create table fullTextTest
(
id INT(11) NOT NULL,
superText CHAR(255) NOT NULL,
superLongText TEXT NOT NULL,
primary key (`id`),
FULLTEXT KEY `superText` (`superText`),
FULLTEXT KEY `superLongtext` (`superLongtext`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
insert into f... | 2012/05/07 | [
"https://dba.stackexchange.com/questions/17502",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/8613/"
] | I can understand why this happening
You only have one row in the table.
MySQL Query Optimizer will execute a plan around this rule-of-thumb : If the number of rows needed to examine the fulfillment of a query through an index exceeds 5% of the total of number of rows, the Query Optimizer will not use the index and wi... | The 'Extra' `Using index` (not to be confused with `Using index condition`) in `EXPLAIN` means that *all* the columns mentioned in the `SELECT` are contained in the one `INDEX` being used.
In your query, all 3 columns are mentioned (`*` of `SELECT *`), but only one column is mentioned in the index (`superText`).
What... |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | You said you tried to "renew all my certificates in Provision Center". Are you certain you are:
1. Using a valid certificate. Have you imported the private key into your keychain?
2. Chosen the right provisioning profile + certificate combination for your "Release" or "Distribution" configuration?
It's possible that ... | Are you sure your distribution certificate is for the app store, and not for ad-hoc distribution? |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | You said you tried to "renew all my certificates in Provision Center". Are you certain you are:
1. Using a valid certificate. Have you imported the private key into your keychain?
2. Chosen the right provisioning profile + certificate combination for your "Release" or "Distribution" configuration?
It's possible that ... | From Product menu go to "Edit Schema", there find the Archive from the left sidebar and check which build configuration you are using for Archive. It should be distribution.
Another thing to check is which provision profile Distribution configuration is using, you can check this from projects Build Settings under Cod... |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | I solved, thanks to the help of an Apple Technic Engineer, this way:
In targets, on Build Settings - Product name, I had the name of the app with spaces and special characters (`?` character). After changing that and changing the Bundle Name too, I solved all the problems I got with that.
Hope this will help someone,... | You said you tried to "renew all my certificates in Provision Center". Are you certain you are:
1. Using a valid certificate. Have you imported the private key into your keychain?
2. Chosen the right provisioning profile + certificate combination for your "Release" or "Distribution" configuration?
It's possible that ... |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | You said you tried to "renew all my certificates in Provision Center". Are you certain you are:
1. Using a valid certificate. Have you imported the private key into your keychain?
2. Chosen the right provisioning profile + certificate combination for your "Release" or "Distribution" configuration?
It's possible that ... | After making sure my certificate and provisioning profile were correct for In-House deployment and making sure I didn't have any unwanted spaces or characters in the target names, what worked for me was to change my scheme from Debug to Release on the Run page. Product -> Scheme -> Edit Scheme -> Click Run -> Change Bu... |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | I solved, thanks to the help of an Apple Technic Engineer, this way:
In targets, on Build Settings - Product name, I had the name of the app with spaces and special characters (`?` character). After changing that and changing the Bundle Name too, I solved all the problems I got with that.
Hope this will help someone,... | Are you sure your distribution certificate is for the app store, and not for ad-hoc distribution? |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | I solved, thanks to the help of an Apple Technic Engineer, this way:
In targets, on Build Settings - Product name, I had the name of the app with spaces and special characters (`?` character). After changing that and changing the Bundle Name too, I solved all the problems I got with that.
Hope this will help someone,... | From Product menu go to "Edit Schema", there find the Archive from the left sidebar and check which build configuration you are using for Archive. It should be distribution.
Another thing to check is which provision profile Distribution configuration is using, you can check this from projects Build Settings under Cod... |
6,479,257 | I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission cer... | 2011/06/25 | [
"https://Stackoverflow.com/questions/6479257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/781322/"
] | I solved, thanks to the help of an Apple Technic Engineer, this way:
In targets, on Build Settings - Product name, I had the name of the app with spaces and special characters (`?` character). After changing that and changing the Bundle Name too, I solved all the problems I got with that.
Hope this will help someone,... | After making sure my certificate and provisioning profile were correct for In-House deployment and making sure I didn't have any unwanted spaces or characters in the target names, what worked for me was to change my scheme from Debug to Release on the Run page. Product -> Scheme -> Edit Scheme -> Click Run -> Change Bu... |
29,549,950 | I am implementing Unity3D ads into my Android game. I'm using a helper class that Unity provides to help manage different events.
If a user watches a video and completes it, I reward the user with play money(candy). This method is called after a video ad has been initialized:
```
private static void HandleShowResul... | 2015/04/09 | [
"https://Stackoverflow.com/questions/29549950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3084722/"
] | First off, there is nothing stopping you from performing operations on an instanced object from a static method, in fact, if the static method is in a different class, there is *no difference* in what you need to do in order to perform the operation.
That requirement is simple, you need to have a reference to the inst... | To update an instance field from a static member, it is necessary to have the instance. One possible way is to store the `CandyManager` instance as a static property in you class with `HandleShowResult`:
```
public static class MyClass{
private static void HandleShowResult (ShowResult result)
{
//...
... |
102,945 | I created an Ubuntu VM VMWare Workstation on my Win7 machine and was able to install several packages and download Eclipse without issue. However, now I am attempting a repo sync for the android source code and a download from firefox of Motodev Studio without any success. The downloads for each begin fine but reach a ... | 2010/01/31 | [
"https://superuser.com/questions/102945",
"https://superuser.com",
"https://superuser.com/users/26737/"
] | I periodically open up my Mac pro and vacuum out the dust that the case fans tend to accumulate. The iMac's harder to access, but it's less prone to dust too. Other than said dust control, you shouldn't need to clean anything. | They’re no more or less dirt-prone that other computers.
>
> all computers... need to be cleaned for maintence and good performance
>
>
>
I’d query the good performance part. Sounds like nonsense. |
494,203 | Here is an exercise from my textbook.
][1](https://i.stack.imgur.com/VgGCH.png)
At first I solve it by using Kirchhoff's laws directly and using complex impendance:
$$U\_{in}=\frac{1}{Cs}(i\_1-i\_2)+i\_1R\_1$$
$$0=R\_2i\_2+\frac{1}{Cs}i\_2+\frac{1}{C... | 2019/07/29 | [
"https://physics.stackexchange.com/questions/494203",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/198866/"
] | This is impossible to do because the total mass and center of mass do not uniquely define a mass distribution $\rho(\mathbf r)$.
The total mass is
$$M=\int\rho(\mathbf r)\text dV$$
the center of mass is
$$\mathbf r\_{\text{com}}=\frac{1}{M}\int\mathbf r\rho(\mathbf r)\text dV$$
Since $\rho(\mathbf r)$ is contained w... | The density function is not uniquely defined.
Let $a,b,c$ be the lengths of the sides of the cuboid and $m$ the mass. Consider $\rho(\vec{r}) = \frac{m}{abc}$ and $$\rho(\vec{r}) = \rho(x,y,z) = \frac{12m}{a^3bc}\left(x-\frac{a}2\right)^2$$
Then both density functions yield the center of mass $\left(\frac{a}2, \frac{... |
3,712,511 | Let $n\in \mathbb{N}$ such that $n \equiv 5$ (mod $6$). Then there must be a prime factor $p$ of $n$ such that $p \equiv 5$ (mod $6$).
Let $n \equiv 5$ (mod $6$) such that $n=p\_1^{a\_1}p\_2^{a\_2}\cdots p\_m^{a\_m}$ where $p\_i$'s are distinct primes. Any prime is either congruent to $1$ or $5$ modulo $6$, so if all ... | 2020/06/09 | [
"https://math.stackexchange.com/questions/3712511",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/387962/"
] | Your proof is pretty good, though you missed that there are primes congruent to $2$ and $3$ mod $6$ (namely, $2$ and $3$), though we would not have $n\equiv5\pmod6$ if $2$ or $3$ divided $n$. | Your proof is correct but is better phrased as proof of the contrapositive:
>
> If all prime factors of $n$ are congruent to $1$ mod $6$, then so is $n$.
>
>
> |
39,838,980 | .addPicture requires width and height, but this could end up distorting the image. Is there any way to use .LockAspectRatio = msoCTrue when adding the file image?
Also, how do you stipulate a page to put the canvas or the picture? Macro recorder needs to be stopped before one can work on images somehow.
```
Set sCanv... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39838980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6828374/"
] | You could try to obtain the dimensions using the code [here](https://social.msdn.microsoft.com/Forums/office/en-US/5f375529-a002-4312-a54b-b70d6d3eb6ae/how-to-retrieve-image-dimensions-using-vba-?forum=accessdev) (pasted below for reference)
```
Sub test()
Dim objShell As Object
Dim objFolder As Object
Dim objFile As... | If you check the definition of the AddPicture method you will find that except for FileName all of the arguments are optional, so Height and Width are not required.
Unless you have a specific reason for adding a canvas it is also unnecessary to add a canvas before adding a picture.
Word has no concept of pages so you... |
39,838,980 | .addPicture requires width and height, but this could end up distorting the image. Is there any way to use .LockAspectRatio = msoCTrue when adding the file image?
Also, how do you stipulate a page to put the canvas or the picture? Macro recorder needs to be stopped before one can work on images somehow.
```
Set sCanv... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39838980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6828374/"
] | You could try to obtain the dimensions using the code [here](https://social.msdn.microsoft.com/Forums/office/en-US/5f375529-a002-4312-a54b-b70d6d3eb6ae/how-to-retrieve-image-dimensions-using-vba-?forum=accessdev) (pasted below for reference)
```
Sub test()
Dim objShell As Object
Dim objFolder As Object
Dim objFile As... | Managed to find a way to put a picture to a specific page (page 2 in example below) in MS Word:
```
Dim pNum as long
pNum = 2
Selection.GoTo What:=wdGoToPage, Count:= pNum
``` |
39,838,980 | .addPicture requires width and height, but this could end up distorting the image. Is there any way to use .LockAspectRatio = msoCTrue when adding the file image?
Also, how do you stipulate a page to put the canvas or the picture? Macro recorder needs to be stopped before one can work on images somehow.
```
Set sCanv... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39838980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6828374/"
] | Set the canvas size to 0 and lock it's aspect ratio, *then* add the picture. The canvas will scale to accommodate it. After the image is loaded, *then* scale the canvas as needed:
```
Set sCanvas = ActiveDocument.Shapes.AddCanvas(MillimetersToPoints(20), MillimetersToPoints(20), 0, 0)
sCanvas.LockAspectRatio = True
Se... | If you check the definition of the AddPicture method you will find that except for FileName all of the arguments are optional, so Height and Width are not required.
Unless you have a specific reason for adding a canvas it is also unnecessary to add a canvas before adding a picture.
Word has no concept of pages so you... |
39,838,980 | .addPicture requires width and height, but this could end up distorting the image. Is there any way to use .LockAspectRatio = msoCTrue when adding the file image?
Also, how do you stipulate a page to put the canvas or the picture? Macro recorder needs to be stopped before one can work on images somehow.
```
Set sCanv... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39838980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6828374/"
] | Set the canvas size to 0 and lock it's aspect ratio, *then* add the picture. The canvas will scale to accommodate it. After the image is loaded, *then* scale the canvas as needed:
```
Set sCanvas = ActiveDocument.Shapes.AddCanvas(MillimetersToPoints(20), MillimetersToPoints(20), 0, 0)
sCanvas.LockAspectRatio = True
Se... | Managed to find a way to put a picture to a specific page (page 2 in example below) in MS Word:
```
Dim pNum as long
pNum = 2
Selection.GoTo What:=wdGoToPage, Count:= pNum
``` |
39,838,980 | .addPicture requires width and height, but this could end up distorting the image. Is there any way to use .LockAspectRatio = msoCTrue when adding the file image?
Also, how do you stipulate a page to put the canvas or the picture? Macro recorder needs to be stopped before one can work on images somehow.
```
Set sCanv... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39838980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6828374/"
] | If you check the definition of the AddPicture method you will find that except for FileName all of the arguments are optional, so Height and Width are not required.
Unless you have a specific reason for adding a canvas it is also unnecessary to add a canvas before adding a picture.
Word has no concept of pages so you... | Managed to find a way to put a picture to a specific page (page 2 in example below) in MS Word:
```
Dim pNum as long
pNum = 2
Selection.GoTo What:=wdGoToPage, Count:= pNum
``` |
3,331,565 | >
> Suppose
>
> $R$ is a relation on set $A$.
>
> $S$ is the transitive closure of $R$.
>
> $\forall n \in \mathbb{Z}^+ (J\_n = \{0,1,2,\dots, n\})$.
>
>
> Let $a,b \in A$.
>
> $f: J\_n \rightarrow A$ is an $R$-path from $a$ to $b$ of length $n$ if
> $f(0)=a \land f(n)=b \land \forall i < n (f(i), f(i+... | 2019/08/23 | [
"https://math.stackexchange.com/questions/3331565",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/595208/"
] | You can do this without induction.
Hint: Problem 10 shows that $(a,b)\in R^n$ iff there is an $R$-path of length $n$ from $a$ to $b$. (You would need induction to prove this.) So, given such a path, can you show that there is a *simple* $R$-path from $a$ to $b$ with length at most $n$? | **Lemma**: In exercise 10, it's shown that
$\forall n \in \mathbb{Z}^+ (R^n = \{ (a,b) \in A \times A \mid \text{$\exists$$R$-path from $a$ to $b$ of length $n$}\})$.
**Theorem**: $\forall n \in \mathbb{Z}^+ (R^n \setminus i\_A \subseteq S\_n)$.
**Proof**:
Suppose arbitrary $n \in \mathbb{Z}^+$.
Suppose arbi... |
3,331,565 | >
> Suppose
>
> $R$ is a relation on set $A$.
>
> $S$ is the transitive closure of $R$.
>
> $\forall n \in \mathbb{Z}^+ (J\_n = \{0,1,2,\dots, n\})$.
>
>
> Let $a,b \in A$.
>
> $f: J\_n \rightarrow A$ is an $R$-path from $a$ to $b$ of length $n$ if
> $f(0)=a \land f(n)=b \land \forall i < n (f(i), f(i+... | 2019/08/23 | [
"https://math.stackexchange.com/questions/3331565",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/595208/"
] | You can do this without induction.
Hint: Problem 10 shows that $(a,b)\in R^n$ iff there is an $R$-path of length $n$ from $a$ to $b$. (You would need induction to prove this.) So, given such a path, can you show that there is a *simple* $R$-path from $a$ to $b$ with length at most $n$? | In induction step we assume that $$(a,c) \in R^{n+1}\setminus i\_A \iff (a,c) \in R \circ R^n \land a \neq c,$$ so we can have some $b \in A$, such that $(a,b) \in R^n$ and $(b,c) \in R$.
Thus by the inductive hypothesis there is simple R-path of at most length n from a to b and simple R-path of at most length 1 fro... |
3,331,565 | >
> Suppose
>
> $R$ is a relation on set $A$.
>
> $S$ is the transitive closure of $R$.
>
> $\forall n \in \mathbb{Z}^+ (J\_n = \{0,1,2,\dots, n\})$.
>
>
> Let $a,b \in A$.
>
> $f: J\_n \rightarrow A$ is an $R$-path from $a$ to $b$ of length $n$ if
> $f(0)=a \land f(n)=b \land \forall i < n (f(i), f(i+... | 2019/08/23 | [
"https://math.stackexchange.com/questions/3331565",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/595208/"
] | **Lemma**: In exercise 10, it's shown that
$\forall n \in \mathbb{Z}^+ (R^n = \{ (a,b) \in A \times A \mid \text{$\exists$$R$-path from $a$ to $b$ of length $n$}\})$.
**Theorem**: $\forall n \in \mathbb{Z}^+ (R^n \setminus i\_A \subseteq S\_n)$.
**Proof**:
Suppose arbitrary $n \in \mathbb{Z}^+$.
Suppose arbi... | In induction step we assume that $$(a,c) \in R^{n+1}\setminus i\_A \iff (a,c) \in R \circ R^n \land a \neq c,$$ so we can have some $b \in A$, such that $(a,b) \in R^n$ and $(b,c) \in R$.
Thus by the inductive hypothesis there is simple R-path of at most length n from a to b and simple R-path of at most length 1 fro... |
21,381,525 | I am using codebird to auto tweet to twitter.
I am OK with tweeting, as below:
```
require_once ('src/codebird.php');
\Codebird\Codebird::setConsumerKey('YOURKEY', 'YOURSECRET');
$cb = \Codebird\Codebird::getInstance();
$cb->setToken('YOURTOKEN', 'YOURTOKENSECRET');
$reply = $cb->statuses_update('status=Whohoo, I ju... | 2014/01/27 | [
"https://Stackoverflow.com/questions/21381525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3240429/"
] | With a return value.. you negate that with `!`
```
var x=!function(){return false}();
console.log(x);
// true
```
double negation
```
var pizza='pizza';
var x=!!function(){return pizza}();
console.log(x);
// true
// returns true if pizza is defined, not 'pizza'
// returns false if pizza is ''.
```
**demo**
<ht... | Pretty much as with any other thing. The anonymous function is autoexecuted, therefore returns a value, and the value is negated. |
62,649,396 | I have this code:
```
jira_regex = re.compile("^[A-Z][A-Z0-9]+-[0-9]+")
with open(ticket_file, 'r') as f:
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
`ticket_file` contains this:
```
PRJ1-2333
PRJ1-2333
PRJ1-2333
PRJ2-2333
PRJ2-2333
MISC-5002
... | 2020/06/30 | [
"https://Stackoverflow.com/questions/62649396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862601/"
] | You can use a [set](https://docs.python.org/3/tutorial/datastructures.html#sets):
---------------------------------------------------------------------------------
* Sets can only contain unique values
+ I've used `set(...)` to be explicit, but `set(...)` can be replace with `{...}`.
+ This implementation builds a g... | >
> Why is word not in tickets condition not eliminating duplicates?
>
>
>
It is because the variable `tickets` does not exist yet until the list comprehension is finished.
You can do a `set comprehension` like this (not tested):
```
tickets = {word for line in f for word in line.split() if jira_regex.match(word... |
62,649,396 | I have this code:
```
jira_regex = re.compile("^[A-Z][A-Z0-9]+-[0-9]+")
with open(ticket_file, 'r') as f:
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
`ticket_file` contains this:
```
PRJ1-2333
PRJ1-2333
PRJ1-2333
PRJ2-2333
PRJ2-2333
MISC-5002
... | 2020/06/30 | [
"https://Stackoverflow.com/questions/62649396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862601/"
] | You can use a [set](https://docs.python.org/3/tutorial/datastructures.html#sets):
---------------------------------------------------------------------------------
* Sets can only contain unique values
+ I've used `set(...)` to be explicit, but `set(...)` can be replace with `{...}`.
+ This implementation builds a g... | Why is **word not in tickets** condition not eliminating duplicates? This is not working because when you are using
```
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
This is a list comprehension & hence will assign value to variable 'tickets' after rea... |
62,649,396 | I have this code:
```
jira_regex = re.compile("^[A-Z][A-Z0-9]+-[0-9]+")
with open(ticket_file, 'r') as f:
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
`ticket_file` contains this:
```
PRJ1-2333
PRJ1-2333
PRJ1-2333
PRJ2-2333
PRJ2-2333
MISC-5002
... | 2020/06/30 | [
"https://Stackoverflow.com/questions/62649396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862601/"
] | You can use a [set](https://docs.python.org/3/tutorial/datastructures.html#sets):
---------------------------------------------------------------------------------
* Sets can only contain unique values
+ I've used `set(...)` to be explicit, but `set(...)` can be replace with `{...}`.
+ This implementation builds a g... | I'm assuming you predefined `tickets` in your code.
The reason the `if` statement is not working is because although you are adding more and more values into `tickets`, the `tickets` in your `if` statement will always be empty, so `word` is always not in.
I believe this is what you are trying to do:
```
jira_rege... |
62,649,396 | I have this code:
```
jira_regex = re.compile("^[A-Z][A-Z0-9]+-[0-9]+")
with open(ticket_file, 'r') as f:
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
`ticket_file` contains this:
```
PRJ1-2333
PRJ1-2333
PRJ1-2333
PRJ2-2333
PRJ2-2333
MISC-5002
... | 2020/06/30 | [
"https://Stackoverflow.com/questions/62649396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862601/"
] | >
> Why is word not in tickets condition not eliminating duplicates?
>
>
>
It is because the variable `tickets` does not exist yet until the list comprehension is finished.
You can do a `set comprehension` like this (not tested):
```
tickets = {word for line in f for word in line.split() if jira_regex.match(word... | Why is **word not in tickets** condition not eliminating duplicates? This is not working because when you are using
```
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
This is a list comprehension & hence will assign value to variable 'tickets' after rea... |
62,649,396 | I have this code:
```
jira_regex = re.compile("^[A-Z][A-Z0-9]+-[0-9]+")
with open(ticket_file, 'r') as f:
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
`ticket_file` contains this:
```
PRJ1-2333
PRJ1-2333
PRJ1-2333
PRJ2-2333
PRJ2-2333
MISC-5002
... | 2020/06/30 | [
"https://Stackoverflow.com/questions/62649396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6862601/"
] | I'm assuming you predefined `tickets` in your code.
The reason the `if` statement is not working is because although you are adding more and more values into `tickets`, the `tickets` in your `if` statement will always be empty, so `word` is always not in.
I believe this is what you are trying to do:
```
jira_rege... | Why is **word not in tickets** condition not eliminating duplicates? This is not working because when you are using
```
tickets = [word for line in f for word in line.split() if jira_regex.match(word) and word not in tickets]
```
This is a list comprehension & hence will assign value to variable 'tickets' after rea... |
1,178,269 | Let $AB$ be an interval such that its length |AB| is an exponential random variable. Let choose independently two uniformly random points $C,D$ in $AB$. Which is the distribution of the length $|CD|$? | 2015/03/06 | [
"https://math.stackexchange.com/questions/1178269",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/221498/"
] | Let's denote the length $|AB|$ by $L$. $L$ is exponentially distributed, and without loss of generality, we can take the parameter of that exponential distribution to be 1. (If it's something other than 1, we can always rescale the final result to take that into account.) Thus the probability density function (pdf) of ... | **A simulation for the case where the exponential distribution has unit rate (and mean).**
Without loss of generality, it seems the interval can extend from the origin to
a random point $X$ from EXP(1). (So $A = 0$ and $B = X$).
After simulating $X$, one simulates two independent points randomly within $(0, X)$, and ... |
3,202,693 | Suppose we have a group $G$ with commutator subgroup $G'$. I have shown that $G'$ is a normal subgroup of $G$, but I want to show that $G^n$ is also a normal subgroup of $G$. Here we've defined $G^n$ recursively, i.e. $G^n = (G^{n-1})'$.
What I've done so far is: Let $g\in G$ and $x\in G'$. Then by definition $gxg^{-1... | 2019/04/26 | [
"https://math.stackexchange.com/questions/3202693",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let $G''$ be the derived group of $G'$. By definition, $G''$ is the subgroup of $G$ generated by elements of the form $z= xyx^{-1}y^{-1}$, where $x$ and $y$ are in $G'$.
First try to show that $G''$ is normal in $G$. This isn't too hard to do. It suffices to show that if $z$ is one of these generators of $G''$, and $... | Your argument shows that $G^n$ is normal in $G^{n-1}$. We would like to argue that this inductively shows that $G^n$ is normal in $G$. Unfortunately, normality is not transitive, in the sense that if $K$ is normal in $H$ and $H$ is normal in $G$, $K$ may not be normal in $G$.
You should know some stronger property tha... |
3,202,693 | Suppose we have a group $G$ with commutator subgroup $G'$. I have shown that $G'$ is a normal subgroup of $G$, but I want to show that $G^n$ is also a normal subgroup of $G$. Here we've defined $G^n$ recursively, i.e. $G^n = (G^{n-1})'$.
What I've done so far is: Let $g\in G$ and $x\in G'$. Then by definition $gxg^{-1... | 2019/04/26 | [
"https://math.stackexchange.com/questions/3202693",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Here’s a fun way of doing it. Use the following facts
>
> * Any characteristic subgroup of a normal subgroup is normal in the whole group.
> * The derived subgroup is characteristic.
>
>
>
then proceed by induction. | Your argument shows that $G^n$ is normal in $G^{n-1}$. We would like to argue that this inductively shows that $G^n$ is normal in $G$. Unfortunately, normality is not transitive, in the sense that if $K$ is normal in $H$ and $H$ is normal in $G$, $K$ may not be normal in $G$.
You should know some stronger property tha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.