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 |
|---|---|---|---|---|---|
36,538,113 | I am writing an application that integrates with [Smooch](http://smooch.io) and [Carnival](http://carnival.io). Both these libraries receive GCM push messages using the standard approach of defining a GCM Intent Service to receive messages.
When I use only Smooch, everything works great. When I use only Carnival, ever... | 2016/04/11 | [
"https://Stackoverflow.com/questions/36538113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95462/"
] | The reason you can't get push to work in both Carnival and Smooch is that both libraries are registering their own GcmListenerService, and in Android the first GcmListenerService defined in your manifest will receive all GCM messages.
I have a solution for you based primarily off the following SO article:
[Multiple G... | You are using both as gradle dependencies? You will have to download both libraries and use them as modules, they probably are using the same services, if you download them you can change the services name and solve any issue that can be corelating both.
My guess is that you will probably have to create the GCM broadc... |
4,111,737 | Okay, so I'm not sure at all what is going on here. I just got my MAC, and I am trying to download and install setuptools, so I can download different python packages (using easy\_install). So, following the instructions here (http://pypi.python.org/pypi/setuptools):
1. I currently have version 2.6
2. I downloaded the... | 2010/11/06 | [
"https://Stackoverflow.com/questions/4111737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/487588/"
] | **edit Try this from a command line**
Here is an easier thing to do that might work better for you. Open a terminal (Applications->Utilities->Terminal) and run this as a shell script. You can also run the individual commands.
```
#!/bin/sh
cd ~
# Downloads python setuptools for 2.6
curl -o setuptools-0.6c11-py2.6.e... | Try this
```
mv setuptools-0.6c11-py2.6.egg.sh setuptools-0.6c11-py2.6.egg
sh setuptools-0.6c11-py2.6.egg
``` |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | Visual Studio atleast has a [hidden compiler option](http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n) `/d1reportSingleClassLayout` (starting at ~32:00).
Usage: `/d1reportSingleClassLayoutCLASSNAME` where there shall be no whitespace between the compiler switch and `CLASSNAME... | The best way is probably writing a few simple test cases and then compile and debug them in assembler (all optimization off): running one instruction at a time you'll see where everything fits.
At least that's the way I learned it.
And if you find any case particularly challenging, post in in SO! |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | One way is to print out the offsets of all the members:
```
class Parent{
public:
int a;
int b;
virtual void foo(){
cout << "parent" << endl;
}
};
class Child : public Parent{
public:
int c;
int d;
virtual void foo(){
cout << "child" << endl;
}
};
int main(){
Pa... | Visual Studio atleast has a [hidden compiler option](http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n) `/d1reportSingleClassLayout` (starting at ~32:00).
Usage: `/d1reportSingleClassLayoutCLASSNAME` where there shall be no whitespace between the compiler switch and `CLASSNAME... |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | Visual Studio atleast has a [hidden compiler option](http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n) `/d1reportSingleClassLayout` (starting at ~32:00).
Usage: `/d1reportSingleClassLayoutCLASSNAME` where there shall be no whitespace between the compiler switch and `CLASSNAME... | As long as you stick to single inheritance, the subobjects are typically layed out in the order they are declared. A pointer is prepended to they type information at the front which is e.g. used for dynamic dispatch. Once multiple inheritance is incolved things become more complex, especially when virtual inheritance i... |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | Visual Studio atleast has a [hidden compiler option](http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-3-of-n) `/d1reportSingleClassLayout` (starting at ~32:00).
Usage: `/d1reportSingleClassLayoutCLASSNAME` where there shall be no whitespace between the compiler switch and `CLASSNAME... | Create an object of class, cast pointer to it to your machine's word, use `sizeof` to find the size of the object, and examine the memory at the location. Something like this:
```
#include <iostream>
class A
{
public:
unsigned long long int mData;
A() :
mData( 1 )
{
}
virtual ~A()
{
}
};
class... |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | One way is to print out the offsets of all the members:
```
class Parent{
public:
int a;
int b;
virtual void foo(){
cout << "parent" << endl;
}
};
class Child : public Parent{
public:
int c;
int d;
virtual void foo(){
cout << "child" << endl;
}
};
int main(){
Pa... | The best way is probably writing a few simple test cases and then compile and debug them in assembler (all optimization off): running one instruction at a time you'll see where everything fits.
At least that's the way I learned it.
And if you find any case particularly challenging, post in in SO! |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | Create an object of class, cast pointer to it to your machine's word, use `sizeof` to find the size of the object, and examine the memory at the location. Something like this:
```
#include <iostream>
class A
{
public:
unsigned long long int mData;
A() :
mData( 1 )
{
}
virtual ~A()
{
}
};
class... | The best way is probably writing a few simple test cases and then compile and debug them in assembler (all optimization off): running one instruction at a time you'll see where everything fits.
At least that's the way I learned it.
And if you find any case particularly challenging, post in in SO! |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | One way is to print out the offsets of all the members:
```
class Parent{
public:
int a;
int b;
virtual void foo(){
cout << "parent" << endl;
}
};
class Child : public Parent{
public:
int c;
int d;
virtual void foo(){
cout << "child" << endl;
}
};
int main(){
Pa... | As long as you stick to single inheritance, the subobjects are typically layed out in the order they are declared. A pointer is prepended to they type information at the front which is e.g. used for dynamic dispatch. Once multiple inheritance is incolved things become more complex, especially when virtual inheritance i... |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | One way is to print out the offsets of all the members:
```
class Parent{
public:
int a;
int b;
virtual void foo(){
cout << "parent" << endl;
}
};
class Child : public Parent{
public:
int c;
int d;
virtual void foo(){
cout << "child" << endl;
}
};
int main(){
Pa... | Create an object of class, cast pointer to it to your machine's word, use `sizeof` to find the size of the object, and examine the memory at the location. Something like this:
```
#include <iostream>
class A
{
public:
unsigned long long int mData;
A() :
mData( 1 )
{
}
virtual ~A()
{
}
};
class... |
8,672,218 | I'm keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.
I know that this is not defined by the c++ language standard. However, is there any easy way to find out how your specific compiler will implement these say by writing some test code?
EDIT:- Using some o... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8672218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1098524/"
] | Create an object of class, cast pointer to it to your machine's word, use `sizeof` to find the size of the object, and examine the memory at the location. Something like this:
```
#include <iostream>
class A
{
public:
unsigned long long int mData;
A() :
mData( 1 )
{
}
virtual ~A()
{
}
};
class... | As long as you stick to single inheritance, the subobjects are typically layed out in the order they are declared. A pointer is prepended to they type information at the front which is e.g. used for dynamic dispatch. Once multiple inheritance is incolved things become more complex, especially when virtual inheritance i... |
58,701,483 | I am trying to use the Java AnyChart data visualization library (<https://github.com/AnyChart/AnyChart-Android>) in my Android app. However, when I try adding the required imports for the app:
```
import com.anychart.AnyChart;
import com.anychart.AnyChartView;
import com.anychart.DataEntry;
import com.anychart.Pie;
im... | 2019/11/04 | [
"https://Stackoverflow.com/questions/58701483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7789984/"
] | You might have missed this part:
a) Add this to the root `build.gradle` at the end of repositories:
```
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
b) Add the dependency to the project `build.gradle`:
```
dependencies {
implementation "com.github.AnyChart... | Typo:
```
import com.anychart.AnyChart;
import com.anychart.AnyChartView;
import com.anychart.DataEntry;
import com.anychart.Pie;
import com.anychart.ValueDataEntry;
```
Solution:
```
import com.anychart.anychart.AnyChart; // Based off of the link
import com.anychart.anychart.AnyChartView; // Based off of the ... |
73,144,659 | Why can't I read the properties using `${ array[a].name }` with For of ?
I made an ex with an array of objects just to simplify the problem diagnosis
```js
const movie = [{
name: "Shrek",
year: 2001
},
{
name: "Shrek 2",
year: 2004
},
{
name: "Shrek Third",
year: 2007
},
{
name:... | 2022/07/27 | [
"https://Stackoverflow.com/questions/73144659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19635802/"
] | As mentioned in the comments, it is pretty easy to obtain in R with `pROC`. You need to convert `val` to a numeric vector first, then you can create the ROC curve, let's call it `cut_roc`:
```
cut_$val <- as.numeric(cut_$val)
library(pROC)
cut_roc <- roc(cut_$ref, cut_$val)
```
Then it's as simple as a call to `coor... | Consider this a comment, not an answer; see the answer by @Calimo instead.
I thought it might be interesting to plot the ROC curve with the "best" thresholds. Unfortunately, as the figure shows, the binary classifier behind this ROC curve doesn't have much discriminative ability at any threshold.
Here is some R code.... |
19,776,159 | For laboratory I need to run android 1.5 emulator. Yes.. Very old version. Does anyone have emulator image or idea how to stimulate it? | 2013/11/04 | [
"https://Stackoverflow.com/questions/19776159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1978482/"
] | In the Android SDK Manager, if you check the "Obsolete" box you'll see the 1.5 SDK is available, not sure if this will get you what you need or not, but it's a start.
 | Got it!
But not sure how, after API 3 instalation and computer reboot or after this file instalation <http://www.filecrop.com/70027503/index.html>
Safety will be first try install 1.5 SDK and reboot computer, othervise check this link by antivirus
 |
34,695,934 | I am trying to make a super basic program that involves a picture and sound popping up every time I click F4. I have the background of the program set to green, because I am going to be using it as a green screen for the picture. I don't have much experience with VB, but since I couldn't find a program to do this on th... | 2016/01/09 | [
"https://Stackoverflow.com/questions/34695934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5365441/"
] | Try this:
```
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.KeyPreview = True 'This enable the key event on the form (me).
End Sub
Private Sub Form1_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Keys.F4 Then Me.BackgroundImage = Image.FromFile("C:... | This is the final code that also includes an audio clip that plays when the key is pressed as well!
```
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.KeyPreview = True 'This enable the key event on the form (me).
End Sub
Private Sub Form1_KeyDown(sender As Obje... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | As far as google is concerned I am pretty sure that the API is deprecated and is not working anymore. you can probably use Yahoo finance api, They have api for csv downloads and via yql.
Refer: <https://code.google.com/p/yahoo-finance-managed/wiki/YahooFinanceAPIs>
As far as realtime is conecrned, I suggest look at y... | I have rebuild my linux script:
```
#!/bin/bash
l="http://finance.yahoo.com/q?s="
a=$l$1
all=$(w3m -dump "$a")
echo "$all" | grep -A 5 'Visitors'
```
No need a tempory file. |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | ```
<?php
class U_Yahoo{
private function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
re... | The pass with yahoo work not. I have create two scripts to get the quote:
Shell script (quote.sh):
```
#!/bin/bash
a=http://finance.yahoo.com/q?s=
u=$a$1
w3m -dump "$u" > sortie.txt
grep -A 5 'Visitors' sortie.txt
```
PHP script (temp.php):
```
<?php
$Q = $_REQUEST['q'];
$output = shell_exec("/bin/sh ./quote.s... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | As far as google is concerned I am pretty sure that the API is deprecated and is not working anymore. you can probably use Yahoo finance api, They have api for csv downloads and via yql.
Refer: <https://code.google.com/p/yahoo-finance-managed/wiki/YahooFinanceAPIs>
As far as realtime is conecrned, I suggest look at y... | The pass with yahoo work not. I have create two scripts to get the quote:
Shell script (quote.sh):
```
#!/bin/bash
a=http://finance.yahoo.com/q?s=
u=$a$1
w3m -dump "$u" > sortie.txt
grep -A 5 'Visitors' sortie.txt
```
PHP script (temp.php):
```
<?php
$Q = $_REQUEST['q'];
$output = shell_exec("/bin/sh ./quote.s... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | check this web this may be what you want(Use it for realtime web application)
<http://express-io.org/>
<http://socket.io/>
Tutorials
<http://blog.nodeknockout.com/post/34243127010/knocking-out-socket-io> | I have rebuild my linux script:
```
#!/bin/bash
l="http://finance.yahoo.com/q?s="
a=$l$1
all=$(w3m -dump "$a")
echo "$all" | grep -A 5 'Visitors'
```
No need a tempory file. |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | check this web this may be what you want(Use it for realtime web application)
<http://express-io.org/>
<http://socket.io/>
Tutorials
<http://blog.nodeknockout.com/post/34243127010/knocking-out-socket-io> | The pass with yahoo work not. I have create two scripts to get the quote:
Shell script (quote.sh):
```
#!/bin/bash
a=http://finance.yahoo.com/q?s=
u=$a$1
w3m -dump "$u" > sortie.txt
grep -A 5 'Visitors' sortie.txt
```
PHP script (temp.php):
```
<?php
$Q = $_REQUEST['q'];
$output = shell_exec("/bin/sh ./quote.s... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | ```
<?php
class U_Yahoo{
private function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
re... | As far as google is concerned I am pretty sure that the API is deprecated and is not working anymore. you can probably use Yahoo finance api, They have api for csv downloads and via yql.
Refer: <https://code.google.com/p/yahoo-finance-managed/wiki/YahooFinanceAPIs>
As far as realtime is conecrned, I suggest look at y... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | ```
<?php
class U_Yahoo{
private function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
re... | well, in your approach, the stock price fetching is triggered by the client (the user's browser). So there is no way to trigger it outside page refresh or AJAX.
However, your server could fetch those data, irrespective of users. Something like:
```
data source <----> your backend server fetching the data ---> your da... |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | well, in your approach, the stock price fetching is triggered by the client (the user's browser). So there is no way to trigger it outside page refresh or AJAX.
However, your server could fetch those data, irrespective of users. Something like:
```
data source <----> your backend server fetching the data ---> your da... | I have rebuild my linux script:
```
#!/bin/bash
l="http://finance.yahoo.com/q?s="
a=$l$1
all=$(w3m -dump "$a")
echo "$all" | grep -A 5 'Visitors'
```
No need a tempory file. |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | ```
<?php
class U_Yahoo{
private function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
re... | I have rebuild my linux script:
```
#!/bin/bash
l="http://finance.yahoo.com/q?s="
a=$l$1
all=$(w3m -dump "$a")
echo "$all" | grep -A 5 'Visitors'
```
No need a tempory file. |
21,180,197 | I have integrated the new google maps api v2 fragment in a view pager. When i move from the map tab(street view screen) to second tab(client detail), a black view shown instend of data into fragment. anyone know about solution.??
ScreenShot:

Code:
... | 2014/01/17 | [
"https://Stackoverflow.com/questions/21180197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1581185/"
] | well, in your approach, the stock price fetching is triggered by the client (the user's browser). So there is no way to trigger it outside page refresh or AJAX.
However, your server could fetch those data, irrespective of users. Something like:
```
data source <----> your backend server fetching the data ---> your da... | The pass with yahoo work not. I have create two scripts to get the quote:
Shell script (quote.sh):
```
#!/bin/bash
a=http://finance.yahoo.com/q?s=
u=$a$1
w3m -dump "$u" > sortie.txt
grep -A 5 'Visitors' sortie.txt
```
PHP script (temp.php):
```
<?php
$Q = $_REQUEST['q'];
$output = shell_exec("/bin/sh ./quote.s... |
12,853 | I want to thank you beforehand for taking your time to read and (hopefully) answer this. My question is a bit ambiguous, so I'll give an example. Let's say I'm playing white, the enemy has castled king-side so his king is on g8, with his rook on f8, and his knight is on f6. Also, he's got his three castle pawns at thei... | 2015/11/17 | [
"https://chess.stackexchange.com/questions/12853",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/8768/"
] | As always with such questions, the correct answer is "It depends on the position!".
For example if your opponent doesn't have an e-pawn, you will create isolated doubled pawns, which are generally quite weak. But in a 4 vs 3 rook endgame, with all pawns on the kingside this structure is actually better for black than... | It's "usually" a good idea to capture a knight in this situation. If possible, you might consider using a rook on f1 to make this capture. The reason is that you have a second rook to control the open file, but only one dark-squared bishop to control the diagonal a1-h8,
It's always a good idea to capture the knight if... |
12,853 | I want to thank you beforehand for taking your time to read and (hopefully) answer this. My question is a bit ambiguous, so I'll give an example. Let's say I'm playing white, the enemy has castled king-side so his king is on g8, with his rook on f8, and his knight is on f6. Also, he's got his three castle pawns at thei... | 2015/11/17 | [
"https://chess.stackexchange.com/questions/12853",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/8768/"
] | As always with such questions, the correct answer is "It depends on the position!".
For example if your opponent doesn't have an e-pawn, you will create isolated doubled pawns, which are generally quite weak. But in a 4 vs 3 rook endgame, with all pawns on the kingside this structure is actually better for black than... | There are a lot of factors which gets counted in situations like this .
1. If you see that there can be a Kingside attack after you break the castle and you have a lot of initiative with the pieces forcing a strong attack on the King .
2. According to the diagram above it might be that you will be closing the centre s... |
14,797,261 | I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
My goal is to load the new data via ajax, but once I have it in the client I am unable to add the new data to the select list.
The code I have ... | 2013/02/10 | [
"https://Stackoverflow.com/questions/14797261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201596/"
] | Igor has come back to me with a way to do this
```
var data=[...];
$().select2({data: function() {return {results:data};}});
/// later
data=[...something else];
// next query select2 will use 'something else' data
``` | The correct format is:
```
.select2("data", {...})
``` |
14,797,261 | I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
My goal is to load the new data via ajax, but once I have it in the client I am unable to add the new data to the select list.
The code I have ... | 2013/02/10 | [
"https://Stackoverflow.com/questions/14797261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201596/"
] | The correct format is:
```
.select2("data", {...})
``` | Here's a way to do it without Ajax. You can view a working example on [codepen](https://codepen.io/lflier/pen/xxWXwpg).
```js
$(document).ready(function() {
$('#groups').select2({
placeholder: "Choose Group",
width: '300px',
});
$('#items').select2({
placeholder: "Choose Item",
width: '300px',
... |
14,797,261 | I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
My goal is to load the new data via ajax, but once I have it in the client I am unable to add the new data to the select list.
The code I have ... | 2013/02/10 | [
"https://Stackoverflow.com/questions/14797261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201596/"
] | Igor has come back to me with a way to do this
```
var data=[...];
$().select2({data: function() {return {results:data};}});
/// later
data=[...something else];
// next query select2 will use 'something else' data
``` | For Select2 v4.x, here is a small [js class](https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31 "gist").
Using this, options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box. And the dependency can be chained.
For example -
```
new Select2Cascade($('... |
14,797,261 | I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
My goal is to load the new data via ajax, but once I have it in the client I am unable to add the new data to the select list.
The code I have ... | 2013/02/10 | [
"https://Stackoverflow.com/questions/14797261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201596/"
] | Igor has come back to me with a way to do this
```
var data=[...];
$().select2({data: function() {return {results:data};}});
/// later
data=[...something else];
// next query select2 will use 'something else' data
``` | Here's a way to do it without Ajax. You can view a working example on [codepen](https://codepen.io/lflier/pen/xxWXwpg).
```js
$(document).ready(function() {
$('#groups').select2({
placeholder: "Choose Group",
width: '300px',
});
$('#items').select2({
placeholder: "Choose Item",
width: '300px',
... |
14,797,261 | I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
My goal is to load the new data via ajax, but once I have it in the client I am unable to add the new data to the select list.
The code I have ... | 2013/02/10 | [
"https://Stackoverflow.com/questions/14797261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201596/"
] | For Select2 v4.x, here is a small [js class](https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31 "gist").
Using this, options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box. And the dependency can be chained.
For example -
```
new Select2Cascade($('... | Here's a way to do it without Ajax. You can view a working example on [codepen](https://codepen.io/lflier/pen/xxWXwpg).
```js
$(document).ready(function() {
$('#groups').select2({
placeholder: "Choose Group",
width: '300px',
});
$('#items').select2({
placeholder: "Choose Item",
width: '300px',
... |
40,612,987 | I have a `UITableView` which looks like this image
.
When I swipe to delete the record, I can remove it perfectly okay from the array in which it is stored, but I am having difficulties in accessing it in Firebase to delete it there.
My Firebase database structure is... | 2016/11/15 | [
"https://Stackoverflow.com/questions/40612987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6912551/"
] | To solve this issue I tried a number of different methods before finally reaching my intended result.
To delete the value, I created a reference to the child node 'userExercises', then ordered it by 'exerciseName' and then .queryEqual(toValue:) the exercise name value which I extracted form the UITableViewCell.
I th... | It's a fairly straightforward process:
In general, a datasource for tableViews is an array. That array is built from dictionaries read from Firebase snapshots - or an array of objects built from the snapshots (recommended).
So here's an example that matches your Firebase structure (this was populated from a single no... |
40,612,987 | I have a `UITableView` which looks like this image
.
When I swipe to delete the record, I can remove it perfectly okay from the array in which it is stored, but I am having difficulties in accessing it in Firebase to delete it there.
My Firebase database structure is... | 2016/11/15 | [
"https://Stackoverflow.com/questions/40612987",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6912551/"
] | Following on from what MHDev has already answered:
```
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
if let exerciseName = exercises[indexPath.row].exerciseName {
let ref = FIRDatabase.d... | It's a fairly straightforward process:
In general, a datasource for tableViews is an array. That array is built from dictionaries read from Firebase snapshots - or an array of objects built from the snapshots (recommended).
So here's an example that matches your Firebase structure (this was populated from a single no... |
62,687,992 | I want to know how to remove space between first and second word. But it should not remove other spaces in the same column. (Using SQL)
It looks like this,
```
No. 378, Bearly Road, Colombo.
```
I want to remove only the space between "No." and "378". After remove it should be like this,
```
No.378, Bearly Road, Co... | 2020/07/02 | [
"https://Stackoverflow.com/questions/62687992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7417632/"
] | NULL records are drawn using the "IS NULL" keyword for comparison. Here is an example how you can get null records
```
with data
as (select 'PLACEHOLDER' as market_concept,'PLACEHOLDER' as range_type
union all
select 'MarketConcept1' as market_concept,'Rangetype1' as range_type
union all
sele... | You can use ISNULL function to consider NULL value same as placeholder.
```sql
SELECT DISTINCT M.MATERIAL,
A.MARKET_CONCEPT,
A.RANGE_TYPE
FROM VW_MRP_ALLOCATION_COMBINED M
JOIN VW_ARTICLE_ATTRIBUTES_COMBINED A ON M.Material = A.Article AND M.SALES_ORGANIZATION = A.SALES_ORGANIZATION
WHERE M.stock_type ... |
62,687,992 | I want to know how to remove space between first and second word. But it should not remove other spaces in the same column. (Using SQL)
It looks like this,
```
No. 378, Bearly Road, Colombo.
```
I want to remove only the space between "No." and "378". After remove it should be like this,
```
No.378, Bearly Road, Co... | 2020/07/02 | [
"https://Stackoverflow.com/questions/62687992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7417632/"
] | I would suggest being explicit:
```
(A.market_concept <> 'PLACEHOLDER' OR A.market_concept IS NULL) AND
(A.RANGE_TYPE <> 'PLACEHOLDER' A.range_type IS NULL) AND
```
Note: This assumes that `'PLACEHOLDER'` is not `NULL`. If that is possible, I would suggest asking a new question, with clear sample data and desired re... | You can use ISNULL function to consider NULL value same as placeholder.
```sql
SELECT DISTINCT M.MATERIAL,
A.MARKET_CONCEPT,
A.RANGE_TYPE
FROM VW_MRP_ALLOCATION_COMBINED M
JOIN VW_ARTICLE_ATTRIBUTES_COMBINED A ON M.Material = A.Article AND M.SALES_ORGANIZATION = A.SALES_ORGANIZATION
WHERE M.stock_type ... |
19,484,587 | I am running Ubuntu 12.04 and emacs 24.3. I have successfully downloaded sage, and sage\_mode. My problem is that when I try to run SAGE in emacs it doesn't load.
When I try to run SAGE with `M-x sage` it will then say: `Run sage (like this): /home/path/to/sage`. I hit enter then everything freezes inside of emacs wit... | 2013/10/21 | [
"https://Stackoverflow.com/questions/19484587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104823/"
] | I'm sorry you're experiencing this.
This sounds like a bug (in sage-mode) that I fixed a while ago in which it would get stuck waiting for the prompt. What version of `sage-mode` are you using? `C-h v sage-mode-version RET`. The latest released version is `0.10` and doesn't have such a bug to the best of my knowledge.... | Check your config WRT to commands prefixes.
"python-" expects python.el
"py-" expects python-mode.el
`(load "python")` loads mode from python.el
It provides 'python
`(load "python-mode")` loads mode from python-mode.el
It provides 'python-mode
BTW the bug linked to doesn't exist in python-mode.el |
49,989,147 | In one of my Scala tests, using `ProcessBuilder`, I fire up 3 Apache Spark streaming applications in separate JVMs. (Two or more Spark streaming applications can not co-exist in the same JVM.) One Spark application processes data and ingests into Apache Kafka, which the other ones read. Moreover the test involves writi... | 2018/04/23 | [
"https://Stackoverflow.com/questions/49989147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/775988/"
] | [`Tests.Setup`](https://www.scala-sbt.org/0.13/docs/Testing.html#Setup+and+Cleanup) can be used to access the classpath within SBT:
```
testOptions in Test += Tests.Setup { classLoader =>
// give Spark classpath via classLoader
}
```
For example, on my machine `Tests.Setup(classLoader => println(classLoader))` gi... | You can get the full `classpath`, to be used in the `ProcessBuilder`'s JVM, from your `sbt` tests, with:
```scala
Thread
.currentThread
.getContextClassLoader
.getParent
.asInstanceOf[java.net.URLClassLoader]
.getURLs
.map(_.getFile)
.mkString(System.getProperty("path.separator"))
``` |
50,439,309 | Using Windows 10 with Spyder IDE running Python 3.5. I am seeing following in the `__init__.py` file complaining about `unable to detect undefined names`:
[](https://i.stack.imgur.com/xRQtR.png)
However, it seems `__init__.py` file is in the same fol... | 2018/05/20 | [
"https://Stackoverflow.com/questions/50439309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1277239/"
] | Your IDE is complaining, not Python. When you do `from simple import *`, you import *everything* exposed by `simple`. This is typically not recommended because it pollutes the global namespace and may implicitly overwrite an existing object.
You get a warning instead of an error because this behavior is not always bad... | I had the same problem,
the asterisk.
I located the modules to call them as indicated by **Blender**
and it was solved
[](https://i.stack.imgur.com/Uo7IE.png)
change the asterisk by the names of the modules
[](https://i.stack.imgu... |
3,496,564 | I've recently started developing flash and have been getting accustomed to the weirdness of flash builder. Fortunately, I've had exposure to eclipse for java development, so I'm at least familiar with things like the project, preference structure and shortcuts.
One issue that I've run into for both the standalone and ... | 2010/08/16 | [
"https://Stackoverflow.com/questions/3496564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115984/"
] | I experienced the same error. Here's my solution:
`Preference` -> `General` -> `Keys`. Then type without quotes: `Open Type` in field where itg states "type filter here". Then select in "When:" In Action Script Mode. And then press "OK".
Its work in MXML and ActionScript. | Customize Perspective -> “Command Groups Availability” -> Unchecked the “Flash Navigation“
This worked for me. Also check after this that the Preferences - keys - are set to defaults. |
37,573,763 | I'm trying to do a shell script that reads from a file from a string A to a B string. The string A I'm sure that is UNIQUE, but the B string is repeated more than one time.
I'm reading from a file that contains a lot of CREATE queries.
each query ends with (my String B)
>
> ); ------------------------
>
>
>
St... | 2016/06/01 | [
"https://Stackoverflow.com/questions/37573763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4225081/"
] | In place of:
```
sed -n "/$FROMSTR/,/$TOSTR/p"
```
use:
```
sed -n "/$FROMSTR/,\${p; /$TOSTR/q}"
```
This prints from the first occurrence of `$FROMSTR` to the last line `$` except that it quits when it sees the first occurrence of `$TOSTR`.
*Aside:* You should be sure that you trust the source of `FROMSTR` and ... | I solved my problem, seems that sed has some problem in managing escape characters (\r\n)
I changed my $TOSTR to ");"
and used a loop.
```
sed -n "/$FROMSTR/{p; :loop n; p; /$TOSTR/q; b loop}" $2 >> $3
```
then i echo the characters that i need after ");"
```
echo -e "\r\n-----------------------------------------... |
309,058 | I have temporary contacts in Skype that I want to remove when I no longer need them. So, if I just delete the user via `Remove from Contacts` option, will he be able to see me in his contacts after I delete him?
If this is true, then I guess option `Block User` (without checking `Report Abuse`) is the right way to co... | 2011/07/11 | [
"https://superuser.com/questions/309058",
"https://superuser.com",
"https://superuser.com/users/74014/"
] | Removing the user will prevent them from continuing to see your status, but they will still be able to message you, or re-request authorization - they just will have no idea when you are online. In the vast majority of cases, this is the best option, and if your privacy preferences are set to only allow calls/messages ... | From main menu go to Contacts choose 'Advanced',choose 'Backup contacts to file'.
Make sure the Backup has extension .vcf.Do not block,just remove contacts,you are reluctant to deal with for an hour or few.Hold you Skype open for as long as you want.
You are seen only by wanted people.For unwanted you look like you d... |
309,058 | I have temporary contacts in Skype that I want to remove when I no longer need them. So, if I just delete the user via `Remove from Contacts` option, will he be able to see me in his contacts after I delete him?
If this is true, then I guess option `Block User` (without checking `Report Abuse`) is the right way to co... | 2011/07/11 | [
"https://superuser.com/questions/309058",
"https://superuser.com",
"https://superuser.com/users/74014/"
] | Removing the user will prevent them from continuing to see your status, but they will still be able to message you, or re-request authorization - they just will have no idea when you are online. In the vast majority of cases, this is the best option, and if your privacy preferences are set to only allow calls/messages ... | 1. Log into your <https://people.live.com/> account
2. Chose the unnamed or odd contact that you can-not delete
3. Hover and choose “add to Skype”
4. Choose allow
5. On the skype page choose unblock if needed
6. Give the contact a name like “xyz”
7. Go through your entire list of unnamed contacts this way
8. When all o... |
309,058 | I have temporary contacts in Skype that I want to remove when I no longer need them. So, if I just delete the user via `Remove from Contacts` option, will he be able to see me in his contacts after I delete him?
If this is true, then I guess option `Block User` (without checking `Report Abuse`) is the right way to co... | 2011/07/11 | [
"https://superuser.com/questions/309058",
"https://superuser.com",
"https://superuser.com/users/74014/"
] | From main menu go to Contacts choose 'Advanced',choose 'Backup contacts to file'.
Make sure the Backup has extension .vcf.Do not block,just remove contacts,you are reluctant to deal with for an hour or few.Hold you Skype open for as long as you want.
You are seen only by wanted people.For unwanted you look like you d... | 1. Log into your <https://people.live.com/> account
2. Chose the unnamed or odd contact that you can-not delete
3. Hover and choose “add to Skype”
4. Choose allow
5. On the skype page choose unblock if needed
6. Give the contact a name like “xyz”
7. Go through your entire list of unnamed contacts this way
8. When all o... |
621,244 | If a CMB photon traveled for 13.7 billion years (- 374,000 years) to reach me.
How far away was the source of that CMB photon when it first emitted it?
My attempt to solve this question was to use the following assumptions:
1. Temperature of CMB photon today is 2.725 K (will use value of 3 K here)
2. Temperature of C... | 2021/03/15 | [
"https://physics.stackexchange.com/questions/621244",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/84727/"
] | The comoving distance traveled by light in vacuum between cosmological times $t\_i$ and $t\_f$ is $\displaystyle \int\_{t\_i}^{t\_f} \frac{c\,dt}{a(t)}$. The metric distance at cosmological time $t$ is $a(t)$ times the comoving distance. The distance you're looking for is therefore $\displaystyle \int\_{t\_i}^{t\_f} \f... | The light was emitted 367.000 years after the big bang from the edge of the universe. So The distance to where you now are at that epoch was 367.000 lightyears. |
621,244 | If a CMB photon traveled for 13.7 billion years (- 374,000 years) to reach me.
How far away was the source of that CMB photon when it first emitted it?
My attempt to solve this question was to use the following assumptions:
1. Temperature of CMB photon today is 2.725 K (will use value of 3 K here)
2. Temperature of C... | 2021/03/15 | [
"https://physics.stackexchange.com/questions/621244",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/84727/"
] | The comoving distance traveled by light in vacuum between cosmological times $t\_i$ and $t\_f$ is $\displaystyle \int\_{t\_i}^{t\_f} \frac{c\,dt}{a(t)}$. The metric distance at cosmological time $t$ is $a(t)$ times the comoving distance. The distance you're looking for is therefore $\displaystyle \int\_{t\_i}^{t\_f} \f... | "13.7 million light years away from me when it first emitted the photon?"
Based on your assumptions, this is sort-of correct. There are two not-quite-correct details.
(1) The temperature you assune for the production of the CMBR is corrected in the comment by benrg.
(2) The "me" was not present in the univese when the ... |
621,244 | If a CMB photon traveled for 13.7 billion years (- 374,000 years) to reach me.
How far away was the source of that CMB photon when it first emitted it?
My attempt to solve this question was to use the following assumptions:
1. Temperature of CMB photon today is 2.725 K (will use value of 3 K here)
2. Temperature of C... | 2021/03/15 | [
"https://physics.stackexchange.com/questions/621244",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/84727/"
] | "13.7 million light years away from me when it first emitted the photon?"
Based on your assumptions, this is sort-of correct. There are two not-quite-correct details.
(1) The temperature you assune for the production of the CMBR is corrected in the comment by benrg.
(2) The "me" was not present in the univese when the ... | The light was emitted 367.000 years after the big bang from the edge of the universe. So The distance to where you now are at that epoch was 367.000 lightyears. |
33,230,901 | I'm maintaining a webshop and would like to use seo friendly urls.
I have everything set and it works which is nice.
But the webshop is about tires and i have a few tires using a / in the name like this:
```
1000/50R25
```
As it isn't possible (well i assume?) to use this name in the url what would be the best way t... | 2015/10/20 | [
"https://Stackoverflow.com/questions/33230901",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2724940/"
] | First a disclaimer: no one will ever have a definitive answer of what is or isn't SEO friendly. That said, here's some hint.
The direct approach is to url\_encode each part of the friendly URL. In your example, you can decide that an URL is defined as `http://example.nl/tires/<vendor>/<measure>` so you url encode each... | since not much details provided on how the seo friendly urls is done, so I'm assuming all the seo friendly url is like this:
```
http://domain.com/product/tires/michelin/size/205/40/17Z
```
and assuming you have product.php file mapped to read the request. you can simply have some code to read the REQUEST\_URI
```
... |
9,677 | I recently started my three and a half year old at karate, because he had a great time at a bring a friend day.
I feel that I have an active child, but he seems to be no more active than other little boys his age. His class is for 3 to 5-year-olds. Today in class the instructor had to speak to him several times about... | 2020/02/14 | [
"https://martialarts.stackexchange.com/questions/9677",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/10643/"
] | I'll answer this question from the perspective of a dad and a former martial arts instructor.
Your kid is like a lot of other kids it sounds like. It's normal at this age (3 years old) for kids to not be able to concentrate and do what they're told for extended periods of time. A good teacher has to be able to get the... | I'd like to preface anything that I say with the caveat that we are not present in your school, and we don't know the policy of the head instructor/school owner when it comes to things like taking away belts and other disciplinary actions. I am also speaking as a high ranking black belt, and a father of two boys (5 1/2... |
191,572 | [33](https://github.com/TheOnlyMrCat/33) is a simple esolang I created. You may have seen me use it in a few questions. You're not going to be writing a full interpreter. The interpreter you will be writing is for a simplified version of 33.
This simplified 33 has two numeric registers: the accumulator and the counter... | 2019/09/10 | [
"https://codegolf.stackexchange.com/questions/191572",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/77338/"
] | [JavaScript (Node.js)](https://nodejs.org), 264 bytes
=====================================================
```javascript
S=>I=>[...S].map(s=>K?K=0:1/s?C=+(C+s):eval("A*=C;[A,C]=[C,A];K=!A;;K=A;K=A>0;A%=C;K=A<=0;A=A/C|0;I=I.replace(/-?\\d+/,n=>(A=+n,''));K=A>=0;O+=A;K=A<0;A+=C;C=0;;[A]=B(I[0]),I=I.slice(1);O+=`\n`;O+=... | ### Lua 5.3, 342 bytes
Code is provided as a cmdline argument, input is provided via stdin.
```lua
H=string.char R=io.read A=0 C=0 i=1 s=...while i<=#s do
b=s:byte(i)d=H(b)i=i+(({H=A<0,G=A>0,N=A==0,g=A<=0,h=A>=0,n=A~=0})[d]and 2or
1)io.write(({i='\n',o=A|0,p=H(A%255)})[d]or'')A,C=d=='O'and R'n'or d=='P'and
R(1):byte(... |
191,572 | [33](https://github.com/TheOnlyMrCat/33) is a simple esolang I created. You may have seen me use it in a few questions. You're not going to be writing a full interpreter. The interpreter you will be writing is for a simplified version of 33.
This simplified 33 has two numeric registers: the accumulator and the counter... | 2019/09/10 | [
"https://codegolf.stackexchange.com/questions/191572",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/77338/"
] | [JavaScript (Node.js)](https://nodejs.org), 264 bytes
=====================================================
```javascript
S=>I=>[...S].map(s=>K?K=0:1/s?C=+(C+s):eval("A*=C;[A,C]=[C,A];K=!A;;K=A;K=A>0;A%=C;K=A<=0;A=A/C|0;I=I.replace(/-?\\d+/,n=>(A=+n,''));K=A>=0;O+=A;K=A<0;A+=C;C=0;;[A]=B(I[0]),I=I.slice(1);O+=`\n`;O+=... | [Julia 1.0](http://julialang.org/), 355 bytes
=============================================
```julia
p=print
function f(s,a=0,c=0,i=1)
for x=s
z=findfirst(==(x),"amxdrzcpoiPOnNgGhH0123456789")
y=z-9
i<1&&(i=1;continue)
z<6 ? a=(+,-,*,÷,%)[z](a,c) :
z<7 ? c=0 :
z<8 ? ((a,c)=(c,a)) :
z<9 ? p(Char(a)) :
y<1 ? p(a) :
y<2 ... |
51,389,792 | I have a table that is a combination of 4 things.
```
place1 <- c("Florida", "California", "Georgia")
race1 <- c("NHW", "NHB", "Hisp")
race2 <- c("NHW", "NHB", "Hisp")
cancer <- c("Lung", "Liver", "Thyroid")
combos <- expand.grid(place1, race1, race2, cancer, stringsAsFactors = FALSE)
names(combos) <- c("place1", "ra... | 2018/07/17 | [
"https://Stackoverflow.com/questions/51389792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9835261/"
] | using `tidyverse`:
```
library(tidyverse)
combos %>%
mutate(place2 = map(place1,list,"USA","France")) %>%
unnest
# place1 race1 race2 cancer place2
# 1 Florida NHW NHW Lung Florida
# 2 Florida NHW NHW Lung USA
# 3 Florida NHW NHW Lung France
# 4 Cali... | A simple way could be by using combination of `cbind` and `rbind` as:
```
rbind(cbind(combos, place2 = combos$place1),
cbind(combos, place2 = "USA"),
cbind(combos, place2 = "France"))
# place1 race1 race2 cancer place2
# 1 Florida NHW NHW Lung Florida
# 2 California NHW NHW ... |
51,389,792 | I have a table that is a combination of 4 things.
```
place1 <- c("Florida", "California", "Georgia")
race1 <- c("NHW", "NHB", "Hisp")
race2 <- c("NHW", "NHB", "Hisp")
cancer <- c("Lung", "Liver", "Thyroid")
combos <- expand.grid(place1, race1, race2, cancer, stringsAsFactors = FALSE)
names(combos) <- c("place1", "ra... | 2018/07/17 | [
"https://Stackoverflow.com/questions/51389792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9835261/"
] | Just with base R:
```
# add columns
new_vals = c("USA", "France")
result = rbind(
merge(combos, data.frame(place2 = new_vals), all = TRUE),
transform(combos, place2 = place1)
)
# order result rows and columns
with(result, result[order(place1, race1, race2, cancer, place2), c("place1", "place2", "race1", "race2", ... | A simple way could be by using combination of `cbind` and `rbind` as:
```
rbind(cbind(combos, place2 = combos$place1),
cbind(combos, place2 = "USA"),
cbind(combos, place2 = "France"))
# place1 race1 race2 cancer place2
# 1 Florida NHW NHW Lung Florida
# 2 California NHW NHW ... |
51,389,792 | I have a table that is a combination of 4 things.
```
place1 <- c("Florida", "California", "Georgia")
race1 <- c("NHW", "NHB", "Hisp")
race2 <- c("NHW", "NHB", "Hisp")
cancer <- c("Lung", "Liver", "Thyroid")
combos <- expand.grid(place1, race1, race2, cancer, stringsAsFactors = FALSE)
names(combos) <- c("place1", "ra... | 2018/07/17 | [
"https://Stackoverflow.com/questions/51389792",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9835261/"
] | using `tidyverse`:
```
library(tidyverse)
combos %>%
mutate(place2 = map(place1,list,"USA","France")) %>%
unnest
# place1 race1 race2 cancer place2
# 1 Florida NHW NHW Lung Florida
# 2 Florida NHW NHW Lung USA
# 3 Florida NHW NHW Lung France
# 4 Cali... | Just with base R:
```
# add columns
new_vals = c("USA", "France")
result = rbind(
merge(combos, data.frame(place2 = new_vals), all = TRUE),
transform(combos, place2 = place1)
)
# order result rows and columns
with(result, result[order(place1, race1, race2, cancer, place2), c("place1", "place2", "race1", "race2", ... |
3,947,139 | $h\_n(x) = n^2 (e^{x/n} -1 - x/n)$
So I know that the pointwise limit is $x^2/x.$ I found it by using L'hopital's rule (is there a way to show it without using l'hopital's rule?).
I know to show that the convergence is not uniform I need to:
* Find $\epsilon >0$ st $\forall N \in \mathbb{N}, \exists \geq N, x \in \m... | 2020/12/13 | [
"https://math.stackexchange.com/questions/3947139",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/747484/"
] | Let us notice (with the aid of Taylor series) that $h\_n(x) \to \frac{x^2}2$ for any fixed $x$. So, $h\_n(x)$ converges uniformly iff $\sup\_{x} |h\_n(x) - \frac{x^2}2| \to 0$, $n \to \infty$.
But if $x = n$ then $|h\_n(x) - \frac{x^2}2| = |n^2(e - 1 -1 ) - \frac{n^2}2|$ doesn't converge to $0$. Hence, $h\_n(x)$ doesn... | Since$$n^2(e^{x/n}-1-x/n)=x^2/2+x^3/(6n)+o(x^3/n),$$the error term $\sim x^3/(6n)$ exceeds $\epsilon$ for $x\gtrsim\sqrt[3]{6n\epsilon}$. |
1,186,062 | I want to learn it but I have **no** idea where to start. Everything out there suggests reading the `libpurple` source but I don't think I understand enough `c` to really get a grasp of it. | 2009/07/27 | [
"https://Stackoverflow.com/questions/1186062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143596/"
] | There isn't much about it yet... the [intro](http://brunoabinader.blogspot.com/2009/04/introducing-python-purple.html), the [howto](http://developer.pidgin.im/wiki/PythonHowTo), and the [sources](https://git.maemo.org/projects/python-purple/?p=python-purple;a=tree) (here browsing them online but of course you can git c... | Not sure how much help this will be but based on information from [here](http://developer.pidgin.im/wiki/PythonHowTo), it seems like you just install python-purple and import and call the functions as normal Python functions. |
1,186,062 | I want to learn it but I have **no** idea where to start. Everything out there suggests reading the `libpurple` source but I don't think I understand enough `c` to really get a grasp of it. | 2009/07/27 | [
"https://Stackoverflow.com/questions/1186062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143596/"
] | Not sure how much help this will be but based on information from [here](http://developer.pidgin.im/wiki/PythonHowTo), it seems like you just install python-purple and import and call the functions as normal Python functions. | Can't help you with a concrete example as I decided to use something else. However, one of the first things I wanted to do after I cloned the repo was remove the ecore dependency. Here's a patch submitted to the mailing list to do just that: <https://garage.maemo.org/pipermail/python-purple-devel/2009-March/000000.html... |
1,186,062 | I want to learn it but I have **no** idea where to start. Everything out there suggests reading the `libpurple` source but I don't think I understand enough `c` to really get a grasp of it. | 2009/07/27 | [
"https://Stackoverflow.com/questions/1186062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143596/"
] | There isn't much about it yet... the [intro](http://brunoabinader.blogspot.com/2009/04/introducing-python-purple.html), the [howto](http://developer.pidgin.im/wiki/PythonHowTo), and the [sources](https://git.maemo.org/projects/python-purple/?p=python-purple;a=tree) (here browsing them online but of course you can git c... | Can't help you with a concrete example as I decided to use something else. However, one of the first things I wanted to do after I cloned the repo was remove the ecore dependency. Here's a patch submitted to the mailing list to do just that: <https://garage.maemo.org/pipermail/python-purple-devel/2009-March/000000.html... |
15,925,938 | I want to know if there is a way to access the variables set by php using java-script, so that on one page the php variables are set. And then on the next page, i can use java-script to interrogate the PHP file in order to extract the variables, so that they can be displayed on another page?
Thanks in advance! | 2013/04/10 | [
"https://Stackoverflow.com/questions/15925938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2257003/"
] | Not sure if this works, works for my get and post variables
```
var mySessionVariable = "<?php echo $_SESSION['sessionVariable']; ?>";
``` | The only way, you would do it, is by setting cookies from PHP (or Javascript), and access these.. You can access cookies via PHP using `$_COOKIE['var']`, and via Js by, `document.cookie("var")` |
1,031,032 | Hi I had a **jquery** thickbox **modal popu**p on my application. (**iframe**)
Everything works great but I want to set the **focus** to a **specific input fiel**d.
The Iframe loads a normal aspx page so I thought I'd do a $(document).ready(..focus);
I put that script in the IFrame code
However this does n... | 2009/06/23 | [
"https://Stackoverflow.com/questions/1031032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44894/"
] | ThickBox displays the iframe's container by calling a method in the onload event of the iframe element. Since the iframe is hidden on the parent page until after the iframe's content is loaded you cannot set the focus simply using $(document).ready(..focus);. The easiest way I've found to get around this is to use setT... | From docs.jquery.com:
>
> Triggers the focus event of each matched element.
>
>
> This causes all of the functions that have been bound to the focus event to be executed.
> Note that this does not execute the focus method of the underlying elements.
>
>
>
That means, your code should more likely be:
$('#input\_... |
30,137,791 | I am attempting to parse a regex formula in PowerShell and not having any luck. I've created the Regex and have tested it works on RegExr although when I attempt to execute a match query on it it returns no results.
The Regex is looking for any occurrence of a pattern such as below (including the TWO blank line spaces... | 2015/05/09 | [
"https://Stackoverflow.com/questions/30137791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4635139/"
] | You can use the following regular expression:
```
(?m)s*\$\d{1},\d{3},\d{3}\s*(?:\r\n|\r|\n)+\d+.*?, ([A-Z][a-zA-Z]*)\s+\d{4}
```
See [demo](http://regexstorm.net/tester?p=(%3Fm)s*%5C%24%5Cd%7B1%7D%2C%5Cd%7B3%7D%2C%5Cd%7B3%7D%5Cs*(%3F%3A%5Cr%5Cn%7C%5Cr%7C%5Cn)%7B2%7D%5Cd%2B.*%3F%2C%20(%5BA-Z%5D%5Ba-zA-Z%5D*)%5Cs%2B%... | To match newlines you need to match carriage return character as well as new line character in order `\r\n`. So you just need to change `\n\n\n` to `\r\n\r\n\r\n` |
362,229 | I was looking at the man page for the `rm` command on my MacBook and I noticed the the following:
>
> -W Attempt to undelete the named files. Currently, this option can only be used to recover
> files covered by whiteouts.
>
>
>
What does this mean? What is a "whiteout"? | 2017/04/30 | [
"https://unix.stackexchange.com/questions/362229",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/-1/"
] | A whiteout is a special marker file placed by some "see-through" higher-order filesystems (those which use one or more real locations as a basis for their presentation), particularly union filesystems, to indicate that a file that exists in one of the base locations has been deleted within the artificial filesystem eve... | A "whiteout" is a feature of some union filesystem.
If you have a file hierarchy that is overlain by a union mount, and a file exists in both layers of the resulting visible file hierarchy, a "whiteout" may be used to remove the file from the top layer while preserving it in the lower layer (like using Tipp-ex).
The ... |
69,295,963 | I am trying to color the bar plots of the negative values differently. Any pointer to accomplish this is much appreciated. Thanks.
```
import matplotlib.pyplot as plt
import numpy as np
city=['a','b','c','d']
pos = np.arange(len(city))
Effort =[4, 3, -1.5, -3.5]
plt.barh(pos,Effort,color='blue',edgecolor='black')
pl... | 2021/09/23 | [
"https://Stackoverflow.com/questions/69295963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13494561/"
] | This will colour the positive bars as green and the negative as red.
```py
import matplotlib.pyplot as plt
import numpy as np
city=['a','b','c','d']
pos = np.arange(len(city))
Effort =[4, 3, -1.5, -3.5]
colors = ['g' if e >= 0 else 'r' for e in Effort]
plt.barh(pos,Effort,color=colors,edgecolor='black')
plt.yticks(... | Just color a second plot differently:
```py
city = ['a', 'b', 'c', 'd']
pos = np.arange(len(city))
Effort = np.array([4, 3, -1.5, -3.5])
plt.barh(pos[Effort >= 0], Effort[Effort >= 0], color='blue', edgecolor='black') # positive values in blue
plt.barh(pos[Effort < 0], Effort[Effort < 0], color='red', edgecolor='blac... |
6,778,734 | I am trying to use the jQuery-based Wijmo WijMenu control with jqGrid in order to create a dynamic grid toolbar.

Getting the menu to appear works fine. However, my menuitem1 has a submenu, and this submenu falls behind the jqGrid when I hover over '... | 2011/07/21 | [
"https://Stackoverflow.com/questions/6778734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/237808/"
] | It's not a z-index issue. The .ui-jqgrid .ui-userdata has overflow:hidden on it. Try making it overflow: visible.
Although I'm not sure if it will cause problems on the grid when doing this. | Change your CSS from
```
.ui-jqgrid .ui-userdata {
border-left: 0px none;
border-right: 0px none;
height: 21px;
overflow: hidden;
}
.ui-jqgrid .ui-userdata {
border-left: 0px none;
border-right: 0px none;
height: 21px;
}
```
Removing the `overflow:hidden` It was hiding your menu. |
67,570,098 | I need a hidden delete button to appear and work when a input is focused using markup and CSS in Svelte.
I got it all working in browsers for OS X and Raspberry Pi OS (Chrome, Chromium, Safari and Firefox). [Click here to see it](https://2-dos.netlify.app/).
The problem is that the button appears but is not working i... | 2021/05/17 | [
"https://Stackoverflow.com/questions/67570098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14248700/"
] | With a little bit of debugging, it turns out, that by attempting to click on a button, you actually click on a `<div>` element itself:
```js
function setLogs(element) {
element.addEventListener("focus", () => {
console.log("focus", element);
});
element.addEventListener("blur", () => {
console.log("blur... | Here is a solution using "opacity" instead of "visibility" which seems to work also with iOS browsers.
```css
form,
div {
display: flex;
}
form {
width: 100vw;
}
input {
border-style: none;
}
input:focus {
border-style: solid;
}
button {
opacity: 0;
}
#todo1:focus-within button {
opacity: 1;
}
#todo2... |
67,570,098 | I need a hidden delete button to appear and work when a input is focused using markup and CSS in Svelte.
I got it all working in browsers for OS X and Raspberry Pi OS (Chrome, Chromium, Safari and Firefox). [Click here to see it](https://2-dos.netlify.app/).
The problem is that the button appears but is not working i... | 2021/05/17 | [
"https://Stackoverflow.com/questions/67570098",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14248700/"
] | With a little bit of debugging, it turns out, that by attempting to click on a button, you actually click on a `<div>` element itself:
```js
function setLogs(element) {
element.addEventListener("focus", () => {
console.log("focus", element);
});
element.addEventListener("blur", () => {
console.log("blur... | Listen to the `mousedown` event instead of `click` and you'll be able to handle the event before iOS changes focus.
It's more standard practice to trigger an event on `click` but in this case it seems to be the only workaround to iOS's behaviour. |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Based on your logcat messages, looks like the `PackageManagerService` is not even seeing the folder/file changes.
Here is one way to circumvent/trigger a rescan, simulate a a "boot completed" event with broadcast action:
```
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
```
This should trigger... | Here you go:
```
adb shell cmd package compile -f -r first-boot com.yourpackage.name
``` |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Comparing the source code of `PackageManagerService` between KitKat and Lollipop you can see significant changes, and some that are obviously related to this change.
[`PackageManagerService.java` on Lollipop](https://github.com/android/platform_frameworks_base/blob/96b46ebaeec6cc3919513599cce79b4134022cf4/services/cor... | I had the exact same problem.
Turns out when I coped the package back to priv-app it was copied with different permission
Permissions of all packages in priv-app (and app) :
```
rwx-r-x-r-x
```
Permission of the package I copied back :
```
rwx--------
```
A simple `chmod -R a+rw <path/to/package>` solved the pro... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | pms will scan `/system/app(priv-app)` at start. so just kill process `systemserver` :)
it work at my lollipop emulator. just take a little while to showing "upgrade android, opt app..." | I had the exact same problem.
Turns out when I coped the package back to priv-app it was copied with different permission
Permissions of all packages in priv-app (and app) :
```
rwx-r-x-r-x
```
Permission of the package I copied back :
```
rwx--------
```
A simple `chmod -R a+rw <path/to/package>` solved the pro... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | pms will scan `/system/app(priv-app)` at start. so just kill process `systemserver` :)
it work at my lollipop emulator. just take a little while to showing "upgrade android, opt app..." | Here you go:
```
adb shell cmd package compile -f -r first-boot com.yourpackage.name
``` |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | pms will scan `/system/app(priv-app)` at start. so just kill process `systemserver` :)
it work at my lollipop emulator. just take a little while to showing "upgrade android, opt app..." | 1. Push apk to /system/priv-app/
2. Run command: adb shell > su > am restart (using this command you don't loose adb connection)
3. Wait for system boots - install script can wait for clean output of command: "adb shell dumpsys phone"
Snippet:
```
def am_restart(self):
"""Restarts am waits for complete Android bo... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Comparing the source code of `PackageManagerService` between KitKat and Lollipop you can see significant changes, and some that are obviously related to this change.
[`PackageManagerService.java` on Lollipop](https://github.com/android/platform_frameworks_base/blob/96b46ebaeec6cc3919513599cce79b4134022cf4/services/cor... | Here you go:
```
adb shell cmd package compile -f -r first-boot com.yourpackage.name
``` |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Comparing the source code of `PackageManagerService` between KitKat and Lollipop you can see significant changes, and some that are obviously related to this change.
[`PackageManagerService.java` on Lollipop](https://github.com/android/platform_frameworks_base/blob/96b46ebaeec6cc3919513599cce79b4134022cf4/services/cor... | 1. Push apk to /system/priv-app/
2. Run command: adb shell > su > am restart (using this command you don't loose adb connection)
3. Wait for system boots - install script can wait for clean output of command: "adb shell dumpsys phone"
Snippet:
```
def am_restart(self):
"""Restarts am waits for complete Android bo... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Based on your logcat messages, looks like the `PackageManagerService` is not even seeing the folder/file changes.
Here is one way to circumvent/trigger a rescan, simulate a a "boot completed" event with broadcast action:
```
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
```
This should trigger... | 1. Push apk to /system/priv-app/
2. Run command: adb shell > su > am restart (using this command you don't loose adb connection)
3. Wait for system boots - install script can wait for clean output of command: "adb shell dumpsys phone"
Snippet:
```
def am_restart(self):
"""Restarts am waits for complete Android bo... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Based on your logcat messages, looks like the `PackageManagerService` is not even seeing the folder/file changes.
Here is one way to circumvent/trigger a rescan, simulate a a "boot completed" event with broadcast action:
```
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
```
This should trigger... | I had the exact same problem.
Turns out when I coped the package back to priv-app it was copied with different permission
Permissions of all packages in priv-app (and app) :
```
rwx-r-x-r-x
```
Permission of the package I copied back :
```
rwx--------
```
A simple `chmod -R a+rw <path/to/package>` solved the pro... |
26,487,750 | In Android 4.x, it was enough to put an APK-file into /system/priv-app, and the package-manager recognized that new file and (un-)installed the corresponding application or service.
Since Android L, it seems to be not enough to just put the file into that directory - a reboot of the system is required to force Android... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26487750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/164036/"
] | Based on your logcat messages, looks like the `PackageManagerService` is not even seeing the folder/file changes.
Here is one way to circumvent/trigger a rescan, simulate a a "boot completed" event with broadcast action:
```
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
```
This should trigger... | pms will scan `/system/app(priv-app)` at start. so just kill process `systemserver` :)
it work at my lollipop emulator. just take a little while to showing "upgrade android, opt app..." |
64,861,695 | Liquibase was install in the following location
C:\liquibase
when I run the following command on cmd,
```
liquibase
```
I get error
```
the system can not find specified path
```
I added liquibase to system variable
[](https://i.stack.imgur.co... | 2020/11/16 | [
"https://Stackoverflow.com/questions/64861695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8765728/"
] | After deleting JAVA\_HOME variable that was set on user variables, the issue was fixed. See the following image that shows the user and system evironment variables, the user variable that was deleted is indicated surrounded by a red rectangle.
[](http... | You need to add `C:\liquibase` to your `Path` variable in order for `liquibase.bat` file (which is located in `C:\liquibase`) to be accessible from any location. |
59,603,226 | I have this annoying issue with the Cupertino widgets. When I create a super simple app setup (scaffold, navbar, one text item) the text seems to start far outside of the viewport.
heres the example:
```dart
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> c... | 2020/01/05 | [
"https://Stackoverflow.com/questions/59603226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/902327/"
] | The solution that worked for me is wrapping the central `Column` into a `SafeArea` widget ([screenshot](https://imgur.com/PlJJE7u)):
```dart
return CupertinoApp(
home: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Me Title'),
),
// the SafeArea... | I have tried to change the alignment of the child using MainAxisAlignment:
```
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyAppState();
}
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext c... |
48,160,728 | I'm modifying some code to be compatible between `Python 2` and `Python 3`, but have observed a warning in unit test output.
```
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/case.py:601:
ResourceWarning: unclosed socket.socket fd=4,
family=AddressFamily.AF_INET, type=SocketKind.SOCK... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48160728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2233231/"
] | Having the teardown logic in `__del__` can make your program incorrect or harder to reason about, because there is no guarantee on when that method will get called, potentially leading to the warning you got. There are a couple of ways to address this:
1) Expose a method to close the session, and call it in the test `... | This is the best solution if you are not much concern about warnings
Just import **warnings** and add this line where your driver is initiating -
```py
import warnings
warnings.filterwarnings(action="ignore", message="unclosed", category=ResourceWarning)
``` |
319,980 | I'm trying to provide a USB power source to a string of fairy lights that [look like these](https://www.target.com.au/p/twinkle-wire-string-lights-1-m/59361954).
They all appear to run in parallel, connected horizontally along two wires until the last led.
I tried isolating a single led to calculate the forward volta... | 2017/07/23 | [
"https://electronics.stackexchange.com/questions/319980",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/111539/"
] | * The LEDs in the linked picture are white and probably have a forward voltage drop of about 3 to 3.6 V.
* Without any specifications we'll assume they can handle 20 mA.
* On a 5 V supply we need to drop 1.5 to 2 V across the resistor.
* From Ohm's law we can calculate a suitable resistance: \$ R = \frac {V}{I} = \frac... | I got some fairy lights just like the ones you mentioned, and without thinking about it I bought a 3v power supply and just hooked them up. They originally ran on a pair of 2032 batteries. They are slightly brighter on the power supply than on the batteries. There was no resistor in the package.
Another set of fairy l... |
319,980 | I'm trying to provide a USB power source to a string of fairy lights that [look like these](https://www.target.com.au/p/twinkle-wire-string-lights-1-m/59361954).
They all appear to run in parallel, connected horizontally along two wires until the last led.
I tried isolating a single led to calculate the forward volta... | 2017/07/23 | [
"https://electronics.stackexchange.com/questions/319980",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/111539/"
] | The way these fairy lights work is how you described, all in parallel. They typically have a single resistor at the battery box if 3 batteries, or maybe no resistor if 2 batteries. Smarter ones with a timer circuit will still be fairly similar. While transistors answer is correct for finding the forward voltage of a si... | I got some fairy lights just like the ones you mentioned, and without thinking about it I bought a 3v power supply and just hooked them up. They originally ran on a pair of 2032 batteries. They are slightly brighter on the power supply than on the batteries. There was no resistor in the package.
Another set of fairy l... |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | I compared the suggested solution with [perfplot](https://github.com/nschloe/perfplot) and found that nothing beats calling `sin` and `cos` explicitly.
[](https://i.stack.imgur.com/1u9jF.png)
Code to reproduce the plot:
```py
import perfplot
import ... | You can use complex numbers and the fact that *e i · φ = cos(φ) + i · sin(φ)*.
```
import numpy as np
from cmath import rect
nprect = np.vectorize(rect)
x = np.arange(2 * np.pi, step=0.01)
c = nprect(1, x)
a, b = c.imag, c.real
```
I'm using here the trick from <https://stackoverflow.com/a/27788291/674064> to make... |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | For completeness, another way to combine this down to a single `cos()` call is to prepare an angle array where the second half has a phase shift of pi/2.
Borrowing the profiling code from Nico Schlömer, we get:
```
import perfplot
import numpy as np
def sin_cos(x):
return np.sin(x), np.cos(x)
def exp_ix(x):
... | ```
def cosfromsin(x,sinx):
cosx=absolute((1-sinx**2)**0.5)
signx=sign(((x-pi/2)%(2*pi))-pi)
return cosx*signx
a=sin(x)
b=cosfromsin(x,a)
```
I've just timed this and it is about 25% faster than using sin and cos. |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | You can use complex numbers and the fact that *e i · φ = cos(φ) + i · sin(φ)*.
```
import numpy as np
from cmath import rect
nprect = np.vectorize(rect)
x = np.arange(2 * np.pi, step=0.01)
c = nprect(1, x)
a, b = c.imag, c.real
```
I'm using here the trick from <https://stackoverflow.com/a/27788291/674064> to make... | You could take advantage by the fact that tan(x) contains both sin(x) and cos(x) function. So you could use the tan(x) and retrieve cos(x) ans sin(x) using the common transformation function. |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | You can use complex numbers and the fact that *e i · φ = cos(φ) + i · sin(φ)*.
```
import numpy as np
from cmath import rect
nprect = np.vectorize(rect)
x = np.arange(2 * np.pi, step=0.01)
c = nprect(1, x)
a, b = c.imag, c.real
```
I'm using here the trick from <https://stackoverflow.com/a/27788291/674064> to make... | A pure numpy version via complex numbers, *e iφ = cosφ + i sinφ*,
inspired by the answer from [das-g](https://stackoverflow.com/users/674064/das-g).
```
x = np.arange(2 * np.pi, step=0.01)
eix = np.exp(1j*x)
cosx, sinx = eix.real, eix.imag
```
This is faster than the `nprect`, but still slower than `sin` and `cos` ... |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | You can use complex numbers and the fact that *e i · φ = cos(φ) + i · sin(φ)*.
```
import numpy as np
from cmath import rect
nprect = np.vectorize(rect)
x = np.arange(2 * np.pi, step=0.01)
c = nprect(1, x)
a, b = c.imag, c.real
```
I'm using here the trick from <https://stackoverflow.com/a/27788291/674064> to make... | ```
def cosfromsin(x,sinx):
cosx=absolute((1-sinx**2)**0.5)
signx=sign(((x-pi/2)%(2*pi))-pi)
return cosx*signx
a=sin(x)
b=cosfromsin(x,a)
```
I've just timed this and it is about 25% faster than using sin and cos. |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | You can use complex numbers and the fact that *e i · φ = cos(φ) + i · sin(φ)*.
```
import numpy as np
from cmath import rect
nprect = np.vectorize(rect)
x = np.arange(2 * np.pi, step=0.01)
c = nprect(1, x)
a, b = c.imag, c.real
```
I'm using here the trick from <https://stackoverflow.com/a/27788291/674064> to make... | For completeness, another way to combine this down to a single `cos()` call is to prepare an angle array where the second half has a phase shift of pi/2.
Borrowing the profiling code from Nico Schlömer, we get:
```
import perfplot
import numpy as np
def sin_cos(x):
return np.sin(x), np.cos(x)
def exp_ix(x):
... |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | A pure numpy version via complex numbers, *e iφ = cosφ + i sinφ*,
inspired by the answer from [das-g](https://stackoverflow.com/users/674064/das-g).
```
x = np.arange(2 * np.pi, step=0.01)
eix = np.exp(1j*x)
cosx, sinx = eix.real, eix.imag
```
This is faster than the `nprect`, but still slower than `sin` and `cos` ... | ```
def cosfromsin(x,sinx):
cosx=absolute((1-sinx**2)**0.5)
signx=sign(((x-pi/2)%(2*pi))-pi)
return cosx*signx
a=sin(x)
b=cosfromsin(x,a)
```
I've just timed this and it is about 25% faster than using sin and cos. |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | A pure numpy version via complex numbers, *e iφ = cosφ + i sinφ*,
inspired by the answer from [das-g](https://stackoverflow.com/users/674064/das-g).
```
x = np.arange(2 * np.pi, step=0.01)
eix = np.exp(1j*x)
cosx, sinx = eix.real, eix.imag
```
This is faster than the `nprect`, but still slower than `sin` and `cos` ... | You could take advantage by the fact that tan(x) contains both sin(x) and cos(x) function. So you could use the tan(x) and retrieve cos(x) ans sin(x) using the common transformation function. |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | I compared the suggested solution with [perfplot](https://github.com/nschloe/perfplot) and found that nothing beats calling `sin` and `cos` explicitly.
[](https://i.stack.imgur.com/1u9jF.png)
Code to reproduce the plot:
```py
import perfplot
import ... | For completeness, another way to combine this down to a single `cos()` call is to prepare an angle array where the second half has a phase shift of pi/2.
Borrowing the profiling code from Nico Schlömer, we get:
```
import perfplot
import numpy as np
def sin_cos(x):
return np.sin(x), np.cos(x)
def exp_ix(x):
... |
32,397,347 | I need to return the sin and cos values of every element in a large array. At the moment I am doing:
```
a,b=np.sin(x),np.cos(x)
```
where x is some large array. I need to keep the sign information for each result, so:
```
a=np.sin(x)
b=(1-a**2)**0.5
```
is not an option. Is there any faster way to return both si... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5300564/"
] | I compared the suggested solution with [perfplot](https://github.com/nschloe/perfplot) and found that nothing beats calling `sin` and `cos` explicitly.
[](https://i.stack.imgur.com/1u9jF.png)
Code to reproduce the plot:
```py
import perfplot
import ... | You could take advantage by the fact that tan(x) contains both sin(x) and cos(x) function. So you could use the tan(x) and retrieve cos(x) ans sin(x) using the common transformation function. |
222,186 | The description for the AdvAgg bundler says:
>
> If not checked, the bundler will not split up aggregates.
>
>
>
I know that aggregation is merging files together and I take that splitting isn't the opposite of *aggregation*. What is it, then? | 2016/12/05 | [
"https://drupal.stackexchange.com/questions/222186",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/-1/"
] | The short answer is to take advantage of the browser cache. It can also be used to take advantage of the number of parallel connections that the browser can make.
Example:
Front page has a.css and b.css; node 1 has a.css, b.css and c.css. If using one aggregate then the user going from the front page to node 1 would ... | Aggregated bundles can be aggregated in groups. For example, let's say there was some CSS you wanted included in the head tag and other CSS that should be included towards the bottom of your page. In this case there might be two aggregate groups.
In AdvAgg I believe the use-case you really want to look at is for JS mo... |
41,284,153 | At the risk of sounding really dumb, here i go:
Can someone tell me how to verify if a string was entered through the scanner?
I've written some code down below but i'm stuck.
As you'll probably notice, I'm a complete novice.
```
import static java.lang.System.in;
import static java.lang.System.out;
import java.ut... | 2016/12/22 | [
"https://Stackoverflow.com/questions/41284153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7330532/"
] | Have you noticed you are try to run a command with `sudo`, that means the user **www-data** must to be included in the /etc/sudoers file.
I've tried your code, it works if i remove the 'sudo' and if i give permissions in the /www directory.
I think you need to configure the user in the sudoers file.
An example of my... | You can create a directory with PHP without calling out to the shell. PHP has its own [mkdir](http://php.net/manual/en/function.mkdir.php) function.
Replace this line:
```
exec('sudo mkdir /www/test');
```
with this:
```
mkdir("/www/test1", 0700);
```
and do the same for the second mkdir command.
The first ar... |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | 1. Right-click the use case.
2. Select "Show ShapeSheet".
3. Scroll down to the "Protection" section.
4. Change the value near "LockTextEdit" to `0`.
5. Close the ShapeSheet.
Now press `F2` and edit the name. Add line breaks with `Enter`.
It is tedious to unprotect each use case individually. If you are starting a ne... | Try editing the TextBox properties in the object properties dialog. |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use c... | click into the text box and hit enter between the text you want on the next line. |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | **Real text wrap; no bloody carriage returns.**
Visio 2010.
SysML Stencil (source unknown) 'Activity' shape in 'Activity Diagram' shapes collection.
1. If you cannot see the 'Developer' tab on the ribbon:
File > Options > Customize Ribbon > [Select 'Developer' in 'Main Tabs' list]
2. Right-click shape of interest an... | click into the text box and hit enter between the text you want on the next line. |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | In Microsoft Visio 2007 first you need to select your shape, right click it and choose "Format", then "Protection..." and uncheck "Text" checkbox, click OK. This will allow to edit shape text.
When that is done you can select your use case shape, choose "Text Tool" from standard toolbar. Use case text will appear as te... | I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use c... |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | **Real text wrap; no bloody carriage returns.**
Visio 2010.
SysML Stencil (source unknown) 'Activity' shape in 'Activity Diagram' shapes collection.
1. If you cannot see the 'Developer' tab on the ribbon:
File > Options > Customize Ribbon > [Select 'Developer' in 'Main Tabs' list]
2. Right-click shape of interest an... | I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use c... |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | When you wish to edit a shape, you need to unlock the protection attributes applied on the shape. None of the answers here have informed you how to show the "Shape Data".
1. You need to select File menu on the top. Select "Options" and select "Advanced"
2. Scroll down till the end and select "Run in Developer mode". P... | I found that by putting extra spaces in between the words I could get Visio to wrap the text. I had to add enough spaces so that it would push a word beyond the margin of the use case's textbox. Sometimes this would cause a line break between two different words, so I had to add additional spaces elsewhere in the use c... |
4,994,071 | I am making a use case diagram, and the problem is:
I type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...
Thank you in advance!
Nanek | 2011/02/14 | [
"https://Stackoverflow.com/questions/4994071",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/616446/"
] | Procedure for applying Word Wrap:
1. Select from the diagram area an element for which to apply Word Wrap.
2. Right-click and select the [Format] -> [Word Wrap Name] menu.
Perform the steps above once again to removed Word Wrap. | Select the shape.
use this menu: [Home] -> [Tools] -> [Text]
now text editing is available on the shape.
Now by just hitting shift+enter on every place you want to end the line, you can wrap text manually.
Good Luck |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.