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 |
|---|---|---|---|---|---|
56,201,386 | I am trying to update my Android project.
I initially got this error:
>
> ERROR: Gradle DSL method not found: 'classpath()'
> Possible causes:
> The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
> Upgrade plugin to ver... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2885727/"
] | It's going to be easiest for you to use a [callable function](https://firebase.google.com/docs/functions/callable), since that lets you:
1. Automatically send the current user's uid in the request.
2. Know very easily on the function side if a UID was provided in the request, and refuse service if none was provided.
... | ```
import 'package:firebase_messaging/firebase_messaging.dart';
.
.
.
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
@override
Future<void> initState() {
super.initState();
_firebaseMessaging.getToken().then((token) {
assert(token != null);
print("teken is: " + token);
});
}
``` |
56,201,386 | I am trying to update my Android project.
I initially got this error:
>
> ERROR: Gradle DSL method not found: 'classpath()'
> Possible causes:
> The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
> Upgrade plugin to ver... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2885727/"
] | It's going to be easiest for you to use a [callable function](https://firebase.google.com/docs/functions/callable), since that lets you:
1. Automatically send the current user's uid in the request.
2. Know very easily on the function side if a UID was provided in the request, and refuse service if none was provided.
... | Get your token from firebaseAuth and put in a string.
```
Future<Details> getDetails() async {
String bearer = await FirebaseAuth.instance.currentUser!.getIdToken();
print("Bearer: " + bearer.toString());
String token = "Bearer ${bearer}";
var apiUrl = Uri.parse('Your url here');
final response = await http... |
56,201,386 | I am trying to update my Android project.
I initially got this error:
>
> ERROR: Gradle DSL method not found: 'classpath()'
> Possible causes:
> The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
> Upgrade plugin to ver... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2885727/"
] | I agree with @Doug on this one - callable wraps this for you and will be easier -, but my use case required me to make HTTPS calls (`onRequest` in Functions). Also, I think you're just in the correct path - but you're **possibly** not checking it in your Cloud Functions.
In your app, you'll call:
```dart
_httpsCall()... | ```
import 'package:firebase_messaging/firebase_messaging.dart';
.
.
.
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
@override
Future<void> initState() {
super.initState();
_firebaseMessaging.getToken().then((token) {
assert(token != null);
print("teken is: " + token);
});
}
``` |
56,201,386 | I am trying to update my Android project.
I initially got this error:
>
> ERROR: Gradle DSL method not found: 'classpath()'
> Possible causes:
> The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
> Upgrade plugin to ver... | 2019/05/18 | [
"https://Stackoverflow.com/questions/56201386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2885727/"
] | I agree with @Doug on this one - callable wraps this for you and will be easier -, but my use case required me to make HTTPS calls (`onRequest` in Functions). Also, I think you're just in the correct path - but you're **possibly** not checking it in your Cloud Functions.
In your app, you'll call:
```dart
_httpsCall()... | Get your token from firebaseAuth and put in a string.
```
Future<Details> getDetails() async {
String bearer = await FirebaseAuth.instance.currentUser!.getIdToken();
print("Bearer: " + bearer.toString());
String token = "Bearer ${bearer}";
var apiUrl = Uri.parse('Your url here');
final response = await http... |
62,750,012 | I have a Mule 4 flow which connects to a SFTP location to read files, and perform a set of operations.
This works fine when I run the project from Anypoint Studio. However when I deploy this, I see the following error when the projects gets deployed to cloudhub:
**Connectivity test failed for config 'SFTP\_Config'. Ap... | 2020/07/06 | [
"https://Stackoverflow.com/questions/62750012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1982597/"
] | Usually communication will fail from CloudHub when it is a private server, not accessible from the public Internet, or access requires a whitelist from the server side.
You can test if there is network connectivity deploying a test application to perform tests as described here: <https://help.mulesoft.com/s/article/Ne... | Double check that your sftp.host is available from cloud. |
54,291 | Ich habe anderen Diskussionen, die sich auf dieses Thema beziehen, aber Ich habe die Antwort meiner Frage nicht gefunden. Es geht um einem einfachen Zweifel:
Sind die beiden Sätze hierunter austauschbar? Oder haben sie verschiedene Bedeutungen?
"Er macht Urlaub in Spanien, **um** Spanisch **zu** lernen."
vs.
"Er ma... | 2019/09/10 | [
"https://german.stackexchange.com/questions/54291",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/39728/"
] | It seems your (only) problem is the part "*Nichts wie...*".
This is used in a number of phrases in casual oral communication.
Thieves after noticing that they were being spotted by the home owner:
>
> Nix wie weg!
>
>
>
(*Nix* is a popular casual/oral short form of *nichts*)
People in a house that caught ... | It literally means "Nothing (is (as good)) as/like (going) out (of) here". Similar constructs can also be found in English, eg "Nothing like a hot bath now!", or Latin "Nihil nisi...." (nothing if not....).
Alternatively, it could be a contraction of "nichts (zu tun) wie (=als) raus hier (zu gehen)", "nothing (to do) ... |
51,406,540 | I have two matrices, `t1` and `t2`:
```
> t1
aaa bbb ccc ddd
[1,] 1 2 3 4
> t2
e1 e2 e3 e4 e5 e6 e7 e8 e9
[1,] "aaa" "ddd" "aaa" "bbb" "ccc" "bbb" "ddd" "aaa" "ccc"
```
Is there a way to obtain a matrix that replaces the data of `t2` according to the table `t1` without a... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51406540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7064929/"
] | I think you'd be better off using the enum in your match like:
```
SortCountryField withName <your_string> match {
case SortCountryField.countryName => //Some operations
case SortCountryField.countryStatus => //another operation
}
```
If your string sometimes doesn't match any field then you can easily wrap ... | You can also do:
```
'myString' match{
case x if x == SortCountryField.countryName.toString => //Some operations
case x if x == SortCountryField.countryStatus.toString => //another operation
}
``` |
51,406,540 | I have two matrices, `t1` and `t2`:
```
> t1
aaa bbb ccc ddd
[1,] 1 2 3 4
> t2
e1 e2 e3 e4 e5 e6 e7 e8 e9
[1,] "aaa" "ddd" "aaa" "bbb" "ccc" "bbb" "ddd" "aaa" "ccc"
```
Is there a way to obtain a matrix that replaces the data of `t2` according to the table `t1` without a... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51406540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7064929/"
] | I think you'd be better off using the enum in your match like:
```
SortCountryField withName <your_string> match {
case SortCountryField.countryName => //Some operations
case SortCountryField.countryStatus => //another operation
}
```
If your string sometimes doesn't match any field then you can easily wrap ... | How does your implicit converter looks like?
My guess is that you have converter `SortCountryField => String`, but you need `SortCountryField.Value => String` converter. |
51,406,540 | I have two matrices, `t1` and `t2`:
```
> t1
aaa bbb ccc ddd
[1,] 1 2 3 4
> t2
e1 e2 e3 e4 e5 e6 e7 e8 e9
[1,] "aaa" "ddd" "aaa" "bbb" "ccc" "bbb" "ddd" "aaa" "ccc"
```
Is there a way to obtain a matrix that replaces the data of `t2` according to the table `t1` without a... | 2018/07/18 | [
"https://Stackoverflow.com/questions/51406540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7064929/"
] | I think you'd be better off using the enum in your match like:
```
SortCountryField withName <your_string> match {
case SortCountryField.countryName => //Some operations
case SortCountryField.countryStatus => //another operation
}
```
If your string sometimes doesn't match any field then you can easily wrap ... | Add below function in your enum:
```
implicit def toString(value: Value): String = value.toString
```
Use below in matching:
```
val countryStaus:String = SortCountryField.countryStatus
'myString' match {
case `countryStatus` => //Some operations
case _ => // Another operation
}
``` |
23,356,774 | I am struggling with an issue where my company is attempting to white label it's solution. We have a Solution A, inside Repository A like this
```
Repository A
Solution A
Project A
Project B
Project C
Project D
Project E (not shared and dependent on project A/B/C... | 2014/04/29 | [
"https://Stackoverflow.com/questions/23356774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578059/"
] | This is possible! But you know Nuget.org? I think Nuget is the best solution for your case.
In this presentation Scott Hanselman shows how use NuGet as Enteprise solution: [NuGet for the Enterprise: NuGet in a Continuous Integration Automated Build System](http://www.hanselman.com/blog/NuGetForTheEnterpriseNuGetInACont... | Considering only the following clear requirement
>
> Please note we require the actual projects in the solutions not the
> assemblies.
>
>
>
You could just keep one solution - with project E, F, ..., N being the white labeled applications.
Like such:
```
Repository A
Solution A
Project Library ... |
42,332,659 | I am working on an SPA with ReactJS. I have a root component App and then several child components. In the the App component I am trying to store some application level state such as logged in user id, and other data. However I am not seeing my state be propagated down the child components.
App
```
import { Router, ... | 2017/02/19 | [
"https://Stackoverflow.com/questions/42332659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4594940/"
] | Have you checked filenames and permission? file names are case sensitive in Linux (your hosting provider uses it) | You have to change directory permissions at your server. Directories and files within the `storage` and the `bootstrap/cache` directories should be writable (e.g. chmod 777) |
57,792,257 | Morning! So I have a PowerShell server build script that does the following as part of it:
Asks if you want to add an AD group to Administrators on the server you're building, or if you want to search a different server for the groups and users in Administrators and use one of those.
1. If you want to add an AD group... | 2019/09/04 | [
"https://Stackoverflow.com/questions/57792257",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4425426/"
] | If you can add some controls as to how the input is entered, you could split input by `,`. Then process the split items in a loop.
```
$OSAdministrators = Read-Host "Enter the name(s) of the AD group(s) from the list above to add to Administrators on the new server. If entering multiple, separate them with a comma (e.... | if you can use a GUI at that point, this may do what you need ...
```
function Get-LocalAdminList ($ComputerName) {
(Get-CimInstance -ClassName Win32_GroupUser –Computer $ComputerName |
Where-Object {
$_.GroupComponent -match 'administrators'
}).PartComponent.Name
}
$ChosenIte... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | For explicitly export some files into separate output files (in this case **all.min.js** and **all.jquery.js**) use:
```
uglify: {
js: {
files : {
'js/all.min.js' : [
'js/modernizr.js',
'js/vendor/modernizr-2.6.2-respond-1.1.0.min.js',
'js/bootstrap.min.js',
'js/ma... | In an intention to help others who come to this page in future -
I came across a video which explains on how to minify JS files using Grunt JS here: <https://www.youtube.com/watch?v=Gkv7pA0PMJQ>
The source code is made available here: <http://www.techcbt.com/Post/359/Grunt-JS/how-to-minify-uglify-javascript-files-us... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Had the same problem and found a solution that would automatically minify all my scripts separately:
```
uglify: {
build: {
files: [{
expand: true,
src: '**/*.js',
dest: 'build/scripts',
cwd: 'app/scripts'
}]
}
}
``` | This below gruntjs works for me for creating minified files for all the js files under a dir
```
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
files: [{
expand: true,
src: '**... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Had the same problem and found a solution that would automatically minify all my scripts separately:
```
uglify: {
build: {
files: [{
expand: true,
src: '**/*.js',
dest: 'build/scripts',
cwd: 'app/scripts'
}]
}
}
``` | From the grunt docs for min:
>
> This task is a multi task, meaning that grunt will automatically
> iterate over all min targets if a target is not specified.
>
>
>
So you can do this:
```
min: {
min_a: {
src: 'a.js',
dest: 'a.min.js'
},
min_b: {
src: 'b.js',
dest: 'b... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | From the grunt docs for min:
>
> This task is a multi task, meaning that grunt will automatically
> iterate over all min targets if a target is not specified.
>
>
>
So you can do this:
```
min: {
min_a: {
src: 'a.js',
dest: 'a.min.js'
},
min_b: {
src: 'b.js',
dest: 'b... | For explicitly export some files into separate output files (in this case **all.min.js** and **all.jquery.js**) use:
```
uglify: {
js: {
files : {
'js/all.min.js' : [
'js/modernizr.js',
'js/vendor/modernizr-2.6.2-respond-1.1.0.min.js',
'js/bootstrap.min.js',
'js/ma... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Or you can use expandMapping, like this:
```
min: {
files: grunt.file.expandMapping(['path/*.js', 'path2/*.js'], 'destination/', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
}
```
And the output:
path/test.js => destination/pat... | I guess it only matters for watch tasks.
In grunt 0.4 you can do this
```
var filesA = 'a.js', filesB = 'b.js', filesC = 'c.js';
...
min: {
min_a: {
src: filesA,
dest: 'a.min.js'
},
min_b: {
src: filesB,
dest: 'b.min.js'
},
min_c: {
... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Or you can use expandMapping, like this:
```
min: {
files: grunt.file.expandMapping(['path/*.js', 'path2/*.js'], 'destination/', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
}
```
And the output:
path/test.js => destination/pat... | For explicitly export some files into separate output files (in this case **all.min.js** and **all.jquery.js**) use:
```
uglify: {
js: {
files : {
'js/all.min.js' : [
'js/modernizr.js',
'js/vendor/modernizr-2.6.2-respond-1.1.0.min.js',
'js/bootstrap.min.js',
'js/ma... |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | From the grunt docs for min:
>
> This task is a multi task, meaning that grunt will automatically
> iterate over all min targets if a target is not specified.
>
>
>
So you can do this:
```
min: {
min_a: {
src: 'a.js',
dest: 'a.min.js'
},
min_b: {
src: 'b.js',
dest: 'b... | Use the `ext` option to name the files `.min.js` instead of `.js`
```
uglify: {
build: {
files: [{
expand: true,
src: '**/*.js',
dest: 'build/scripts',
cwd: 'app/scripts',
ext: '.min.js'
}]
}
}
``` |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | From the grunt docs for min:
>
> This task is a multi task, meaning that grunt will automatically
> iterate over all min targets if a target is not specified.
>
>
>
So you can do this:
```
min: {
min_a: {
src: 'a.js',
dest: 'a.min.js'
},
min_b: {
src: 'b.js',
dest: 'b... | You also can use copy and [grunt-mindirect](https://github.com/buunguyen/grunt-mindirect).
```
copy: {
dist: {
src: 'a.js',
dest: 'a.min.js'
}
},
minidirect: {
all: 'js/min/*.min.js'
}
```
This should work. |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Use the `ext` option to name the files `.min.js` instead of `.js`
```
uglify: {
build: {
files: [{
expand: true,
src: '**/*.js',
dest: 'build/scripts',
cwd: 'app/scripts',
ext: '.min.js'
}]
}
}
``` | I like to keep the original files and also create uglified ones:
```
uglify: {
dist: {
files: [{
expand: true,
src: '**/*.js',
dest: 'destdir',
cwd: 'srcdir',
rename: function(dest, src) { return dest + '/' + src.replace('.js', '.min.js'); }
}]
}
},
``` |
13,358,680 | there are some js files in static/js/
```
1. a.js
2. b.js
3. c.js
```
how to config grunt.js to get below files:
```
1. a.min.js
2. b.min.js
3. c.min.js
```
as far, I have to type specific file name:
```
min: {
dist: {
src: 'js/**/*.js',
dest: 'js/min/xxx.min.js'
}
}... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13358680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047567/"
] | Or you can use expandMapping, like this:
```
min: {
files: grunt.file.expandMapping(['path/*.js', 'path2/*.js'], 'destination/', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
}
```
And the output:
path/test.js => destination/pat... | You also can use copy and [grunt-mindirect](https://github.com/buunguyen/grunt-mindirect).
```
copy: {
dist: {
src: 'a.js',
dest: 'a.min.js'
}
},
minidirect: {
all: 'js/min/*.min.js'
}
```
This should work. |
692,351 | Say I have a range of files named: "blah-10-blah", "blah-11-blah" etc...up to "blah-30-blah".
I would like to change the names to "blah-20-blah", "blah-21-blah" etc...up to "blah-40-blah".
Is there a way of doing this in the terminal? | 2015/10/31 | [
"https://askubuntu.com/questions/692351",
"https://askubuntu.com",
"https://askubuntu.com/users/465987/"
] | It's important to process the files in an inverse numerical order, otherwise the task will fail due to already existing files with the target filename:
```
find . -maxdepth 1 -type f -name 'blah-??-blah' -print0 | sort -zr | xargs -0 rename 's/-\K([0-9]{2})/$1+10/e'
```
* `find . -maxdepth 1 -type f -name 'blah-??-b... | Basic idea of this approach is to throw all the files into temporary "basket" directory, and then pick them out one by one, create new name , and move back with new name into the original directory.
The script bellow takes a single argument ( $1 ), which is directory where the files you want to rename are located.
... |
692,351 | Say I have a range of files named: "blah-10-blah", "blah-11-blah" etc...up to "blah-30-blah".
I would like to change the names to "blah-20-blah", "blah-21-blah" etc...up to "blah-40-blah".
Is there a way of doing this in the terminal? | 2015/10/31 | [
"https://askubuntu.com/questions/692351",
"https://askubuntu.com",
"https://askubuntu.com/users/465987/"
] | You can do:
```bsh
#!/bin/bash
files=( blah-??-blah )
for ((i=${#files[@]}-1; i>=0; i--)); do
first="${files[$i]%%-*}"
num="$(grep -o '[0-9]\+' <<<"${files[$i]}")"
last="${files##*-}"
echo mv "$first-$num-$last" "$first-$((num+10))-$last"
done
```
If you are satisfied with everything, add `|... | Basic idea of this approach is to throw all the files into temporary "basket" directory, and then pick them out one by one, create new name , and move back with new name into the original directory.
The script bellow takes a single argument ( $1 ), which is directory where the files you want to rename are located.
... |
8,673,016 | I've been trying to build a Terminal Emulator for Android. Being pretty new to this, my idea was to execute each command and store the output in a file, whose contents would be displayed after each execution.
*Pseudo Code :*
```
public Boolean execCommands(String command) {
try {
rt = Runtime.getRu... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8673016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1069405/"
] | Not sure if you are still needing this or not, but here is how I am issuing multiple commands at one time and not using "su" to have them run.
```
try {
String[] commands = {
"dumpstate > /sdcard/LogFiles/dumpstate.txt",
"dumpsys > /sdcard/LogFiles/dumpsys.txt",
"log... | This a bit late but here a few ways of doing this.
1)
Instead of using su as a starting point use /system/bin/sh.
and after calling
```
rt.exec("/system/bin/sh");
```
You should hold onto the Output Stream and Input Stream to give further commands.
After you issued a command you should echo a magic line like "--... |
8,673,016 | I've been trying to build a Terminal Emulator for Android. Being pretty new to this, my idea was to execute each command and store the output in a file, whose contents would be displayed after each execution.
*Pseudo Code :*
```
public Boolean execCommands(String command) {
try {
rt = Runtime.getRu... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8673016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1069405/"
] | Not sure if you are still needing this or not, but here is how I am issuing multiple commands at one time and not using "su" to have them run.
```
try {
String[] commands = {
"dumpstate > /sdcard/LogFiles/dumpstate.txt",
"dumpsys > /sdcard/LogFiles/dumpsys.txt",
"log... | Regarding problem 1:
>
> Each time a command is to be executed, I end up seeking SuperUser permissions (second line of code). And I'd like to do away with this.
>
>
>
Thanks to Xonar's suggestion from another answer:
>
> After you issued a command you should echo a magic line like "---EOF---" and stop reading ... |
8,673,016 | I've been trying to build a Terminal Emulator for Android. Being pretty new to this, my idea was to execute each command and store the output in a file, whose contents would be displayed after each execution.
*Pseudo Code :*
```
public Boolean execCommands(String command) {
try {
rt = Runtime.getRu... | 2011/12/29 | [
"https://Stackoverflow.com/questions/8673016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1069405/"
] | This a bit late but here a few ways of doing this.
1)
Instead of using su as a starting point use /system/bin/sh.
and after calling
```
rt.exec("/system/bin/sh");
```
You should hold onto the Output Stream and Input Stream to give further commands.
After you issued a command you should echo a magic line like "--... | Regarding problem 1:
>
> Each time a command is to be executed, I end up seeking SuperUser permissions (second line of code). And I'd like to do away with this.
>
>
>
Thanks to Xonar's suggestion from another answer:
>
> After you issued a command you should echo a magic line like "---EOF---" and stop reading ... |
57,808,701 | I have setup a cucumber project in java, in my Eclipse IDE I am able to run my feature file directly and the tests will complete. However when I run them as JUnit tests they don't run, in the console they appear as
```
@When("^user navigates to Login Page$")
public void user_navigates_to_Login_Page() throws Throwable... | 2019/09/05 | [
"https://Stackoverflow.com/questions/57808701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3542013/"
] | Set the glue option as `com/bsautoweb/stepdefinitions` or as java package style `com.bsautoweb.stepdefinitions` | Give glue = "com.bsautoweb.stepdefinitions" |
2,543,272 | >
> $\mathbb{Z}\_2\times\mathbb{Z}\_2$ has order $4$, the neutral element is $(0\_2,0\_2)$ and the other elements have order $2$.
> Therefore, $\mathbb{Z}\_2\times\mathbb{Z}\_2$ is not cyclic,so it is the Klein group.
>
>
>
The elements of $\mathbb{Z\_2}$ are $\{0\_2,1\_2\}$ and the order of $1\_2$ is 2.
If we t... | 2017/11/29 | [
"https://math.stackexchange.com/questions/2543272",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/400711/"
] | The order of a group is the number of elements in it. $\mathbb{Z}\_2\times\mathbb{Z}\_2$ has four elements: $(0,0), (0,1), (1,0), (1,1)$.
But as you have seen, each element has order $\le 2$. (This, in particular, proves that $\mathbb{Z}\_2\times\mathbb{Z}\_2$ is not isomorphic to $\mathbb{Z}\_4$.) | The elements of $\mathbb{Z}\_2 \times \mathbb{Z}\_2$ are
(0,0), (0,1), (1,0), (1,1)
There are 4 of them, thus the order of the group is 4. |
44,497,718 | I'm just practising with python. I have a dictionary in the form:
```
my_dict = [{'word': 'aa', 'value': 2},
{'word': 'aah', 'value': 6},
{'word': 'aahed', 'value': 9}]
```
How would I go about ordering this dictionary such that if I had thousands of words I would then be able to select the t... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44497718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Firstly, that's not a dictionary; it's a list of dictionaries. Which is good, because dictionaries are unordered, but lists are ordered.
You can sort the list by the value of the `rank` element by using it as a key to the sort function:
```
scrabble_rank.sort(key=lambda x: x['value'])
``` | Is this what you are looking for:
```
scrabble_rank = [{'word':it[1], 'rank':idx+1} for idx,it in enumerate(sorted([[item['value'],item['word']] for item in my_dict],reverse=True))]
``` |
44,497,718 | I'm just practising with python. I have a dictionary in the form:
```
my_dict = [{'word': 'aa', 'value': 2},
{'word': 'aah', 'value': 6},
{'word': 'aahed', 'value': 9}]
```
How would I go about ordering this dictionary such that if I had thousands of words I would then be able to select the t... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44497718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Firstly, that's not a dictionary; it's a list of dictionaries. Which is good, because dictionaries are unordered, but lists are ordered.
You can sort the list by the value of the `rank` element by using it as a key to the sort function:
```
scrabble_rank.sort(key=lambda x: x['value'])
``` | Using `Pandas` Library:
```
import pandas as pd
```
There is this one-liner:
```
scrabble_rank = pd.DataFrame(my_dict).sort_values('value', ascending=False).reset_index(drop=True).reset_index().to_dict(orient='records')
```
It outputs:
```
[{'index': 0, 'value': 9, 'word': 'aahed'},
{'index': 1, 'value': 6, 'wo... |
44,497,718 | I'm just practising with python. I have a dictionary in the form:
```
my_dict = [{'word': 'aa', 'value': 2},
{'word': 'aah', 'value': 6},
{'word': 'aahed', 'value': 9}]
```
How would I go about ordering this dictionary such that if I had thousands of words I would then be able to select the t... | 2017/06/12 | [
"https://Stackoverflow.com/questions/44497718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Firstly, that's not a dictionary; it's a list of dictionaries. Which is good, because dictionaries are unordered, but lists are ordered.
You can sort the list by the value of the `rank` element by using it as a key to the sort function:
```
scrabble_rank.sort(key=lambda x: x['value'])
``` | You can use [heapq](https://docs.python.org/3/library/heapq.html):
```
import heapq
my_dict = [{'word': 'aa', 'value': 2},
{'word': 'aah', 'value': 6},
{'word': 'aahed', 'value': 9}]
# Select the top 3 records based on `value`
values_sorted = heapq.nlargest(3, # fetch top 3
... |
26,480,289 | I run a debian 7. When I launch
>
> cat /etc/debian\_version
>
>
>
I have
>
> 7.7
>
>
>
and when I launch
>
> cat /etc/issue
>
>
>
the response is
>
> Debian GNU/Linux 7.6
>
>
>
Do I run 7.7 or 7.6? | 2014/10/21 | [
"https://Stackoverflow.com/questions/26480289",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3744357/"
] | By default, PHP's `json_encode` will escape `/` characters in strings.
This:
* Does not change the data. `"\/"` and `"/"` are two different, but valid, and equal, JSON representations of a `/` character.
* Lets you use the output as a JavaScript literal, inline in an HTML document, without `</script>` ending the scri... | Slashes are being escaped. Simply unescape the string once you receive it on the front-end.
Or if you're feeling lazy, you can disable the escaping function in the PHP script:
```
echo json_encode($arr, JSON_UNESCAPED_SLASHES);
``` |
10,744,905 | ```
class User extends ActiveRecord\Model
{
pubic static $primary_key = 'userId';
private function isUserLoggedIn() {}
}
```
The error I get:
>
> A PHP Error was encountered
>
>
> Severity: Notice
>
>
> Message: Trying to get property of non-object
>
>
> Filename: lib/Model.php
>
>
> Line Number: 830
>
>... | 2012/05/24 | [
"https://Stackoverflow.com/questions/10744905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1096953/"
] | This is a few months late, but I'm just getting into php-activerecord myself.
Your problem might be that you typed "pubic" instead of "public", and php by default doesn't support any pubic variables. | Your problem is going to be in your Users model. It's possible you didn't extend CI\_Model, you didn't call parent::construct() in the users constructor, or there is some other error in there. |
10,744,905 | ```
class User extends ActiveRecord\Model
{
pubic static $primary_key = 'userId';
private function isUserLoggedIn() {}
}
```
The error I get:
>
> A PHP Error was encountered
>
>
> Severity: Notice
>
>
> Message: Trying to get property of non-object
>
>
> Filename: lib/Model.php
>
>
> Line Number: 830
>
>... | 2012/05/24 | [
"https://Stackoverflow.com/questions/10744905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1096953/"
] | This is a few months late, but I'm just getting into php-activerecord myself.
Your problem might be that you typed "pubic" instead of "public", and php by default doesn't support any pubic variables. | This is caused due to absence of **auto-increment** field in your table.
Please add **auto-increment** field.
I had faced the same issue. |
61,310 | I have been a GIS Analyst for over 10 years and am currently studying java (50% through the course). My plan is to develop GIS applications mainly focused towards open source solutions. I would like to develop some form of a portfolio to gain more experience, but I am not sure what the best way to do this would be. I h... | 2013/05/20 | [
"https://gis.stackexchange.com/questions/61310",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/18320/"
] | A few ideas come to mind for building your geospatial programming credentials:
1. Create a legacy of solutions and answers on GISse and Stack Overflow.
You will notice that many people on GISse creatively and wisely use
this forum to further their freelance work.
2. Create a web page or blog to show potential employer... | I think the way that we create mapping applications is changing fast and the key to success in this industry is being ahead of that curve.
For example 10+ years ago when we wanted a blog we get a shared hosting solution, download a blogging platform like Wordpress or Movable Type install it on the server, buy a domai... |
61,310 | I have been a GIS Analyst for over 10 years and am currently studying java (50% through the course). My plan is to develop GIS applications mainly focused towards open source solutions. I would like to develop some form of a portfolio to gain more experience, but I am not sure what the best way to do this would be. I h... | 2013/05/20 | [
"https://gis.stackexchange.com/questions/61310",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/18320/"
] | A few ideas come to mind for building your geospatial programming credentials:
1. Create a legacy of solutions and answers on GISse and Stack Overflow.
You will notice that many people on GISse creatively and wisely use
this forum to further their freelance work.
2. Create a web page or blog to show potential employer... | >
> but I am concerned with my lack of experience. I feel I would be more of a hindrance than a benefit.
>
>
>
My expirience is that Open Source communities does not look at things this way at all. While your Java experience might not exactly meet the standards of the project, there are always tasks to be done. M... |
61,310 | I have been a GIS Analyst for over 10 years and am currently studying java (50% through the course). My plan is to develop GIS applications mainly focused towards open source solutions. I would like to develop some form of a portfolio to gain more experience, but I am not sure what the best way to do this would be. I h... | 2013/05/20 | [
"https://gis.stackexchange.com/questions/61310",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/18320/"
] | I think the way that we create mapping applications is changing fast and the key to success in this industry is being ahead of that curve.
For example 10+ years ago when we wanted a blog we get a shared hosting solution, download a blogging platform like Wordpress or Movable Type install it on the server, buy a domai... | >
> but I am concerned with my lack of experience. I feel I would be more of a hindrance than a benefit.
>
>
>
My expirience is that Open Source communities does not look at things this way at all. While your Java experience might not exactly meet the standards of the project, there are always tasks to be done. M... |
365,482 | I looked it up and most forums link to <http://semarch.linguistics.fas.nyu.edu/barker/Syllables/index.txt>, an NYU site that no longer works. I would like to know how many unique syllables are used in the English dictionary (not possible syllables, but actually used syllables). | 2016/12/28 | [
"https://english.stackexchange.com/questions/365482",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/212663/"
] | To answer you question, according to that paper on that URL: How many unique phonemes single syllables are used in the English language? 15,831
I've visited that URL 5yrs ago in a wild search of a syllabary of the English language.
Anyways, you can view the paper still using the WayBackMachine one Archive.org. It we... | The main question is only really answerable for a specific dialect and accent of English. "American English" has a lot of regional variations, and also variations by [register](https://en.wikipedia.org/wiki/Register_(sociolinguistics)).
The basic reason for this is that English is a [pluricentric language](https://en... |
53,706 | >
> By faith **Abel** offered to God a better sacrifice than Cain, through
> which he obtained the testimony that he was righteous, God testifying
> about his gifts, and **through faith**, **though he is dead, he still
> speaks.** Hebrews 11:4 (NASB)
>
>
>
1. How does he speak even while he's dead? | 2020/12/16 | [
"https://hermeneutics.stackexchange.com/questions/53706",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/2577/"
] | The author of Hebrews 11:4 is very likely referring/alluding to Gen 4:10 -
>
> “What have you done?” replied the LORD. “The voice of your brother’s
> blood cries out to Me from the ground.
>
>
>
This "voice" is clearly not a literal voice but the exemplary life of Able, though dead, remains in people's memories t... | **What does it mean that ''though [Abel] is dead, he still speaks'' in Hebrews 11:4?**
Your right, Abel has been dead for thousands of years and not a single word that he may have said is recorded in the scripture. So then how does he speak to us?
Abel although dead, speaks to us through his faith, he is the first hu... |
13,059,096 | Z3 currently supports the DIMACS format for input. Is there any way to output the DIMACS format for the problem before solution? I mean converting the problem to a system CNFs and output it in a DIMACS format.
If not, any ideas towards this direction would be more than helpful. | 2012/10/24 | [
"https://Stackoverflow.com/questions/13059096",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1772662/"
] | The DIMACS format is very primitive, it supports only Boolean variables. Z3 does not reduce every problem into SAT. Some problems are solved using a propositional SAT solver, but this is not the rule. This usually only happens if the input contains only Boolean and/or Bit-vector variables. Moreover, even if the input p... | Thanks to Leonardo's answer I came up with this code that will do what you want:
```
private static void Output(Context ctx,Solver slv)
{
var goal = ctx.MkGoal();
goal.Add(slv.Assertions);
var applyResult = ctx.Then(ctx.MkTactic("simplify"),
ctx.MkTactic("bit-blast"),
ctx.MkTactic("tseitin-... |
14,302 | Before I installed Ubuntu on my old computer, I took backups of both partitions with dd. Long story short: I now want to restore these two files, `XP.dd` and `Storage.dd`, to the computer again. How do I do this?
Thanks!
This question is related: [NTFS backup image wont mount](https://askubuntu.com/questions/4584/ntf... | 2010/11/21 | [
"https://askubuntu.com/questions/14302",
"https://askubuntu.com",
"https://askubuntu.com/users/1439/"
] | When people use `dd` to backup an image of a partition, they often fail to backup the partition table as well. If you didn't, you can try creating partitions of similar sizes with `fdisk` and set the partition flags appropriately. Then `dd` them back and run whatever disk checking utility suits the partition in questio... | I think you should only *dd back* the img data to partiton.
example(boot with live ubuntu, expected /dev/hda1 is the restoreable partition, unmount it first, if it mounted):
```
# umount /dev/hda1
# dd if=/path/to/image.dd of=/dev/hda1
# mount /dev/hda1 /path/to/mount
```
After you checked the data, reboot, or set c... |
74,146,558 | How can I multiply two elements in a list?
I am reading a text file, and printing the following:
```
for i in range(len(listeisotoper)):
print("Isotop type:"+listeisotoper[i][0])
print("Isotopisk masse u: "+listeisotoper[i][1])
print("Naturlig forekomst: "+listeisotoper[i][2])
print("xxx"+"g/mol")
... | 2022/10/20 | [
"https://Stackoverflow.com/questions/74146558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9861217/"
] | Probably you are using Selenium 4. if so, `find_element_by_xpath` and all the others `find_element_by_*` methods are not supported by Selenium 4, you have to use the new syntax and add an essential import, as following:
```py
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from sel... | Try this:
```
from selenium.webdriver.common.by import By
driver.find_element(By.XPATH, "//input[@placeholder='Password']").send_keys(PASSWORD)
``` |
71,674 | Ezekiel 20:25-26
>
> So I gave them other statutes that were not good and laws through
> which they could not live; 26 and I defiled them through their gifts—the
> sacrifice of every firstborn—that I might fill them with horror so
> they would know that I am the Lord.’
>
>
> וְגַם-אֲנִי נָתַתִּי לָהֶם, חֻקִּים לֹא ... | 2021/12/06 | [
"https://hermeneutics.stackexchange.com/questions/71674",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/15819/"
] | Based on context alone, the interpretation stated in the OP’s question is problematic. Ezekiel 20:25-26 itself is a puzzling anomaly against the broader context of text. Apart from these two verses, the text otherwise forms one cohesive message that is first meant for the house of Israel (v.27) then to its children (v.... | Not so fast! Note the context in the previous verses of Eze 20:18-24 -
>
> **18** In the wilderness I said to their children: ‘Do not walk in the statutes of your fathers or keep their ordinances or defile yourselves
> with their idols. **19** I am the LORD your God; walk in My statutes,
> keep My ordinances, and pra... |
2,099,602 | Show that the equation below has exactly one root:
$$2x+\cos x=0$$
How would I find the root? | 2017/01/16 | [
"https://math.stackexchange.com/questions/2099602",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/375665/"
] | If $f(x) = 2x+\cos x$ has two zeros, $a$ and $b$, then we have, by MVT (or Rolle's Theorem)
$$0=\frac{f(b)-f(a)}{b-a} = f'(c)$$
for some $c$ between $a$ and $b$. However, $f'(x) = 2-\sin x$ is always positive, so no such $c$ can exist.
To see that there is at least one root, we just plug in $x=10$ and $x=-10$ and a... | Suppose $2x+\cos x$ had [at least] two roots. Then the mean value theorem implies that the derivative is zero somewhere between those two roots.
However, the derivative is $2-\sin x$, which is strictly positive. So this shows the number of roots is either $0$ or $1$. But this doesn't completely answer the question...
... |
2,099,602 | Show that the equation below has exactly one root:
$$2x+\cos x=0$$
How would I find the root? | 2017/01/16 | [
"https://math.stackexchange.com/questions/2099602",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/375665/"
] | If $f(x) = 2x+\cos x$ has two zeros, $a$ and $b$, then we have, by MVT (or Rolle's Theorem)
$$0=\frac{f(b)-f(a)}{b-a} = f'(c)$$
for some $c$ between $a$ and $b$. However, $f'(x) = 2-\sin x$ is always positive, so no such $c$ can exist.
To see that there is at least one root, we just plug in $x=10$ and $x=-10$ and a... | Let $f(x) = 2x + \cos(x)$. Then $f'(x) = 2 - \sin(x) \gt 0$ for all $x$, since $|\sin(x)| \le 1$. This means it crosses the $x$ axis once and never looks back. |
2,099,602 | Show that the equation below has exactly one root:
$$2x+\cos x=0$$
How would I find the root? | 2017/01/16 | [
"https://math.stackexchange.com/questions/2099602",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/375665/"
] | If $f(x) = 2x+\cos x$ has two zeros, $a$ and $b$, then we have, by MVT (or Rolle's Theorem)
$$0=\frac{f(b)-f(a)}{b-a} = f'(c)$$
for some $c$ between $a$ and $b$. However, $f'(x) = 2-\sin x$ is always positive, so no such $c$ can exist.
To see that there is at least one root, we just plug in $x=10$ and $x=-10$ and a... | If you derive the function you get:
$$2-\sin x>0\ \forall x \in \mathbb R$$
So the function is strictly increasing. If you take the limit of $2x+\cos x$ to $\pm\infty$ you get $\pm\infty$, hence being the function continuous and strictly increasing it must intersect the $x-axis$ only in a point. |
2,099,602 | Show that the equation below has exactly one root:
$$2x+\cos x=0$$
How would I find the root? | 2017/01/16 | [
"https://math.stackexchange.com/questions/2099602",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/375665/"
] | If $f(x) = 2x+\cos x$ has two zeros, $a$ and $b$, then we have, by MVT (or Rolle's Theorem)
$$0=\frac{f(b)-f(a)}{b-a} = f'(c)$$
for some $c$ between $a$ and $b$. However, $f'(x) = 2-\sin x$ is always positive, so no such $c$ can exist.
To see that there is at least one root, we just plug in $x=10$ and $x=-10$ and a... | Previous answers and comments explained that the root is unique.
Now, the question is : what is the zero of $$f(x)=2x+\cos(x)$$ Such equation which mixes polynomila and trigonometric terms do not show analytical solutions and numerical methods should be used. The simplest is probably Newton method which, starting from... |
64,296,423 | I have a Node (14.3.0) server where I enabled ES6 module imports in my package.json by adding the following line:
package.json:
`"type": "module",`
According to the firebase-admin docs here: <https://firebase.google.com/docs/admin/setup/#node.js>
>
> If you are using ES2015, you can import the module instead:
>
>... | 2020/10/10 | [
"https://Stackoverflow.com/questions/64296423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/973862/"
] | I asked this question on the `firebase-admin-node` github. Apparently, they hadn't tested imports with Node 14 yet. The answer is simply:
```
import admin from 'firebase-admin'
```
You can see an explanation here:
<https://github.com/firebase/firebase-admin-node/issues/1061#event-3868300300> | Use it like this:
```
import * as admin from 'firebase-admin';
const {credential} = admin;
```
this way you will be able to use the functions. |
52,049,251 | We are starting a new full stack project. It has been decided we are going to use React for the front end which should consume a GraphQL API.
We are contemplating two scenarios for the development of this API:
* The first one is to build a GraphQL API that uses a REST API as data source using Apollo.
* The second one... | 2018/08/28 | [
"https://Stackoverflow.com/questions/52049251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/535967/"
] | Based on our discussion on gitter,
Since you are building your platform from scratch, you don't need to build your GraphQL layer over REST APIs. That will be double work and is not needed. I recommend that you set up [Apollo-Server](https://www.apollographql.com/docs/apollo-server/) which will directly interact with y... | Using REST to power your GraphQL is like using a to power your Tesla. Simply dumb!! Use a database but only select the fields and records asked by GraphQL query, NOT "select \*". Use Redis cache if you need the speed. |
52,049,251 | We are starting a new full stack project. It has been decided we are going to use React for the front end which should consume a GraphQL API.
We are contemplating two scenarios for the development of this API:
* The first one is to build a GraphQL API that uses a REST API as data source using Apollo.
* The second one... | 2018/08/28 | [
"https://Stackoverflow.com/questions/52049251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/535967/"
] | The second scenario is best
>
> The second one is to build a GraphQL API that uses a database as data
> source skipping the REST API.
>
>
>
REST and GraphQL can both be operated over HTTP, though GraphQL is protocol agnostic.
And GraphQL is the new kid in the block with lot of cool features and it solves most of... | Using REST to power your GraphQL is like using a to power your Tesla. Simply dumb!! Use a database but only select the fields and records asked by GraphQL query, NOT "select \*". Use Redis cache if you need the speed. |
52,049,251 | We are starting a new full stack project. It has been decided we are going to use React for the front end which should consume a GraphQL API.
We are contemplating two scenarios for the development of this API:
* The first one is to build a GraphQL API that uses a REST API as data source using Apollo.
* The second one... | 2018/08/28 | [
"https://Stackoverflow.com/questions/52049251",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/535967/"
] | Based on our discussion on gitter,
Since you are building your platform from scratch, you don't need to build your GraphQL layer over REST APIs. That will be double work and is not needed. I recommend that you set up [Apollo-Server](https://www.apollographql.com/docs/apollo-server/) which will directly interact with y... | The second scenario is best
>
> The second one is to build a GraphQL API that uses a database as data
> source skipping the REST API.
>
>
>
REST and GraphQL can both be operated over HTTP, though GraphQL is protocol agnostic.
And GraphQL is the new kid in the block with lot of cool features and it solves most of... |
14,295,122 | Is there a single step way using awk, sort or something equal to sort or reverse a single column of a multi-column CSV table while maintaining the rest in the same order they are?
For example,I have:
```
6, 45, 9
5, 47, 6
4, 46, 7
3, 48, 4
2, 10, 5
1, 11, 1
```
and would like to have:
```
1, 45, 9
2, 47, 6
3, 46, ... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14295122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972610/"
] | This might work for you:
```
paste -d, <(cut -d, -f1 file | sort) <(cut -d, -f2- file)
``` | awk one-liner
```
awk -F, '{c[NR]=$1;l[NR]=$2", "$3}END{for(i=1;i<=NR;i++) print c[NR-i+1]", "l[i]}' file
```
test
```
kent$ echo "6, 45, 9
5, 47, 6
4, 46, 7
3, 48, 4
2, 10, 5
1, 11, 1"|awk -F, '{c[NR]=$1;l[NR]=$2", "$3}END{for(i=1;i<=NR;i++) print c[NR-i+1]", "l[i]}'
1, 45, 9
2, 47, 6
3, 46, 7
4, 48, 4
5,... |
14,295,122 | Is there a single step way using awk, sort or something equal to sort or reverse a single column of a multi-column CSV table while maintaining the rest in the same order they are?
For example,I have:
```
6, 45, 9
5, 47, 6
4, 46, 7
3, 48, 4
2, 10, 5
1, 11, 1
```
and would like to have:
```
1, 45, 9
2, 47, 6
3, 46, ... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14295122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972610/"
] | This might work for you:
```
paste -d, <(cut -d, -f1 file | sort) <(cut -d, -f2- file)
``` | If you have `GNU awk` here's a one liner:
```
$ gawk '{s[NR]=$1;c[NR]=$2 $3}END{for(i=0;++i<=asort(s);)print s[i] c[i]}' file
1,45,9
2,47,6
3,46,7
4,48,4
5,10,5
6,11,1
```
If not, here's an `awk` script that implements a simple bubble sort:
```
{ # read col1 in sort array, read others in col array
sort[NR] = $1
... |
14,295,122 | Is there a single step way using awk, sort or something equal to sort or reverse a single column of a multi-column CSV table while maintaining the rest in the same order they are?
For example,I have:
```
6, 45, 9
5, 47, 6
4, 46, 7
3, 48, 4
2, 10, 5
1, 11, 1
```
and would like to have:
```
1, 45, 9
2, 47, 6
3, 46, ... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14295122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1972610/"
] | awk one-liner
```
awk -F, '{c[NR]=$1;l[NR]=$2", "$3}END{for(i=1;i<=NR;i++) print c[NR-i+1]", "l[i]}' file
```
test
```
kent$ echo "6, 45, 9
5, 47, 6
4, 46, 7
3, 48, 4
2, 10, 5
1, 11, 1"|awk -F, '{c[NR]=$1;l[NR]=$2", "$3}END{for(i=1;i<=NR;i++) print c[NR-i+1]", "l[i]}'
1, 45, 9
2, 47, 6
3, 46, 7
4, 48, 4
5,... | If you have `GNU awk` here's a one liner:
```
$ gawk '{s[NR]=$1;c[NR]=$2 $3}END{for(i=0;++i<=asort(s);)print s[i] c[i]}' file
1,45,9
2,47,6
3,46,7
4,48,4
5,10,5
6,11,1
```
If not, here's an `awk` script that implements a simple bubble sort:
```
{ # read col1 in sort array, read others in col array
sort[NR] = $1
... |
2,355,607 | How can I post data using Jquery from selected data to the PHP?
HTML code:
```
<select id="test" title="test" class="test">
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
</select>
```
Jquery:
```
$('.18').click(function(event) {
var test_s = $('#te... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2355607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/268338/"
] | ### read
from jQuery .load():
*The POST method is used if data is provided as an object; otherwise, GET is assumed.*
read here: <http://api.jquery.com/load/>
### code
untested, probably something like this:
```
$('.opc_mfont').load("index.php?x=18&fid=<?=$fid;?>&mid=<?=$mid;?>", {'data':test_s});
``` | You mixed up single and double quotes:
```
$('.18').click(function(event) {
var test_s = $('#test').val();
$('.opc_mfont').load('index.php?x=18&fid=<?=$fid;?>&mid=<?=$mid;?>&data=' + test_s);
event.stopPropagation();
});
``` |
2,355,607 | How can I post data using Jquery from selected data to the PHP?
HTML code:
```
<select id="test" title="test" class="test">
<option value="1">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
</select>
```
Jquery:
```
$('.18').click(function(event) {
var test_s = $('#te... | 2010/03/01 | [
"https://Stackoverflow.com/questions/2355607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/268338/"
] | ### read
from jQuery .load():
*The POST method is used if data is provided as an object; otherwise, GET is assumed.*
read here: <http://api.jquery.com/load/>
### code
untested, probably something like this:
```
$('.opc_mfont').load("index.php?x=18&fid=<?=$fid;?>&mid=<?=$mid;?>", {'data':test_s});
``` | Your problem is your string:
```
"index.php?x=18&fid=<?=$fid;?>&mid=<?=$mid;?>&data=' + test_s +'"
```
That's not string concatenation - you're mixing your string delimiters. You want:
```
"index.php?x=18&fid=<?=$fid;?>&mid=<?=$mid;?>&data=" + test_s
``` |
37,119,683 | I am very new to python and have to scrape a website for some data for a course at university:
[Xrel](https://www.xrel.to/games-release-list.html?archive=2016-01)
I am able to get the information i need. The problem is i need it for every entry(page, month, year).
The amount of pages differs for every month. Is ther... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37119683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5839166/"
] | >
> One of the main task of Compiler is to check valid syntax
>
>
>
Last method has compilation Error because of after `retrun` statement no other statement possible.
And previuos methods are compiled because the syntax is correct even though there is clear dead code warning.
So try it other way. | Its simply because in the first 2 there is no garauntee that condition will not change in runtime (as far as the compiler concerns) , while in the last 2 there is no way the condition will ever change in runtime.
Whats weird is that putting a `final` there didnt help compiler realize the dead code, altough it is gaura... |
37,119,683 | I am very new to python and have to scrape a website for some data for a course at university:
[Xrel](https://www.xrel.to/games-release-list.html?archive=2016-01)
I am able to get the information i need. The problem is i need it for every entry(page, month, year).
The amount of pages differs for every month. Is ther... | 2016/05/09 | [
"https://Stackoverflow.com/questions/37119683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5839166/"
] | >
> One of the main task of Compiler is to check valid syntax
>
>
>
Last method has compilation Error because of after `retrun` statement no other statement possible.
And previuos methods are compiled because the syntax is correct even though there is clear dead code warning.
So try it other way. | Code analysis is sensitive to "Stop Problem" in general. To obtain some information about the code, you usually have to run the code (if code contains infinite loops, the analyser would hang on during analysis). Because of the issue, in foo and foo2 code analyser doesn't predict future code behaviour.
foo4: It is sim... |
52,169,430 | Is there an angular CLI command that displays all the existing routes of the app? | 2018/09/04 | [
"https://Stackoverflow.com/questions/52169430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7281814/"
] | **No** - there is not an Angular CLI command as of today that will display all your existing routes.
You can take a look at the [Official Angular CLI documentation](https://github.com/angular/angular-cli/wiki) which lists all the available commands. | Angular router supports ForRoot and ForChild. One parent Route State and Multiple Child Route State. parent Route State usually set in app.module.ts. Child Route states will be added in the lazy loaded modules.
When user access the URL, the corresponding configured component will be rendered, those routes will be adde... |
66,912,178 | I've created a procedure oracle with 2 parameters, one of them is a out parameter type `TABLE OF VARCHAR2` . how to call it in java and get result?
My test procedure created below:
```
/* creating package with specs */
create or replace PACKAGE PACK1 AS
TYPE name_array IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEG... | 2021/04/01 | [
"https://Stackoverflow.com/questions/66912178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7505687/"
] | Assumptions:
* always skip the first 2 lines of the input file
* the second field contains no white space
* there are no blank lines
Sample data file:
```
$ cat input.dat
This is a totally extraneous introduction and does not have anything to do with the data. It is here as a facsimile of what the output file looks ... | This should work:
```
tail -n +3 filename | awk '{print $2}' | sed -z 's/\n/,/g;s/,$/\n/' > newfile.txt
```
The `tail -n +3` will skip the first 2 lines of the file (so change this to however many lines the intro is, plus one).
The next part prints out only the second column, the one you're interested in.
The thir... |
371,503 | **Version:** Minecraft Java Edition, 1.15.2, server
Is there a [console command](https://minecraft.gamepedia.com/Commands), or area on the [Debug screen](https://minecraft.gamepedia.com/Debug_screen), for querying how many total, already been generated and stored chunks which make up the entire current Minecraft world... | 2020/06/18 | [
"https://gaming.stackexchange.com/questions/371503",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/152613/"
] | The problem might be you already have a villager spawned somewhere but you don't know it.
>
> At any time, there can be only ***one*** wandering trader naturally spawned in loaded chunks. After 24000 ticks (20 real-life minutes, or 1 Minecraft day) have passed since the world is created, the game attempts to spawn a ... | I have the same issue, i had him appearing at the beggining of my world, but once i created an underground base, the trader stopped spawning with the patrols, but when i got back on surface, but after around 20 minutes he got back with the patrols. |
32,538 | I was wondering if there was any hard number evidence for upscaling or downscaling footage to a certain raster size, and what happens to the quality or if any degradation or improvements are made to the output.
I know anecdotally that if you take a `320x240` video file and upscale it to `1920x1080` that the quality is... | 2020/10/27 | [
"https://avp.stackexchange.com/questions/32538",
"https://avp.stackexchange.com",
"https://avp.stackexchange.com/users/14221/"
] | ... Depends...
There are many concepts that need to be differentiated. Let me explore a bit.
**Information**
The first one is that we need to think about an image as information. So we need to ask first. Is the information lost? Is the information modified? Is it improved? Keep this concept in mind.
**Scaling**
An... | May i understand your question as
>
> How do i have someone/something that understands the missing puzzles from
> my upscaled images?
>
>
>
If so, you are talking some intelligence/experience in upscaling or AI-upscaling. Then, plz take a look of [AI Upscalers](https://sites.google.com/view/aiupscalingtutorials/a... |
29,993,602 | When the application is run, WCF service works as expected.
When the exact same code is called from a unit test project, the error below occurs. Is there something special needed for windows 8 test projects to access the WCF service?
>
> Result Message: Test method
> DataServiceTests.MyTest
> threw exception:
>... | 2015/05/01 | [
"https://Stackoverflow.com/questions/29993602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/322518/"
] | With a little CSS maybe:
```
.slick-prev { left: 10px }
.slick-next { right: 10px }
``` | If you would just like to use CSS you can just target the classes .slick-prev and .slick-next. Posting your code might help, but here is what worked on slick carousel's demo page (I had to add a background-color to for the white icon to show up on the white slide).
```
.slick-prev {left:10px;}
.slick-next {right: 10px... |
58,906,382 | Consider an example where a person can have a lot of cars. That's why we are using @OneToMany annotation:
```
@Entity
@Table(name = "person")
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "first_name")
private String firstName;
... | 2019/11/17 | [
"https://Stackoverflow.com/questions/58906382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6579265/"
] | After some experiments and searching on web, I found out that using `FetchMode.SELECT` will do exactly what I want and it is exactly what I was looking for. I changed:
```
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "owner")
private List<Car> cars = new ArrayList<Car>();
```
to:
```
@O... | Create a memory dump and analyze that to see what is using all that memory. Maybe you just need to increase the max heap size.
You could also make it lazy and use `Hibernate.initialize` on the cars collection. That way, I even think its possible to use a fetch mode like e.g. SUBSELECT.
If nothing helps, I can recommend... |
2,710,373 | Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive.
Using the paypal adaptive payments extension for ActiveMerchant (<http://github.com/lamp/paypal_adaptive_gateway>) it seems that although the headers are set in all ca... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2710373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241326/"
] | The RFC does specify that header keys are [case-insensitive](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), so unfortunately you seem to have hit an annoying requirement with the PayPal API.
Net::HTTP is what is changing the case, although I'm surprised they're not all getting downcased:
```
# File ne... | I got several issues with the code proposed by @kaplan-ilya because the Net::HTTP library tries to detect the post content-type, and the I ended up with 2 content-type and other fields repeated with different cases.
So the code below should ensure than once a particular case has been choosen, it will stick to the same... |
2,710,373 | Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive.
Using the paypal adaptive payments extension for ActiveMerchant (<http://github.com/lamp/paypal_adaptive_gateway>) it seems that although the headers are set in all ca... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2710373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241326/"
] | The RFC does specify that header keys are [case-insensitive](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), so unfortunately you seem to have hit an annoying requirement with the PayPal API.
Net::HTTP is what is changing the case, although I'm surprised they're not all getting downcased:
```
# File ne... | If you are still looking for an answer that works. Newer versions have introduced some changes to underlying `capitalize` method by using `to_s`. Fix is to make the `to_s` and `to_str` return the `self` so that the returned object is an instance of `ImmutableKey` instead of the base string class.
```
class ImmutableKe... |
2,710,373 | Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive.
Using the paypal adaptive payments extension for ActiveMerchant (<http://github.com/lamp/paypal_adaptive_gateway>) it seems that although the headers are set in all ca... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2710373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241326/"
] | Use following code to force case sensitive headers.
```
class CaseSensitivePost < Net::HTTP::Post
def initialize_http_header(headers)
@header = {}
headers.each{|k,v| @header[k.to_s] = [v] }
end
def [](name)
@header[name.to_s]
end
def []=(name, val)
if val
@header[name.to_s] = [val]
... | I got several issues with the code proposed by @kaplan-ilya because the Net::HTTP library tries to detect the post content-type, and the I ended up with 2 content-type and other fields repeated with different cases.
So the code below should ensure than once a particular case has been choosen, it will stick to the same... |
2,710,373 | Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive.
Using the paypal adaptive payments extension for ActiveMerchant (<http://github.com/lamp/paypal_adaptive_gateway>) it seems that although the headers are set in all ca... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2710373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241326/"
] | Use following code to force case sensitive headers.
```
class CaseSensitivePost < Net::HTTP::Post
def initialize_http_header(headers)
@header = {}
headers.each{|k,v| @header[k.to_s] = [v] }
end
def [](name)
@header[name.to_s]
end
def []=(name, val)
if val
@header[name.to_s] = [val]
... | If you are still looking for an answer that works. Newer versions have introduced some changes to underlying `capitalize` method by using `to_s`. Fix is to make the `to_s` and `to_str` return the `self` so that the returned object is an instance of `ImmutableKey` instead of the base string class.
```
class ImmutableKe... |
2,710,373 | Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive.
Using the paypal adaptive payments extension for ActiveMerchant (<http://github.com/lamp/paypal_adaptive_gateway>) it seems that although the headers are set in all ca... | 2010/04/25 | [
"https://Stackoverflow.com/questions/2710373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241326/"
] | If you are still looking for an answer that works. Newer versions have introduced some changes to underlying `capitalize` method by using `to_s`. Fix is to make the `to_s` and `to_str` return the `self` so that the returned object is an instance of `ImmutableKey` instead of the base string class.
```
class ImmutableKe... | I got several issues with the code proposed by @kaplan-ilya because the Net::HTTP library tries to detect the post content-type, and the I ended up with 2 content-type and other fields repeated with different cases.
So the code below should ensure than once a particular case has been choosen, it will stick to the same... |
52,250,480 | My question is about composite types. I can't seem to find anywhere that explains what compound types are in C++.
Are they different from composite types? | 2018/09/10 | [
"https://Stackoverflow.com/questions/52250480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8455470/"
] | From the C++ working draft (N4713):
>
> **6.7 Types [basic.types]**
>
>
> 1. There are two kinds of types: fundamental types and compound types.
>
>
>
There is no specific definition of compound types in the said draft. All we are told is how these compound types are constructed.
>
> **6.7.2 Compound types [b... | Any type that is not a [fundamental type](https://en.cppreference.com/w/cpp/language/types) (a type in the core language) is a compound type.
Fundamental types: void, nullptr\_t, bool, integer/character/floating-point types, ranges (C++20)
Compound types: All other types
Another way to think about this is that an ... |
52,250,480 | My question is about composite types. I can't seem to find anywhere that explains what compound types are in C++.
Are they different from composite types? | 2018/09/10 | [
"https://Stackoverflow.com/questions/52250480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8455470/"
] | From the C++ working draft (N4713):
>
> **6.7 Types [basic.types]**
>
>
> 1. There are two kinds of types: fundamental types and compound types.
>
>
>
There is no specific definition of compound types in the said draft. All we are told is how these compound types are constructed.
>
> **6.7.2 Compound types [b... | There are 2 types :
Base type: like int,double,boolean ,... in addition this type can be qualified by const
`const int c1=89;`
compound type: Types that is built by using base type.
1- pointers `int *v1=&v1;`
2-references `int &r1=v1;`
3-arrays based on int or char our whatever
4-strings
this is how i... |
52,250,480 | My question is about composite types. I can't seem to find anywhere that explains what compound types are in C++.
Are they different from composite types? | 2018/09/10 | [
"https://Stackoverflow.com/questions/52250480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8455470/"
] | From the book *C++ Primer, 5th edition*:
>
> A compound type is a type that is defined in terms of another type. C++ has several compound types, two of which, **references and pointers...**
>
>
>
I think it means compound types are types like references and pointers. Do correct me if I'm wrong. | Any type that is not a [fundamental type](https://en.cppreference.com/w/cpp/language/types) (a type in the core language) is a compound type.
Fundamental types: void, nullptr\_t, bool, integer/character/floating-point types, ranges (C++20)
Compound types: All other types
Another way to think about this is that an ... |
52,250,480 | My question is about composite types. I can't seem to find anywhere that explains what compound types are in C++.
Are they different from composite types? | 2018/09/10 | [
"https://Stackoverflow.com/questions/52250480",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8455470/"
] | From the book *C++ Primer, 5th edition*:
>
> A compound type is a type that is defined in terms of another type. C++ has several compound types, two of which, **references and pointers...**
>
>
>
I think it means compound types are types like references and pointers. Do correct me if I'm wrong. | There are 2 types :
Base type: like int,double,boolean ,... in addition this type can be qualified by const
`const int c1=89;`
compound type: Types that is built by using base type.
1- pointers `int *v1=&v1;`
2-references `int &r1=v1;`
3-arrays based on int or char our whatever
4-strings
this is how i... |
133,308 | I have an external hard drive that was making an odd sound, and I wanted it to stop. I found out that navigating the contents of the HD in the Finder would make it stop temporarily. I set up a shell geeklet that ran `ls /Volumes/ExtraStorage` and that fixed the problem.
My question is if this can harm the hard drive i... | 2014/06/08 | [
"https://apple.stackexchange.com/questions/133308",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/71220/"
] | This is likely a hard drive power management and sleep issue rather than an issue with the drive. When unused for a few minutes, the drive goes to sleep, possibly making a noise while parking the heads for safety. Your script accessing it in shorter intervals prevents it from going to sleep. You can confirm if this is ... | If your script fixes the odd sound and you have good back-ups, your solution is unlikely to cause worse problems.
That the drive is making an odd sound anyway suggests a problem. Make sure your back-ups are current and maintained.
Hard disk drives can be kept spinning and in use constantly. Your `ls` script run every... |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | **None, use an additional layer in Photoshop/Illustrator to contain all of you annotations.** This way you can easily turn it on/off when you need to and it is all contained within the same document.
If for some reason you are not the creator of these files and you do not have access to Photoshop of Illustrator, try o... | I know only screen annotation apps like Skitch, Voila or Little Snapper. Apps not support photoshop or illustrator formats.
Or some desktop sketching apps like Desktastic or FlySketch. |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | You don't mention how much you want to spend for this tool, but OmniGraffle can do this.
Here's an example using a portion of this page. I set the page ruler units to pixels, then created line objects with labels that contain dynamic text. I double-clicked the bottom label to show the text variable used to show the p... | **None, use an additional layer in Photoshop/Illustrator to contain all of you annotations.** This way you can easily turn it on/off when you need to and it is all contained within the same document.
If for some reason you are not the creator of these files and you do not have access to Photoshop of Illustrator, try o... |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | **None, use an additional layer in Photoshop/Illustrator to contain all of you annotations.** This way you can easily turn it on/off when you need to and it is all contained within the same document.
If for some reason you are not the creator of these files and you do not have access to Photoshop of Illustrator, try o... | RasterEdge provides [annotation](http://www.rasteredge.com/how-to/vb-net-imaging/image-annotating/) capabilities for users if they want to annotate, redact information on images and documents, it is worth trying. |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | You don't mention how much you want to spend for this tool, but OmniGraffle can do this.
Here's an example using a portion of this page. I set the page ruler units to pixels, then created line objects with labels that contain dynamic text. I double-clicked the bottom label to show the text variable used to show the p... | I know only screen annotation apps like Skitch, Voila or Little Snapper. Apps not support photoshop or illustrator formats.
Or some desktop sketching apps like Desktastic or FlySketch. |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | I know only screen annotation apps like Skitch, Voila or Little Snapper. Apps not support photoshop or illustrator formats.
Or some desktop sketching apps like Desktastic or FlySketch. | RasterEdge provides [annotation](http://www.rasteredge.com/how-to/vb-net-imaging/image-annotating/) capabilities for users if they want to annotate, redact information on images and documents, it is worth trying. |
5,094 | I'm looking for a tool where I can quickly annotate my Photoshop/Illustrator designs with the distances in pixels between different elements and / or the edges, so I can then transform the layout into code without having to switch between programs and measure distances all day.
I've been searching Google for a while, ... | 2011/12/15 | [
"https://graphicdesign.stackexchange.com/questions/5094",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/3186/"
] | You don't mention how much you want to spend for this tool, but OmniGraffle can do this.
Here's an example using a portion of this page. I set the page ruler units to pixels, then created line objects with labels that contain dynamic text. I double-clicked the bottom label to show the text variable used to show the p... | RasterEdge provides [annotation](http://www.rasteredge.com/how-to/vb-net-imaging/image-annotating/) capabilities for users if they want to annotate, redact information on images and documents, it is worth trying. |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | You can use [`pd.Index.get_level_values`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.get_level_values.html) and map a series from `t2`:
```
t1['y'] = t1.index.get_level_values(0).map(t2['y'].get)
print(t1)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
... | Use [`reindex`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.reindex.html) on `t2`, setting the `level` parameter as appropriate, and directly assign to `t1`:
```
t1['y'] = t2['y'].reindex(t1.index, level='a1')
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | You can use [`pd.Index.get_level_values`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.get_level_values.html) and map a series from `t2`:
```
t1['y'] = t1.index.get_level_values(0).map(t2['y'].get)
print(t1)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
... | A slow way to do the join in the 2nd example:
```py
for col in t2.columns:
for i2 in t2.index:
t1.loc[i2+(slice(None),),col] = t2.loc[i2,col]
```
The task is to vectorize it and to put slice(None) automatically in the correct locations while creating a t1 index item.
Vectorized version for the 2nd examp... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | Solution to the 1st example:
```py
t1.reset_index('a2', drop=False).join(t2
).rename_axis('a1').set_index('a2', append=True)
```
Solution to the 2nd example:
```py
t1.reset_index('a3', drop=False).join(
t2.rename_axis(index={'b1':'a1', 'b2':'a2'})
).set_index('a3', append=True)
``` | You can use [`pd.Index.get_level_values`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.get_level_values.html) and map a series from `t2`:
```
t1['y'] = t1.index.get_level_values(0).map(t2['y'].get)
print(t1)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | You could merge `t1` and `t2` directly on the index level named `a1` in `t1`, and the single index of `t2`:
```
t1.merge(t2, left_on = t1.index.get_level_values('a1').values, right_index=True)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
1 4.0 40.0
2 0 5.0 60.0
1 ... | Use [`reindex`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.reindex.html) on `t2`, setting the `level` parameter as appropriate, and directly assign to `t1`:
```
t1['y'] = t2['y'].reindex(t1.index, level='a1')
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | You could merge `t1` and `t2` directly on the index level named `a1` in `t1`, and the single index of `t2`:
```
t1.merge(t2, left_on = t1.index.get_level_values('a1').values, right_index=True)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
1 4.0 40.0
2 0 5.0 60.0
1 ... | A slow way to do the join in the 2nd example:
```py
for col in t2.columns:
for i2 in t2.index:
t1.loc[i2+(slice(None),),col] = t2.loc[i2,col]
```
The task is to vectorize it and to put slice(None) automatically in the correct locations while creating a t1 index item.
Vectorized version for the 2nd examp... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | Solution to the 1st example:
```py
t1.reset_index('a2', drop=False).join(t2
).rename_axis('a1').set_index('a2', append=True)
```
Solution to the 2nd example:
```py
t1.reset_index('a3', drop=False).join(
t2.rename_axis(index={'b1':'a1', 'b2':'a2'})
).set_index('a3', append=True)
``` | You could merge `t1` and `t2` directly on the index level named `a1` in `t1`, and the single index of `t2`:
```
t1.merge(t2, left_on = t1.index.get_level_values('a1').values, right_index=True)
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.0
1 4.0 40.0
2 0 5.0 60.0
1 ... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | Solution to the 1st example:
```py
t1.reset_index('a2', drop=False).join(t2
).rename_axis('a1').set_index('a2', append=True)
```
Solution to the 2nd example:
```py
t1.reset_index('a3', drop=False).join(
t2.rename_axis(index={'b1':'a1', 'b2':'a2'})
).set_index('a3', append=True)
``` | Use [`reindex`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.reindex.html) on `t2`, setting the `level` parameter as appropriate, and directly assign to `t1`:
```
t1['y'] = t2['y'].reindex(t1.index, level='a1')
x y
a1 a2
0 0 1.0 20.0
1 2.0 20.0
1 0 3.0 40.... |
50,477,220 | How can one join 2 pandas DataFrames on MultiIndex with different number of levels?
```py
import pandas as pd
t1 = pd.DataFrame(data={'a1':[0,0,1,1,2,2],
'a2':[0,1,0,1,0,1],
'x':[1.,2.,3.,4.,5.,6.]})
t1.set_index(['a1','a2'], inplace=True)
t1.sort_index(inplace=True)
t2 ... | 2018/05/22 | [
"https://Stackoverflow.com/questions/50477220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6461882/"
] | Solution to the 1st example:
```py
t1.reset_index('a2', drop=False).join(t2
).rename_axis('a1').set_index('a2', append=True)
```
Solution to the 2nd example:
```py
t1.reset_index('a3', drop=False).join(
t2.rename_axis(index={'b1':'a1', 'b2':'a2'})
).set_index('a3', append=True)
``` | A slow way to do the join in the 2nd example:
```py
for col in t2.columns:
for i2 in t2.index:
t1.loc[i2+(slice(None),),col] = t2.loc[i2,col]
```
The task is to vectorize it and to put slice(None) automatically in the correct locations while creating a t1 index item.
Vectorized version for the 2nd examp... |
13,354,169 | I am doing direct queries to wikipedia's website via an android app.
However, sometimes when I get "REDIRECT" queries, and my redirect suggestion has a # sign in it, I don't really know how to handle it. I know I can just throw everything out past the # sign, but that means I'm looking up something that is relatively ... | 2012/11/13 | [
"https://Stackoverflow.com/questions/13354169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1387888/"
] | Most of the time the part after the hash is a section title (though it is simply appended to the new URL, so it can be, and occasionally is, used to point to other kinds of anchors), so you can locate the section (with the `mobileview` action for example) and with the section index you can query the HTML for that secti... | The hash points to a named anchor or ID in the target document. So if you're parsing the page content, then ideally you'd find the anchor tag or ID and return the content that follows that element, rather than starting at the beginning of the content. |
4,847,558 | I've searched google and other places for a while but I can't find out how to generate or create dotted pairs. I ask this because, I need to turn a list that looks like this:
```
(X Y Z)
```
To a list that is in this format:
```
((X . 1) (Y . 2) (Z . 3))
```
Where the numbers represent the index. I have a functio... | 2011/01/31 | [
"https://Stackoverflow.com/questions/4847558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1188934/"
] | Your code has a very basic mistake:
```
(defun listFormat (l)
(defun place-index (idx l) ; <<<---- This DEFUN is wrong
(if (null l)
nil
(append (list (first l)) (list idx)
(place-index (+ idx 1) (rest l)))))
(place-index 1 l))
```
Don't nest DEFUN. That's ju... | You want the else-branch to read:
```
(cons (cons (first l) idx) (place-index (+ idx 1) (rest l)))
``` |
4,847,558 | I've searched google and other places for a while but I can't find out how to generate or create dotted pairs. I ask this because, I need to turn a list that looks like this:
```
(X Y Z)
```
To a list that is in this format:
```
((X . 1) (Y . 2) (Z . 3))
```
Where the numbers represent the index. I have a functio... | 2011/01/31 | [
"https://Stackoverflow.com/questions/4847558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1188934/"
] | You want the else-branch to read:
```
(cons (cons (first l) idx) (place-index (+ idx 1) (rest l)))
``` | And by the way, for the question itself, this code will do:
```
(defun listFormat (lst)
(loop for idx from 1
for item in lst
collect (cons item idx)))
``` |
4,847,558 | I've searched google and other places for a while but I can't find out how to generate or create dotted pairs. I ask this because, I need to turn a list that looks like this:
```
(X Y Z)
```
To a list that is in this format:
```
((X . 1) (Y . 2) (Z . 3))
```
Where the numbers represent the index. I have a functio... | 2011/01/31 | [
"https://Stackoverflow.com/questions/4847558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1188934/"
] | Your code has a very basic mistake:
```
(defun listFormat (l)
(defun place-index (idx l) ; <<<---- This DEFUN is wrong
(if (null l)
nil
(append (list (first l)) (list idx)
(place-index (+ idx 1) (rest l)))))
(place-index 1 l))
```
Don't nest DEFUN. That's ju... | And by the way, for the question itself, this code will do:
```
(defun listFormat (lst)
(loop for idx from 1
for item in lst
collect (cons item idx)))
``` |
2,843 | As the core and mantle of the earth cools, it will reach a point where new crust cannot be produced.
How can this point be calculated?
If we can, has anyone done such calculations?
Thanks! | 2014/11/19 | [
"https://earthscience.stackexchange.com/questions/2843",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/1061/"
] | One permanent threat to plate tectonics is the oceans vanishing. The scientific jury may still be out on this matter, but most geologists and geophysicists consider water to be the lubricant that makes plate tectonics possible. In a billion years or so, the Sun will have become 10% more luminous. This is conjectured to... | The whole plate tectonic system is good for a few billion years yet. David is correct that water, as a lubricant, is needed to keep the system moving, but a 10% warming of the sun isn't enough to completely destroy the oceans. That will occur, but not until the sun moves close to, or into its red giant phase several bi... |
41,760,813 | Here i want to join this three tables namely `salary`,`payroll` and `attendance` .first i want to join `salary.salary_template_id` with `employee.salary_template_id` and after that i want to join `employee.user_id` with `attendance.user_id` in order to get the basic salary of each `user_id`.how can i join?
My salary ta... | 2017/01/20 | [
"https://Stackoverflow.com/questions/41760813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5064637/"
] | You can use LatLngBounds to make a fix bound focus.
```
/**Latlng's to get focus*/
LatLng Delhi = new LatLng(28.61, 77.2099);
LatLng Chandigarh = new LatLng(30.75, 76.78);
LatLng SriLanka = new LatLng(7.000, 81.0000);
LatLng America = new LatLng(38.8833, 77.0167);
LatLng Arab = new LatLng(24.00... | ```
mMap = googleMap;
Log.d("mylog", "Added Markers");
mMap.addMarker(place1);
mMap.addMarker(place2);
int padding = 50;
/**create the bounds from latlngBuilder to set into map camera*/
LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(new LatLng(28.429730, 77.055400... |
38,172,513 | What is the best way to play sound with delay 50ms or 100ms?
Here is something, what i tried:
```
var beat = new Audio('/sound/BEAT.wav');
var time = 300;
playbeats();
function playbeats(){
beat.cloneNode().play();
setTimeout(playbeats, time);
}
```
This is working correctly but my goal is to play BEAT.wav after... | 2016/07/03 | [
"https://Stackoverflow.com/questions/38172513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6524615/"
] | You can use setInterval(), the arguments are the same.
```
setInterval(function() {
playbeats();
}, 100);
```
and your function playbeats function should be.
```
function playbeats(){
var tempBeat=beat.cloneNode();
tempBeat.play();
```
}
your whole program should be like this.
```
var beat = new Audio('/sou... | You can use the Web Audio API but the code will be a bit different.If you want the Web Audio API's timing and loop capabillities you will need to load the file into a buffer first. It also requires that your code is run on a server. Here is an example:
```
var audioContext = new AudioContext();
var audioBuffer;
var ge... |
38,172,513 | What is the best way to play sound with delay 50ms or 100ms?
Here is something, what i tried:
```
var beat = new Audio('/sound/BEAT.wav');
var time = 300;
playbeats();
function playbeats(){
beat.cloneNode().play();
setTimeout(playbeats, time);
}
```
This is working correctly but my goal is to play BEAT.wav after... | 2016/07/03 | [
"https://Stackoverflow.com/questions/38172513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6524615/"
] | You can use setInterval(), the arguments are the same.
```
setInterval(function() {
playbeats();
}, 100);
```
and your function playbeats function should be.
```
function playbeats(){
var tempBeat=beat.cloneNode();
tempBeat.play();
```
}
your whole program should be like this.
```
var beat = new Audio('/sou... | I would also recommend using the Web Audio API. From there, you can simply loop a buffer source node every 100ms or 50ms or whatever time you want.
To do this, as stated in other responses, you'll need to use an XMLHttpRequest to load the sound file via a server
```
// set up the Web Audio context
var audioCtx = new ... |
2,203,455 | 7 balls with different colors, there are 4 identical boxes. the box can be empty. how many ways to distribute the balls?
what kind of counting problem is this? how do we count it? | 2017/03/26 | [
"https://math.stackexchange.com/questions/2203455",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/387221/"
] | We have $7$ objects (let each be elements of a set) and we want to partition these objects into $4$ subsets. We can have $1$ nonempty subset (and the other $3$ consequently empty), $2$ nonempty subsets (and the rest empty), $3$ nonempty subsets (and the rest empty), or $4$ nonempty subsets. We can't have $0$ nonempty s... | The answer can be obtained w/o using Stirling numbers as
$1+63+\dfrac{(4^7 -1\*4 - 63\*12)}{4!}= 715$, as explained below
If all configurations had $4!$ permutations, we'd get $\;\dfrac{4^7}{4!}$, but two types don't, and we are adjusting for them
* Just $1$ way to place all balls in one box, $4$ ways only to permut... |
2,203,455 | 7 balls with different colors, there are 4 identical boxes. the box can be empty. how many ways to distribute the balls?
what kind of counting problem is this? how do we count it? | 2017/03/26 | [
"https://math.stackexchange.com/questions/2203455",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/387221/"
] | From set A (the m balls) to set B (the n boxes), the number of onto functions is $n!S(m,n)$. If the boxes are identical, the order does not matter anymore. Therefore, there are $n!S(m,n)/n! = S(m,n) $ ways to distribute the 7 balls.
We can use, 4 boxes, 3 boxes, 2 boxes or 1 box.
$S(7,4)+S(7,3)+S(7,2)+S(7,1)$ | The answer can be obtained w/o using Stirling numbers as
$1+63+\dfrac{(4^7 -1\*4 - 63\*12)}{4!}= 715$, as explained below
If all configurations had $4!$ permutations, we'd get $\;\dfrac{4^7}{4!}$, but two types don't, and we are adjusting for them
* Just $1$ way to place all balls in one box, $4$ ways only to permut... |
40,698,535 | Disclaimer: I am not going to use any other ways I have a specific requirement.
All I want is to Join from posts table to the posts meta so that I can get the featured image per post. I am able to get the post via where clause post type is post and published but I don't know how to write join for MySql to get the feat... | 2016/11/19 | [
"https://Stackoverflow.com/questions/40698535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4582545/"
] | You mention " i don't want to mix up js and jQuery on the following code" but you are actually mixing vanilla DOM APIs with jQuery methods. `.parent` and `.addClass` are jQuery functions. You can code:
```
btn.parentNode.classList.add("active");
``` | You need .parentNode on the element.
Something like this.
```
var clickedPath = this.getElement();
clickedPath.classList.add("active");
var classes = clickedPath.getAttribute('class').match(/\d+/g) || [];
buttons.forEach(function(btn) {
var method = classes.indexOf(btn.getAttribute('data-date')) > -1 ? 'add' : 'rem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.