qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | It seems there is no limit for Google Keep storage according to [this article](http://www.techradar.com/news/internet/web/google-keep-vs-evernote-vs-apple-notes-1139656). | There is a limit for the number of items in a Google Keep list. By my estimate, that limit is 1,000.
[](https://i.stack.imgur.com/mJyma.png) |
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | Tested this a minute ago: 19,999 characters is the upper limit for text in **each** Google Keep note, not including the title or any images. additionally, 999 characters maximum are allowed in the title. I was able to upload 7 images totaling 3.0MB to the same note after the above text limits were reached. I assume mor... | As per the Google Product [forum answer](https://productforums.google.com/forum/#!topic/docs/_mgdBX6y53A;context-place=topicsearchin/docs/category$3Akeep$20storage$20space) no data attached to Google Drive account. |
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | Tested this a minute ago: 19,999 characters is the upper limit for text in **each** Google Keep note, not including the title or any images. additionally, 999 characters maximum are allowed in the title. I was able to upload 7 images totaling 3.0MB to the same note after the above text limits were reached. I assume mor... | All the Google Keep data is stored in your android phone in main memory. The Default size appears to be 2 GB on my phone. When I used up the 2GB, it prompted me to give it more space, but by then the phone was almost full. I have not found the place where the settings are to change it yet. Seems Like a space hog. Wish ... |
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | Tested this a minute ago: 19,999 characters is the upper limit for text in **each** Google Keep note, not including the title or any images. additionally, 999 characters maximum are allowed in the title. I was able to upload 7 images totaling 3.0MB to the same note after the above text limits were reached. I assume mor... | There is a limit for the number of items in a Google Keep list. By my estimate, that limit is 1,000.
[](https://i.stack.imgur.com/mJyma.png) |
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | As per the Google Product [forum answer](https://productforums.google.com/forum/#!topic/docs/_mgdBX6y53A;context-place=topicsearchin/docs/category$3Akeep$20storage$20space) no data attached to Google Drive account. | All the Google Keep data is stored in your android phone in main memory. The Default size appears to be 2 GB on my phone. When I used up the 2GB, it prompted me to give it more space, but by then the phone was almost full. I have not found the place where the settings are to change it yet. Seems Like a space hog. Wish ... |
79,225 | I've tried searching for the answer but couldn't find it. Do the notes stored in Google Keep use space from the Google storage? Or is it free and unlimited like a Google doc in Google Drive?
EDIT: that's too good to believe they would give unlimited storage for pictures and audio recordings.
Any update? | 2015/06/15 | [
"https://webapps.stackexchange.com/questions/79225",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/22630/"
] | As per the Google Product [forum answer](https://productforums.google.com/forum/#!topic/docs/_mgdBX6y53A;context-place=topicsearchin/docs/category$3Akeep$20storage$20space) no data attached to Google Drive account. | There is a limit for the number of items in a Google Keep list. By my estimate, that limit is 1,000.
[](https://i.stack.imgur.com/mJyma.png) |
9,219,881 | On linux you can set up a virtual interface using
```
ifconfig eth0:0 ....
```
There's these questions:
[How do you create a virtual network interface on Windows?](https://stackoverflow.com/questions/47854/how-do-you-create-a-virtual-network-interface-on-windows)
[virtual network interface for windows](https://st... | 2012/02/09 | [
"https://Stackoverflow.com/questions/9219881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/89584/"
] | For the record, the only solution we found at $WORK that actually solved the problem on Win7 (embedded) is a custom MUX (multiplexer) driver derived from source from Microsoft. That let us set up two different virtual adapters with the different configurations.
AddIPAddress doesn't let you add a static address to an a... | [AddIPAddress](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365801%28v=vs.85%29.aspx) can be used to add a new IP address (and subnet mask) to an existing network adaptor. This should let you talk to a computer on a different subnet to the default. |
56,040,278 | When I was trying to print the address of the first variable in main function, I found that the result is always same after running few times. Why? Is it in the virtual memory or physical memory?
```c
#include <stdio.h>
int main()
{
int a;
printf("a's address is %p\n", &a);
return 0;
}
```
I expect th... | 2019/05/08 | [
"https://Stackoverflow.com/questions/56040278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10379237/"
] | On some systems, [ASLR](https://en.wikipedia.org/wiki/Address_space_layout_randomization) is enabled, and for good reasons.
For example, on my Linux/Debian/Sid x86-64 your program gives each time different addresses:
```
repeat 10 tmp/sange
a's address is 0x7fff2768303c
a's address is 0x7ffc5d26a57c
a's address is 0x... | **No** the address is not fixed.
--------------------------------
It is up to your OS to decide where the program is loaded and consequently to which address the variable is assigned.
If the address is physical of virtual, it depends on your OS as well. It decides how to manage memory. |
56,040,278 | When I was trying to print the address of the first variable in main function, I found that the result is always same after running few times. Why? Is it in the virtual memory or physical memory?
```c
#include <stdio.h>
int main()
{
int a;
printf("a's address is %p\n", &a);
return 0;
}
```
I expect th... | 2019/05/08 | [
"https://Stackoverflow.com/questions/56040278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10379237/"
] | On some systems, [ASLR](https://en.wikipedia.org/wiki/Address_space_layout_randomization) is enabled, and for good reasons.
For example, on my Linux/Debian/Sid x86-64 your program gives each time different addresses:
```
repeat 10 tmp/sange
a's address is 0x7fff2768303c
a's address is 0x7ffc5d26a57c
a's address is 0x... | In any normal multi-user operating system, the addresses in your process will be virtual addresses. This is because, in normal multi-user operating systems, the operating system uses virtual address spaces to keep programs independent of each other.
The address space of your program is set up in part by a process call... |
42,399,201 | I'm on Laravel 5, I'm trying to integrate SAML 2.0 with it. I've found this package = <https://github.com/aacotroneo/laravel-saml2>
I tried follow their steps, but at the end when I use
```
<?php
namespace App\Http\Controllers;
class SAMLController extends Controller {
public function adminSignIn(){
r... | 2017/02/22 | [
"https://Stackoverflow.com/questions/42399201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4480164/"
] | You need to use full namespace for the facade:
```
\Saml2::login(URL::full());
```
Or add this to the top of the class:
```
use Saml2;
``` | you need to explicitly write "use" on top
>
> use Saml2;
>
>
>
This might work. |
14,060,743 | I would like a regex which will split a string at every `"."` except if the `"."` is preceded AND followed by an number. example:
`"hello world.foo 1.1 bar.1"` ==> `["hello world","foo 1.1 bar", "1"]`
I currently have:
```
"(?<![0-9])\.(?!\d)"
```
but it gives:
```
["hello world", "foo 1.1 bar.1"]
```
but it... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14060743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110718/"
] | Split on `.` if it is not preceded by a digit, or if it is not succeeded by a digit:
```
In [18]: re.split(r'(?<!\d)\.|\.(?!\d)', text)
Out[18]: ['hello world', 'foo 1.1 bar', '1']
``` | That's because only one of those assertions have to fail for the whole expression to fail. Try this:
```
"(?<![0-9])\.|\.(?!\d)"
``` |
14,060,743 | I would like a regex which will split a string at every `"."` except if the `"."` is preceded AND followed by an number. example:
`"hello world.foo 1.1 bar.1"` ==> `["hello world","foo 1.1 bar", "1"]`
I currently have:
```
"(?<![0-9])\.(?!\d)"
```
but it gives:
```
["hello world", "foo 1.1 bar.1"]
```
but it... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14060743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110718/"
] | Split on `.` if it is not preceded by a digit, or if it is not succeeded by a digit:
```
In [18]: re.split(r'(?<!\d)\.|\.(?!\d)', text)
Out[18]: ['hello world', 'foo 1.1 bar', '1']
``` | Just for the sake of contributing the shortest solution, here is mine:
(it is simply @ysth's solution with a small adjustment)
`(?<!\d(?=.\d))\.`
[working fiddle](https://regex101.com/r/duW7M8/2) |
14,060,743 | I would like a regex which will split a string at every `"."` except if the `"."` is preceded AND followed by an number. example:
`"hello world.foo 1.1 bar.1"` ==> `["hello world","foo 1.1 bar", "1"]`
I currently have:
```
"(?<![0-9])\.(?!\d)"
```
but it gives:
```
["hello world", "foo 1.1 bar.1"]
```
but it... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14060743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110718/"
] | A non-| approach:
```
(?<)\.
``` | That's because only one of those assertions have to fail for the whole expression to fail. Try this:
```
"(?<![0-9])\.|\.(?!\d)"
``` |
14,060,743 | I would like a regex which will split a string at every `"."` except if the `"."` is preceded AND followed by an number. example:
`"hello world.foo 1.1 bar.1"` ==> `["hello world","foo 1.1 bar", "1"]`
I currently have:
```
"(?<![0-9])\.(?!\d)"
```
but it gives:
```
["hello world", "foo 1.1 bar.1"]
```
but it... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14060743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110718/"
] | That's because only one of those assertions have to fail for the whole expression to fail. Try this:
```
"(?<![0-9])\.|\.(?!\d)"
``` | Just for the sake of contributing the shortest solution, here is mine:
(it is simply @ysth's solution with a small adjustment)
`(?<!\d(?=.\d))\.`
[working fiddle](https://regex101.com/r/duW7M8/2) |
14,060,743 | I would like a regex which will split a string at every `"."` except if the `"."` is preceded AND followed by an number. example:
`"hello world.foo 1.1 bar.1"` ==> `["hello world","foo 1.1 bar", "1"]`
I currently have:
```
"(?<![0-9])\.(?!\d)"
```
but it gives:
```
["hello world", "foo 1.1 bar.1"]
```
but it... | 2012/12/27 | [
"https://Stackoverflow.com/questions/14060743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110718/"
] | A non-| approach:
```
(?<)\.
``` | Just for the sake of contributing the shortest solution, here is mine:
(it is simply @ysth's solution with a small adjustment)
`(?<!\d(?=.\d))\.`
[working fiddle](https://regex101.com/r/duW7M8/2) |
47,788,142 | I'm trying to make my app run in landscape mode only, but for some reason I'm getting this very weird error and I have no idea why.
```
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="WineLab.WineLab" android:versionCode="1" android:versi... | 2017/12/13 | [
"https://Stackoverflow.com/questions/47788142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9071045/"
] | Check you have declared your `</activity>` tag outside the `<application`
Try this
```
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="WineLab.WineLab" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses... | this will work you have not entered the **.** in activity.
```
<activity android:name=".WineLab
``` |
47,788,142 | I'm trying to make my app run in landscape mode only, but for some reason I'm getting this very weird error and I have no idea why.
```
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="WineLab.WineLab" android:versionCode="1" android:versi... | 2017/12/13 | [
"https://Stackoverflow.com/questions/47788142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9071045/"
] | Check you have declared your `</activity>` tag outside the `<application`
Try this
```
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="WineLab.WineLab" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses... | I managed to get my program running without fixing the manifest error - I deleted all of that code from the AndroidManifest and forgot about it. Thank you for the help. |
5,853,726 | I'm working through Clojure Koans and I'm up to the recursion koans.
I don't understand how to solve `is-even?` using recursion. The exercise partially defines this function as:
```
(defn is-even? [n]
(if (= n 0)
true
(__ (is-even? (dec n)))))
```
If I don't want to use recursion then I would de... | 2011/05/02 | [
"https://Stackoverflow.com/questions/5853726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/312691/"
] | A number `n` is even if either:
1. `n` is 0
2. `n-1` is NOT even
So really, `not` should be enough to fill in that blank. Eventually you wind up with N `not`s around `(= 0 0)`, and most of them cancel out. | Consider decrementing by 2 for each recursion. The rest should be obvious: The number is even only if the function ends up with zero.
EDIT: Apparently I missed the memo about filling in the blank. Here is the tail call optimizable solution I had in mind for positive integers:
```
(defn is-even? [n]
(if (<= n 1)
... |
5,853,726 | I'm working through Clojure Koans and I'm up to the recursion koans.
I don't understand how to solve `is-even?` using recursion. The exercise partially defines this function as:
```
(defn is-even? [n]
(if (= n 0)
true
(__ (is-even? (dec n)))))
```
If I don't want to use recursion then I would de... | 2011/05/02 | [
"https://Stackoverflow.com/questions/5853726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/312691/"
] | Like amalloy said, fill the blanks with "not". But provided you assume the argument can only be 0 or positive, you don't need another base case: `dec` makes sure you always end up at 0, and odd numbers return false like this:
```
(is-even? 0) ==> base case (= 0 0) ==> true.
(is-even? 1) ==> (not (is-even? (dec 1))
... | Consider decrementing by 2 for each recursion. The rest should be obvious: The number is even only if the function ends up with zero.
EDIT: Apparently I missed the memo about filling in the blank. Here is the tail call optimizable solution I had in mind for positive integers:
```
(defn is-even? [n]
(if (<= n 1)
... |
5,853,726 | I'm working through Clojure Koans and I'm up to the recursion koans.
I don't understand how to solve `is-even?` using recursion. The exercise partially defines this function as:
```
(defn is-even? [n]
(if (= n 0)
true
(__ (is-even? (dec n)))))
```
If I don't want to use recursion then I would de... | 2011/05/02 | [
"https://Stackoverflow.com/questions/5853726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/312691/"
] | Like amalloy said, fill the blanks with "not". But provided you assume the argument can only be 0 or positive, you don't need another base case: `dec` makes sure you always end up at 0, and odd numbers return false like this:
```
(is-even? 0) ==> base case (= 0 0) ==> true.
(is-even? 1) ==> (not (is-even? (dec 1))
... | A number `n` is even if either:
1. `n` is 0
2. `n-1` is NOT even
So really, `not` should be enough to fill in that blank. Eventually you wind up with N `not`s around `(= 0 0)`, and most of them cancel out. |
34,981,811 | Newbie to Node here. I'm trying to download a `.tar.xz` file and extract it to a directory via the code shown below:
```
var request = require('request');
var tar = require('tar');
var xz = require('xz');
function downloadRaw(url, callback)
{
return request({
encoding: null,
url: url
}, callba... | 2016/01/24 | [
"https://Stackoverflow.com/questions/34981811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4077294/"
] | You have to append data you have in `rankings` to the table as rows `trs` using the following line :
```
$('table').append('<tr><td>' + rankPosition + '</td><td> ' +rankings[i].name + '</td><td>'
+ rankings[i].score + ' pts</td></tr>');
```
**Note :** Add `$('table tbody').empty()` before the loop to reset table c... | Add this code:
```
$('.table')
.append('<tr><td>' + rankPosition + '</td><td>' + rankPosition + '</td><td>' +rankings[i].name + ', ' + rankings[i].score + ' pts</tr>');
```
**Fiddle: <http://codepen.io/anon/pen/dGdabG>** |
59,184,177 | I am trying to print 'NA' if the output columns are empty, like
```sh
$cat file.txt
111||aa1|11a|key
|bbb|aa2|22a|key
333|ccc||33a|key
444|ddd||44a|key
555|eee|aa5|55a|key
```
If I do awk I am getting like
```sh
$awk -F'|' '{print $1,$2,$3}' file.txt
111 aa1
bbb aa2
333 ccc
444 ddd
555 eee aa5
```
But I want... | 2019/12/04 | [
"https://Stackoverflow.com/questions/59184177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3835234/"
] | You may use this `awk`:
```
awk -F '|' '{sub(/^\|/, "NA|"); gsub(/\|\|/, "|NA|"); print $1, $2, $3}' file
```
```
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
```
another variant:
```
awk -F '|' '{for(i=1; i<=3; i++) if ($i=="") $i="NA"; print $1, $2, $3}' file
```
```
111 NA aa1
NA bbb aa2
333 ccc N... | I don't think there is an idiomatic way to do it, but you could use the ternary operator to shorten it a bit:
```
awk -F'|' '{n="NA";print ($1!=""?$1:n),($2!=""?$2:n),($3!=""?$3:n)}' file.txt
```
Output:
```
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
``` |
59,184,177 | I am trying to print 'NA' if the output columns are empty, like
```sh
$cat file.txt
111||aa1|11a|key
|bbb|aa2|22a|key
333|ccc||33a|key
444|ddd||44a|key
555|eee|aa5|55a|key
```
If I do awk I am getting like
```sh
$awk -F'|' '{print $1,$2,$3}' file.txt
111 aa1
bbb aa2
333 ccc
444 ddd
555 eee aa5
```
But I want... | 2019/12/04 | [
"https://Stackoverflow.com/questions/59184177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3835234/"
] | ```
$ awk -F'|' '{print f(1), f(2), f(3)} function f(n){return ($n=="" ? "NA" : $n)}' file
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
``` | I don't think there is an idiomatic way to do it, but you could use the ternary operator to shorten it a bit:
```
awk -F'|' '{n="NA";print ($1!=""?$1:n),($2!=""?$2:n),($3!=""?$3:n)}' file.txt
```
Output:
```
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
``` |
59,184,177 | I am trying to print 'NA' if the output columns are empty, like
```sh
$cat file.txt
111||aa1|11a|key
|bbb|aa2|22a|key
333|ccc||33a|key
444|ddd||44a|key
555|eee|aa5|55a|key
```
If I do awk I am getting like
```sh
$awk -F'|' '{print $1,$2,$3}' file.txt
111 aa1
bbb aa2
333 ccc
444 ddd
555 eee aa5
```
But I want... | 2019/12/04 | [
"https://Stackoverflow.com/questions/59184177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3835234/"
] | You may use this `awk`:
```
awk -F '|' '{sub(/^\|/, "NA|"); gsub(/\|\|/, "|NA|"); print $1, $2, $3}' file
```
```
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
```
another variant:
```
awk -F '|' '{for(i=1; i<=3; i++) if ($i=="") $i="NA"; print $1, $2, $3}' file
```
```
111 NA aa1
NA bbb aa2
333 ccc N... | Another `awk`
```
awk -F'|' '{for(i=1;i<NF;i++)$i=$i!=""?$i:"NA";NF-=2}1' file
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
```
It may be better to also add some parentheses:
```
awk -F'|' '{for(i=1;i<NF;i++)($i=$i!=""?$i:"NA");NF-=2}1' file
``` |
59,184,177 | I am trying to print 'NA' if the output columns are empty, like
```sh
$cat file.txt
111||aa1|11a|key
|bbb|aa2|22a|key
333|ccc||33a|key
444|ddd||44a|key
555|eee|aa5|55a|key
```
If I do awk I am getting like
```sh
$awk -F'|' '{print $1,$2,$3}' file.txt
111 aa1
bbb aa2
333 ccc
444 ddd
555 eee aa5
```
But I want... | 2019/12/04 | [
"https://Stackoverflow.com/questions/59184177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3835234/"
] | ```
$ awk -F'|' '{print f(1), f(2), f(3)} function f(n){return ($n=="" ? "NA" : $n)}' file
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
``` | Another `awk`
```
awk -F'|' '{for(i=1;i<NF;i++)$i=$i!=""?$i:"NA";NF-=2}1' file
111 NA aa1
NA bbb aa2
333 ccc NA
444 ddd NA
555 eee aa5
```
It may be better to also add some parentheses:
```
awk -F'|' '{for(i=1;i<NF;i++)($i=$i!=""?$i:"NA");NF-=2}1' file
``` |
29,769,497 | Another noob question but I could really do with some help on this one. I am looking for a way to have a list of cells in a dynamic prototype table view and each cell to go to a new view controller. I have managed to do this to about 75% :/. Basically I have made it work but it always loads the first cell first because... | 2015/04/21 | [
"https://Stackoverflow.com/questions/29769497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4717141/"
] | >
> Which C++ cast is appropriate instead of the C-like cast? Static or reinterpret?
>
>
>
You need `reinterpret_cast` to convert an object pointer (including `void*`) to a function pointer.
>
> Can I omit the typedef in the cast?
>
>
>
If you have a pointer of the correct type available, you could specify t... | Another way of doing that is using unions.
```
union{
void *data;
cBase* (*pfunc)(void);
}converter;
//...
converter.data = m_pAceDll->symbol("?createManager@@YAPAVcBase@@XZ");
cBase *base = converter.pfunc();
``` |
38,624,039 | Let's say I have a XML file like this one:
```
<?xml version="1.0" encoding="utf-8"?>
<test>
<foo>
<bar>Hello, World!</bar>
</foo>
</test>
```
So, if I use something like this I can echo `Hello, World!`:
```
<?php
$xml = simplexml_load_file("myxml.xml");
echo $xml->foo->bar;
?>
```
But, what if I... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38624039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It's because you are trying to access 3rd level in one variable. PHP couldn't handle `->` in variable.
```
$level1 = 'foo';
$level2 = 'bar';
echo $xml->$level1->$level2;
``` | Use Xpath. It allows you to use expressions to fetch parts of an XML.
```
$xml = <<<'XML'
<?xml version="1.0" encoding="utf-8"?>
<test>
<foo>
<bar>Hello, World!</bar>
</foo>
</test>
XML;
$xml = new SimpleXMLElement($xml);
$expression = 'foo/bar';
var_dump(
(string)$xml->xpath($expression)[0]
);
``... |
38,624,039 | Let's say I have a XML file like this one:
```
<?xml version="1.0" encoding="utf-8"?>
<test>
<foo>
<bar>Hello, World!</bar>
</foo>
</test>
```
So, if I use something like this I can echo `Hello, World!`:
```
<?php
$xml = simplexml_load_file("myxml.xml");
echo $xml->foo->bar;
?>
```
But, what if I... | 2016/07/27 | [
"https://Stackoverflow.com/questions/38624039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can't do that because it will look for a property with the literal `foo->bar`, and not `bar` inside `foo`.
---
You could do it like this:
```
$xml = simplexml_load_file("myxml.xml");
$reference = "foo->bar";
$tmp = $xml;
foreach(explode('->', $reference) as $v){
$tmp = $tmp->$v;
}
echo $tmp;
```
Output:
... | Use Xpath. It allows you to use expressions to fetch parts of an XML.
```
$xml = <<<'XML'
<?xml version="1.0" encoding="utf-8"?>
<test>
<foo>
<bar>Hello, World!</bar>
</foo>
</test>
XML;
$xml = new SimpleXMLElement($xml);
$expression = 'foo/bar';
var_dump(
(string)$xml->xpath($expression)[0]
);
``... |
17,005,061 | What's the easiest way to translate this into a valid C++ 11 statement?
```
typedef struct S_NODE {
short int total;
short int move[3];
int next[3];
} NODE;
NODE* trie = (NODE *)malloc(sizeof(NODE));
trie[0]=(NODE){0,{0,0,0},{-1,-1,-1}}; // invalid C++
```
The only way I can think of is
```
NODE node = {0,{0... | 2013/06/08 | [
"https://Stackoverflow.com/questions/17005061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1709708/"
] | Set up default timezone by `date_default_timezone_set('UTC');` and read manual.
Examples: UTC, GMT, Atlantic/Azores | use this code in date function
```
date('g:i:s', time()-18000);
```
with using **time()-18000** you will fix it
Good luck ! |
68,573,655 | Controller
function edit($RegNo){
$data['row'] = $this->ManageTr`enter code here`ansfers->GetById($RegNo);
$this->load->view('admin/transferupdate', $data);
}
```
enter code here
public function update($RegNo){
$this->ManageT`enter code here`ransfers->update($RegNo);
redirect('admin/ManageTransfer/transfe... | 2021/07/29 | [
"https://Stackoverflow.com/questions/68573655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16552775/"
] | I found what is wrong. Apache's official page says: use below XML for the configuration.
```
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
... | Try connecting using `20.101.12.***` address from the outside.
Btw, what is `13.86.186.145`, why are you trying to connect to it?
*An update*:
Seems like you just copy-pasted it from the docs, you need to replace it with your own values. |
39,277,423 | I am facing the following issue. When i am removing the first element from a list box which has keyboard focus(by refreshing the item source) the keyboard focus is moving to the parent window. I want to retain the keyboard focus on the fist listbox item. So i came up with the following code
```
<Grid.Resources>
<Style... | 2016/09/01 | [
"https://Stackoverflow.com/questions/39277423",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/182040/"
] | I found answer here: [How do you programmatically set focus to the SelectedItem in a WPF ListBox that already has focus?](https://stackoverflow.com/questions/10444518/how-do-you-programmatically-set-focus-to-the-selecteditem-in-a-wpf-listbox-that)
```
var listBoxItem = (ListBoxItem) MainListBox
.ItemContainerGener... | This code applies the focus function to the first input text when the page loads. try it out
```
$(document).ready(function () {
$("#input:text:visible:first").focus();
});
``` |
7,330,793 | I am a computer engineering student studying Linux kernel development. My 4-man team was tasked to propose a kernel development project (to be implemented in 6 weeks), and we came up with a tentative "Self-Optimizing Hard Disk Drive Linux Kernel Module". I'm not sure if that title makes sense to the pros.
We based the... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7330793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/932264/"
] | You may want to take a look at Unionfs. You don't even need a LKM - just a some user-space daemon which would subscribe to inotify events, keep statistics and migrate files between partitions. Unionfs will combine both partitions into a single logical filesystem. | There are many ways in which such optimizations might be useful:
* accessing file `A` implies file `B` access is imminent. Example: opening an icon file for a media file by a media player
* accessing any file in some group `G` of files means that other files in the group will be accessed shortly. Example: `mysql` rece... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String item : searchList) {
if (item.contains("one") {
// Do something. Like adding the result to a different list.
// If you need the index from the original list, you a for instead of a for each
}
}
``` | In general, when searching an item in a `List`, the best solution is to sort your `List` first using `Collections.sort()` method. Then using the `Collections.binarySearch()` method, find your element.
In this case your elements are `String` type that are `Comparable` and can be sorted alphabetically otherwise you neede... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String word : words) {
if (word.contains("one")) {
//we have a match
}
}
``` | In general, when searching an item in a `List`, the best solution is to sort your `List` first using `Collections.sort()` method. Then using the `Collections.binarySearch()` method, find your element.
In this case your elements are `String` type that are `Comparable` and can be sorted alphabetically otherwise you neede... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
//iterate through words
for(String str : list){
//check if word contains the key
if(str.contains(key)){
//add its reference to another resultant list
result.add(str);
}
}
``` | In general, when searching an item in a `List`, the best solution is to sort your `List` first using `Collections.sort()` method. Then using the `Collections.binarySearch()` method, find your element.
In this case your elements are `String` type that are `Comparable` and can be sorted alphabetically otherwise you neede... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String item : searchList) {
if (item.contains("one") {
// Do something. Like adding the result to a different list.
// If you need the index from the original list, you a for instead of a for each
}
}
``` | You could solve this using iterators if the condition will be more complex
```
public interface IPredicate<T> {
boolean check(T t);
}
public class PredicatIterable<T> implements Iterable<T> {
private final Iterator<T> iterator;
private final IPredicate<T> predicate;
public... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
//iterate through words
for(String str : list){
//check if word contains the key
if(str.contains(key)){
//add its reference to another resultant list
result.add(str);
}
}
``` | ```
for (String word : words) {
if (word.contains("one")) {
//we have a match
}
}
``` |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String item : searchList) {
if (item.contains("one") {
// Do something. Like adding the result to a different list.
// If you need the index from the original list, you a for instead of a for each
}
}
``` | ```
for (String word : words) {
if (word.contains("one")) {
//we have a match
}
}
``` |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String word : words) {
if (word.contains("one")) {
//we have a match
}
}
``` | Of course you have to loop thru the elements. Look for ways to loop thru an ArrayList: that can be indexed or with the
```
for (x : collect)
```
notation.
In the loop you have to do some pattern matching. Read String Java API doc for a method.
(Give'em some think food ...) |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
//iterate through words
for(String str : list){
//check if word contains the key
if(str.contains(key)){
//add its reference to another resultant list
result.add(str);
}
}
``` | You could solve this using iterators if the condition will be more complex
```
public interface IPredicate<T> {
boolean check(T t);
}
public class PredicatIterable<T> implements Iterable<T> {
private final Iterator<T> iterator;
private final IPredicate<T> predicate;
public... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
for (String word : words) {
if (word.contains("one")) {
//we have a match
}
}
``` | You could solve this using iterators if the condition will be more complex
```
public interface IPredicate<T> {
boolean check(T t);
}
public class PredicatIterable<T> implements Iterable<T> {
private final Iterator<T> iterator;
private final IPredicate<T> predicate;
public... |
6,731,350 | ```
ArrayList searchList = new ArrayList();
ArrayList words=(ArrayList) request.getSession().getAttribute("words");
words.add("one");
words.add("twenty one");
words.add("thirty one");
words.add("two");
words.add("twenty two");
words.add("thirty two");
words.add("three");
words.add("twenty three");
words.add("thirty thr... | 2011/07/18 | [
"https://Stackoverflow.com/questions/6731350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/849799/"
] | ```
//iterate through words
for(String str : list){
//check if word contains the key
if(str.contains(key)){
//add its reference to another resultant list
result.add(str);
}
}
``` | Of course you have to loop thru the elements. Look for ways to loop thru an ArrayList: that can be indexed or with the
```
for (x : collect)
```
notation.
In the loop you have to do some pattern matching. Read String Java API doc for a method.
(Give'em some think food ...) |
80,240 | I have a ton of the [Unusual Gem](http://www.uesp.net/wiki/Skyrim:Unusual_Gem#Unusual_Gem) items stuck in my inventory.
It was a long evening, and I have lost the chance to go back to a save point before I picked up the [No Stone Unturned](http://www.uesp.net/wiki/Skyrim:No_Stone_Unturned) quest.
These stupid rocks... | 2012/08/10 | [
"https://gaming.stackexchange.com/questions/80240",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/29606/"
] | From the quest items page on the [skyrim wiki](http://elderscrolls.wikia.com/wiki/Quest_Items_(Skyrim)):
>
> While quest items do display a weight, they do not use up the inventory's available space.
>
>
>
So you don't have to worry about quest items sitting in your inventory :) | You are indeed stuck with the gems without the use of console or mod if you cannot complete the quest.
There may be a mod that makes them weightless (I cannot search the steam workshop myself the coming few days).
And as @yx suggested, you can use the console if you are on PC with the command `player.removeitem 000... |
62,120,387 | I'm a newbie coder and I need some help with the `xxx.find` usages...
**Summary**
I am doing a web automation project with selenium.
This python project's main goal is
**Step 1**. To login into my school's LMS website automatically with provided username and password
**Step 2**. Get the page\_source of a given we... | 2020/05/31 | [
"https://Stackoverflow.com/questions/62120387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12783754/"
] | FreeMarker generates static HTML output and nothing more.
In a website the only way to do what you are asking for (change page content without reloading) is to use JavaScript (React also uses JavaScript underneath).
You could detect when someone changed something (eg user list) using WebSocket, long-polling, etc.
[S... | >
> without page reloading
>
>
>
That's going to be Ajax operation (if you're after the basic solution).
* Implement jQuery on change function that watched menu select option change
* In the on change write AJAX `$.post` to your service/controller, get the response value or JSON object and apply it to page using ... |
450,826 | I used iMessage with my cell number in the US. I moved away from the US and cancelled my cell plan. I can still use iMessage to talk to people who have iPhones. But I did not update any information in the app or configuration (such as phone number).
Is there any potential issue with someone being reissued my old numbe... | 2022/11/20 | [
"https://apple.stackexchange.com/questions/450826",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/87482/"
] | There's a potential issue for **any** app or service you have that uses your phone number as a primary or secondary address source. You need to remove/change the number in everything from iMessage to WhatsApp, and also any service you use which has your phone number as a 2FA/backup/lost password path.
The time from ab... | When you de-activate your phone number it should de-activate from iMessage. Your messages will start coming from your email address, and people will need to send new messages to your email address.
Your existing messages will not be deleted, and if you switch to a new number or an email address, you will continue bein... |
5,285,741 | I successfully compiled swftools using their instructions (http://wiki.swftools.org/index.php/FAQ) on my Fedora 14 machine. I want to use one of the tools (pdf2swf) on another Linux machine. When I move it and run it on the other machine it asks for some shared libraries. Is it possible to compile swftools (in particul... | 2011/03/12 | [
"https://Stackoverflow.com/questions/5285741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/523049/"
] | it's trivial: link with -static. of course, this implies that you'll need static libraries installed. the linker (often called through cc) simply defaults to using shared libraries when both are available.
```
[hahn@box ~]$ cat hello.c
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return 0;
}
[h... | Well, what you want are statically linked libraries, as opposed to dynamically/shared libraries.
You need to compile your application and link it statically. If you use gcc you can apply the static switch to your call of the compiler:
```
gcc -static <and the whole gcc shebang>
```
Most of the times you can edit th... |
7,157,403 | I have a web application that uses jQuery to dynamically create an silverlight object.
This works well in Chrome and Firefox, but not in IE9.
Here's a jsFiddle which demonstrates this: <http://jsfiddle.net/Bx9we/5/>
In this example, the link to the .XAP file is fake, but your browsers should at least display the o... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25216/"
] | Well it works, if you use correct html:
<http://jsfiddle.net/Bx9we/7/>
When creating an object tag in IE, you can not create it then add it to the dom
in 2 operations. You have to create the object tag in an html string, then add the string to the dom.
$('some html').appendTo first creates the dom node - which won't... | Are you running IE in 64bit mode? 64bit is supported in SL5 but not in SL4. |
7,157,403 | I have a web application that uses jQuery to dynamically create an silverlight object.
This works well in Chrome and Firefox, but not in IE9.
Here's a jsFiddle which demonstrates this: <http://jsfiddle.net/Bx9we/5/>
In this example, the link to the .XAP file is fake, but your browsers should at least display the o... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/25216/"
] | Well it works, if you use correct html:
<http://jsfiddle.net/Bx9we/7/>
When creating an object tag in IE, you can not create it then add it to the dom
in 2 operations. You have to create the object tag in an html string, then add the string to the dom.
$('some html').appendTo first creates the dom node - which won't... | Would you not be better off having your Silverlight object in the original page (hidden) and simply move it to the appropriate div using JQuery where needed? Calls onto that object from JS are trivial (e.g. to tell it what to play). |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | You can specify json configurations using the Json builder, which you pass into the KotlinxSerializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(Json {
isLenient = true
ignoreUnknownKeys = true
})
}
}
```
Th... | This is how you can configure the JsonConfig for the Spring reactive Webclient:
```
val json = Json { ignoreUnknownKeys = true isLenient = true }
val strategies = ExchangeStrategies
.builder()
.codecs { clientDefaultCodecsConfigurer ->
run {
clientDefaultCodecsConfigurer.defaultCodecs()
... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | After Kotlin **1.4.0** released:
use this for converting string to Object:
```kotlin
val response = Json {
ignoreUnknownKeys = true
}.decodeFromString(ResponseObject.serializer(), jsonString)
```
And for your httpClient use:
```
HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer()
... | For ktor 2.0+
```kotlin
return HttpClient(CIO) {
engine {
maxConnectionsCount = 10
}
install(ContentNegotiation) {
json(kotlinx.serialization.json.Json {
ignoreUnknownKeys = true
})
}
... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | You can specify json configurations using the Json builder, which you pass into the KotlinxSerializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(Json {
isLenient = true
ignoreUnknownKeys = true
})
}
}
```
Th... | With the "1.0.0RC" version, the use with retrofit is as follows.
```
Retrofit.Builder()
.client(okHttpClient)
.baseUrl(Env.BASE_URL)
.addConverterFactory(Json{
isLenient = true
ignoreUnknownKeys = true
}.asConverterFactory(MediaType.get("application/json")))
... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | This change very often, but with Kotlin 1.4.10 and Ktor 1.4.1 you need to pass a **kotlinx** Json (be careful because there is also a `io.ktor.client.features.json.Json`, I used an import alias to distinguish them because I needed both `import kotlinx.serialization.json.Json as KotlinJson`)
```
val client = HttpClient... | For ktor 2.0+
```kotlin
return HttpClient(CIO) {
engine {
maxConnectionsCount = 10
}
install(ContentNegotiation) {
json(kotlinx.serialization.json.Json {
ignoreUnknownKeys = true
})
}
... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | This change very often, but with Kotlin 1.4.10 and Ktor 1.4.1 you need to pass a **kotlinx** Json (be careful because there is also a `io.ktor.client.features.json.Json`, I used an import alias to distinguish them because I needed both `import kotlinx.serialization.json.Json as KotlinJson`)
```
val client = HttpClient... | Working from Rodion Altshuler's answer above, this is what worked for me in my KMP project:
```
install(JsonFeature) {
serializer = KotlinxSerializer(kotlinx.serialization.json.Json(JsonConfiguration.Stable.copy(strictMode = false))).apply {
useDefaultTransformers = true
}
}
``` |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | You can specify json configurations using the Json builder, which you pass into the KotlinxSerializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(Json {
isLenient = true
ignoreUnknownKeys = true
})
}
}
```
Th... | For ktor 2.0+
```kotlin
return HttpClient(CIO) {
engine {
maxConnectionsCount = 10
}
install(ContentNegotiation) {
json(kotlinx.serialization.json.Json {
ignoreUnknownKeys = true
})
}
... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | You can specify json configurations using the Json builder, which you pass into the KotlinxSerializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(Json {
isLenient = true
ignoreUnknownKeys = true
})
}
}
```
Th... | Figured out - we can pass in constructor:
```
serializer = KotlinxSerializer(Json.nonstrict)
``` |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | This change very often, but with Kotlin 1.4.10 and Ktor 1.4.1 you need to pass a **kotlinx** Json (be careful because there is also a `io.ktor.client.features.json.Json`, I used an import alias to distinguish them because I needed both `import kotlinx.serialization.json.Json as KotlinJson`)
```
val client = HttpClient... | It seems that for 1.4.32 I have it as follows:
```kotlin
install(JsonFeature) {
serializer = KotlinxSerializer(json = kotlinx.serialization.json.Json {
isLenient = true
ignoreUnknownKeys = true
})
}
``` |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | This change very often, but with Kotlin 1.4.10 and Ktor 1.4.1 you need to pass a **kotlinx** Json (be careful because there is also a `io.ktor.client.features.json.Json`, I used an import alias to distinguish them because I needed both `import kotlinx.serialization.json.Json as KotlinJson`)
```
val client = HttpClient... | For those who use retrofit, you might want to consider using `JsonConfiguration(strictMode = false)` on the retrofit builder.
E.g:
```
// your retrofit builder
Retrofit.Builder()
.baseUrl(url)
.client(okHttpClient)
.client(httpClient)
.addConverterFactory(
Json(JsonConfigurat... |
53,547,437 | I'm trying to initialize Ktor http client and setup json serialization. I need to allow non-strict deserialization which **JSON.nonstrict** object allows. Just can't get how to apply this setting to serializer.
```
val client = HttpClient {
install(JsonFeature) {
serializer = Kotli... | 2018/11/29 | [
"https://Stackoverflow.com/questions/53547437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1894927/"
] | After Kotlin **1.4.0** released:
use this for converting string to Object:
```kotlin
val response = Json {
ignoreUnknownKeys = true
}.decodeFromString(ResponseObject.serializer(), jsonString)
```
And for your httpClient use:
```
HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer()
... | For those who use retrofit, you might want to consider using `JsonConfiguration(strictMode = false)` on the retrofit builder.
E.g:
```
// your retrofit builder
Retrofit.Builder()
.baseUrl(url)
.client(okHttpClient)
.client(httpClient)
.addConverterFactory(
Json(JsonConfigurat... |
31,182,821 | I would like to format a time duration (e.g. in seconds) in a String which would contain the localized names of time units. For example for input 8692 I would get string "2 h 24 min 52 sec" with the time units correctly localized for each language. Is there some class in Android that could do this? Does anyone know som... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31182821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2428871/"
] | This line is wrong:
```
post_save.connect(notify_after_registration(sender), sender=User)
```
you should not call your receiver function here when you are connecting it
you should do:
```
post_save.connect(notify_after_registration, sender=User)
```
`post_save` is a built-in Django signal so it will be sent auto... | You can pass the arguments as keyword arguments (`kwargs`) as `activation_key=...`, `username=...` and so on. The receiver takes them in the `kwargs`: `kwargs['activation_key']`, `kwargs['username']`.
Reference: [Django docs: Signals](https://docs.djangoproject.com/en/1.8/topics/signals/#receiver-functions).
EDIT: Yo... |
1,637,939 | [](https://i.stack.imgur.com/WKHrS.png)
I have showed $C^1$ is not complete by taking $f\_n(x)=\sqrt{x+\frac{1}{n}}$ and showed is converges uniformly but limit doe not belong to $C\_1$ (not differentiable at 0). Is this correct using the equivalent d... | 2016/02/02 | [
"https://math.stackexchange.com/questions/1637939",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/292589/"
] | $M^{17}$ is encoded as $(((M^2)^2)^2)^2\times M$ because it's faster that way. (I don't know why the $(1)^2$ is in there.)
The naive way of obtaining $M^{17}$ requires $16$ successive multiplications of $M$. By comparison, if you apply the square function to $M$ (and then its results) four times, you reduce the count ... | The example follows the algorithm for computing $M^e$ (mod $n$) described at the bottom of page 8 of the paper. Here's an implementation in Python:
```
def binary(e):
bits = []
while e > 0:
b = e % 2
bits.append(b)
e = e >> 1
bits.reverse()
return bits
def pow(M, e, n):
bit... |
74,220 | I'm coming to Computer Science from Mathematics and am familiar with the idea of building classes of objects using Propositional Logic. Namely, start with some universe of objects, define some proposition $P \left( x \right)$, and then iterate over the universe of objects, applying $P \left( x \right)$ to each; keep th... | 2017/04/19 | [
"https://cs.stackexchange.com/questions/74220",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/21161/"
] | >
> Should I include this algorithm in $\mathbb{P}$?
>
>
>
Yes. Since the algorithm is asymptotically bounded above by $O(n)$ the algorithm is in $\mathbb{P}$.
>
> If zero $\in O(1)$, . . .
>
>
>
Zero is in $O(1)$.
>
> . . . so often material I study from doesn't distinguish between Big-O and Big-Theta
> ... | P is not a set of algorithms, it is a set of *languages*, where a language is a subset of $\{0, 1\}^\*$. In your terminology, the universe of discourse is the power set of $\{0, 1\}^\*$ (Russell's paradox is not an issue). P contains exactly those languages $L$ for which there exists a Turing machine $M$ with the follo... |
17,473,787 | I have designed a crawler where there will be two spiders.I have designed these using scrapy.
These spiders will run independently by fetching data from the database.
We are running these spiders using a reactor.As we know that we cannot run the reactor repeatedly
we give some 500+ links to the second spider to... | 2013/07/04 | [
"https://Stackoverflow.com/questions/17473787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2513500/"
] | Easiest way would be to disable the Telnet Console by adding this to your `settings.py`:
```
EXTENSIONS = {
'scrapy.telnet.TelnetConsole': None
}
```
See also <http://doc.scrapy.org/en/latest/topics/settings.html#extensions> for a list of by-default enabled extensions. | Your problem could be solved by running fewer concurrent crawlers. Here's a recipe I wrote for making requests sequentially:
This particular class only runs one crawler, but the modifications required to make it run batches (say 10 at a time) are trivial.
```
class SequentialCrawlManager(object):
"""Start spiders ... |
16,913,309 | I'm trying to write a prolog program which needs to have a predicate that does returns minimum variable every time it called. But i need it in such a way that if you yield the function, it should return next minimum value. For example:
```
min([5,3,2,7],B).
B = 2 ;
B = 3 ;
B = 5 ;
B = 7 ;
false.
```
Any ideas? | 2013/06/04 | [
"https://Stackoverflow.com/questions/16913309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2334907/"
] | ```
min(L, Min) :- sort(L, S), member(Min, S).
```
will do for your example data. More generally, [setof](http://www.swi-prolog.org/pldoc/doc_for?object=setof/3)/3 will allow to build a sorted list of solutions to a generic goal.
*edit*: without sorting, a somewhat involved solution based on [select](http://www.swi-... | In general, you cannot rely on the order of solutions, in a somewhat weird system member might be implemented differently:
```
member2(X,[_|Xs]) :-
member2(X,Xs).
member2(X,[X|_]).
min(L, Min) :-
sort(L, S),
member2(Min, S).
```
yielding:
```
?- min([2,1,4,3,2],X).
X = 4 ;
X = 3 ;
X = 2 ;
X = 1.
```... |
64,209,558 | I'm creating a fully convolutional neural network, which given an image in input is capable to identify zones in it (black, 0), and also identify background (white, 255).
My targets are binarized images (ranging 0-255), and I'd like to get some balancing between my two semantic classes (0 or 255).
in fact I get 1.8 tim... | 2020/10/05 | [
"https://Stackoverflow.com/questions/64209558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13338574/"
] | Thanks a lot @qmeeus, you showed me the path to success !
I did not know the difference between keras.losses.BinaryCrossentropy and keras.losses.binary\_crossentropy, but it is a major one.
Here's how I did :
```
def custom_binary_crossentropy(y_true, y_pred):
"""
Used to reequilibrate the data, as there i... | You are using `keras.losses.BinaryCrossentropy` in the wrong way. You actually want the functional version of this loss, which is `tf.keras.losses.binary_crossentropy`
see <https://www.tensorflow.org/api_docs/python/tf/keras/losses/BinaryCrossentropy> and <https://www.tensorflow.org/api_docs/python/tf/keras/losses/bin... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Check around the farm supply places - they carry big dampers. I used to have one about 36" square (the ex still has it). Try places like [here](http://www.farmtek.com/farm/supplies/home) and [here](http://www.tractorsupply.com/). | I know this is an old question, but here's another solution. Use foam insulation board to make an open-top box around the fan in the attic, sealed down to the ceiling. Make a top, cut it in half, and hinge each half on the side so it swings up by air pressure when the fan is turned on, then falls closed by gravity when... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | There are covers you can purchase, or easily make, to insulate your attic fan. The cover attaches to the bottom of the fan (inside your house) with magnets or velcro. The magnets are cosmetically more appealing, as you'll see the velcro when the insulation is not on. It's very convenient, because you don't have to clim... | You could make an insulated panel that is spring-loaded to the open position. Keep it closed with door holder magnets [like this](http://www.americanlocksets.com/lcn-sem7850-magnetic-holder-p-4178.html) .You could wire the fan and magnets to a double pole switch that cuts magnet power at the same time it turns on power... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Build a box that goes **over** the whole fan (on the attic side) in the winter-time. weatherstrip the bottom and weight as needed. This is also my preferred approach to the attic stairs that don't seal worth a darn. Duct-board (foil-stiff\_fiberglass-foil) is probably the best material if you can find it - use aluminum... | I know this is an old question, but here's another solution. Use foam insulation board to make an open-top box around the fan in the attic, sealed down to the ceiling. Make a top, cut it in half, and hinge each half on the side so it swings up by air pressure when the fan is turned on, then falls closed by gravity when... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | There are covers you can purchase, or easily make, to insulate your attic fan. The cover attaches to the bottom of the fan (inside your house) with magnets or velcro. The magnets are cosmetically more appealing, as you'll see the velcro when the insulation is not on. It's very convenient, because you don't have to clim... | Brainstorming here, but a heavy enough door with a rubber gasket, that can rest on a gasket on the fan might do the trick. the levers to lift the door away will have to be strong enough. The only other idea is a set of electromagnets that could "pull" the door shut...wish I could offer a better solution. |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | I used two layers of window plastic sheeting shrink wrap -- applied just as you would to seal a window with plastic in winter. Done in no time. Cost: $2. One layer is supposed to reduce up to 35% drafts, so hopefully two layers will be more effective. On this 26-degree day, already much warmer in the hall. | Brainstorming here, but a heavy enough door with a rubber gasket, that can rest on a gasket on the fan might do the trick. the levers to lift the door away will have to be strong enough. The only other idea is a set of electromagnets that could "pull" the door shut...wish I could offer a better solution. |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Build a box that goes **over** the whole fan (on the attic side) in the winter-time. weatherstrip the bottom and weight as needed. This is also my preferred approach to the attic stairs that don't seal worth a darn. Duct-board (foil-stiff\_fiberglass-foil) is probably the best material if you can find it - use aluminum... | You could make an insulated panel that is spring-loaded to the open position. Keep it closed with door holder magnets [like this](http://www.americanlocksets.com/lcn-sem7850-magnetic-holder-p-4178.html) .You could wire the fan and magnets to a double pole switch that cuts magnet power at the same time it turns on power... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Check around the farm supply places - they carry big dampers. I used to have one about 36" square (the ex still has it). Try places like [here](http://www.farmtek.com/farm/supplies/home) and [here](http://www.tractorsupply.com/). | You could make an insulated panel that is spring-loaded to the open position. Keep it closed with door holder magnets [like this](http://www.americanlocksets.com/lcn-sem7850-magnetic-holder-p-4178.html) .You could wire the fan and magnets to a double pole switch that cuts magnet power at the same time it turns on power... |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Check around the farm supply places - they carry big dampers. I used to have one about 36" square (the ex still has it). Try places like [here](http://www.farmtek.com/farm/supplies/home) and [here](http://www.tractorsupply.com/). | Brainstorming here, but a heavy enough door with a rubber gasket, that can rest on a gasket on the fan might do the trick. the levers to lift the door away will have to be strong enough. The only other idea is a set of electromagnets that could "pull" the door shut...wish I could offer a better solution. |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | Build a box that goes **over** the whole fan (on the attic side) in the winter-time. weatherstrip the bottom and weight as needed. This is also my preferred approach to the attic stairs that don't seal worth a darn. Duct-board (foil-stiff\_fiberglass-foil) is probably the best material if you can find it - use aluminum... | Brainstorming here, but a heavy enough door with a rubber gasket, that can rest on a gasket on the fan might do the trick. the levers to lift the door away will have to be strong enough. The only other idea is a set of electromagnets that could "pull" the door shut...wish I could offer a better solution. |
41,855 | I have a whole house fan installed in my house from the previous owners. I love the fan, as it lets me cool down the house quickly in the evening -- or after I fill the house with smoke from forgetting about food on the stove! :)
However, as I try to air seal my house it is immediately apparent that the whole house fa... | 2014/05/10 | [
"https://diy.stackexchange.com/questions/41855",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/2552/"
] | There are covers you can purchase, or easily make, to insulate your attic fan. The cover attaches to the bottom of the fan (inside your house) with magnets or velcro. The magnets are cosmetically more appealing, as you'll see the velcro when the insulation is not on. It's very convenient, because you don't have to clim... | I know this is an old question, but here's another solution. Use foam insulation board to make an open-top box around the fan in the attic, sealed down to the ceiling. Make a top, cut it in half, and hinge each half on the side so it swings up by air pressure when the fan is turned on, then falls closed by gravity when... |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Something that commonly happens is that the manifest file isn't named properly. Double check the name (and extension) and be sure that it doesn't end with *.txt* (for example).
In order to determine this, make sure you aren't hiding file extensions:
1. Open Windows Explorer
2. Go to Folder and Search Options > View t... | In my case it was the problem of building the extension, I was pointing at an extension src (with manifest and everything) but without a build.
If you run into this scenario run
`npm i`
then
`npm build` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | If you are downloading samples from developer.chrome.com its possible that your actual folder is contained in a folder with the same name and this is creating a problem. For example your extracted sample extension named tabCapture will lool like this:
```
C:\Users\...\tabCapture\tabCapture
``` | On Linux (fedora) I was able to solve the problem by changing the path to the folder.
By default, it selected `~/path-to-folder`
I thus forced it to use `/home/user/path-to-folder` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Mine also was funny. While copypasting " manifest.json" from the tutorial, i also managed to copy a leading space. Couldn't get why it's not finding it. | If you are downloading samples from developer.chrome.com its possible that your actual folder is contained in a folder with the same name and this is creating a problem. For example your extracted sample extension named tabCapture will lool like this:
```
C:\Users\...\tabCapture\tabCapture
``` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Something that commonly happens is that the manifest file isn't named properly. Double check the name (and extension) and be sure that it doesn't end with *.txt* (for example).
In order to determine this, make sure you aren't hiding file extensions:
1. Open Windows Explorer
2. Go to Folder and Search Options > View t... | If you are downloading samples from developer.chrome.com its possible that your actual folder is contained in a folder with the same name and this is creating a problem. For example your extracted sample extension named tabCapture will lool like this:
```
C:\Users\...\tabCapture\tabCapture
``` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Something that commonly happens is that the manifest file isn't named properly. Double check the name (and extension) and be sure that it doesn't end with *.txt* (for example).
In order to determine this, make sure you aren't hiding file extensions:
1. Open Windows Explorer
2. Go to Folder and Search Options > View t... | On Linux (fedora) I was able to solve the problem by changing the path to the folder.
By default, it selected `~/path-to-folder`
I thus forced it to use `/home/user/path-to-folder` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Mine also was funny. While copypasting " manifest.json" from the tutorial, i also managed to copy a leading space. Couldn't get why it's not finding it. | On Linux (fedora) I was able to solve the problem by changing the path to the folder.
By default, it selected `~/path-to-folder`
I thus forced it to use `/home/user/path-to-folder` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | My problem was slightly different.
By default Eclipse saved my manifest.json as an ANSI encoded text file.
Solution:
* Open in Notepad
* File -> Save As
* select UTF-8 from the encoding drop-down in the bottom left.
* Save | Mine also was funny. While copypasting " manifest.json" from the tutorial, i also managed to copy a leading space. Couldn't get why it's not finding it. |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Mine also was funny. While copypasting " manifest.json" from the tutorial, i also managed to copy a leading space. Couldn't get why it's not finding it. | Kindly check whether you have installed right version of ChromeDriver or not . In my case , installing correct version helped. |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | My problem was slightly different.
By default Eclipse saved my manifest.json as an ANSI encoded text file.
Solution:
* Open in Notepad
* File -> Save As
* select UTF-8 from the encoding drop-down in the bottom left.
* Save | In my case it was the problem of building the extension, I was pointing at an extension src (with manifest and everything) but without a build.
If you run into this scenario run
`npm i`
then
`npm build` |
12,533,661 | I'm a new chrome extension developer, and I was going through the Chrome tutorial on making a "Hello World" extension, here's my code:
```
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
... | 2012/09/21 | [
"https://Stackoverflow.com/questions/12533661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689242/"
] | Mine also was funny. While copypasting " manifest.json" from the tutorial, i also managed to copy a leading space. Couldn't get why it's not finding it. | In my case it was the problem of building the extension, I was pointing at an extension src (with manifest and everything) but without a build.
If you run into this scenario run
`npm i`
then
`npm build` |
2,796,399 | Is it possible to add a record to the dns cache from java? Or will I have to use the JNI? | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215969/"
] | >
> Is it possible to add a record to the dns cache from java? Or will I have to use the JNI?
>
>
>
Assuming that you are talking about the DNS cache that Java applications use, the answer is No in both cases.
The cache is implemented in the java.net.InetAddress class; refer [here](http://www.docjar.com/html/api/... | Java DNS caching is implemented in a manner that should be mostly transparent to your code. You can read the javadoc of [InetAddress](http://java.sun.com/javase/6/docs/api/java/net/InetAddress.html) to learn more about how you can configure the cache. But since it serves as a JVM-wide transparent proxy, the best way yo... |
2,796,399 | Is it possible to add a record to the dns cache from java? Or will I have to use the JNI? | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215969/"
] | >
> Is it possible to add a record to the dns cache from java? Or will I have to use the JNI?
>
>
>
Assuming that you are talking about the DNS cache that Java applications use, the answer is No in both cases.
The cache is implemented in the java.net.InetAddress class; refer [here](http://www.docjar.com/html/api/... | Why don't you just configure java for using the proxy?
```
java -DproxySet=true -DproxyHost=proxy -DproxyPort=8080 MyApp
```
or
```
System.setProperty("proxyPort","8080");
System.setProperty("proxyHost","proxy");
```
will do it. |
2,796,399 | Is it possible to add a record to the dns cache from java? Or will I have to use the JNI? | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215969/"
] | Java DNS caching is implemented in a manner that should be mostly transparent to your code. You can read the javadoc of [InetAddress](http://java.sun.com/javase/6/docs/api/java/net/InetAddress.html) to learn more about how you can configure the cache. But since it serves as a JVM-wide transparent proxy, the best way yo... | Why don't you just configure java for using the proxy?
```
java -DproxySet=true -DproxyHost=proxy -DproxyPort=8080 MyApp
```
or
```
System.setProperty("proxyPort","8080");
System.setProperty("proxyHost","proxy");
```
will do it. |
174,725 | Let's say that I am building an application to a DEB package, which has as recommended dependency a package, let's call it package1.
So, package1, if installed, can provide extra functionality to my program, but not directly related to my program's basic functionality (that's why it is a recommended package)
So, the ... | 2012/08/11 | [
"https://askubuntu.com/questions/174725",
"https://askubuntu.com",
"https://askubuntu.com/users/31053/"
] | You might take example on the totem media player when it prompts the user to install missing codecs, or when you open share options of a directory in nautilus via right click, it prompts to install samba.
I think they use the `sessioninstaller` package to do that. See `man session-installer`, and <https://launchpad.ne... | This is an old question but I've found the answer, which is `apturl`.
It works as follows:
`apturl apt:packagename` and it is exactly what I need and what nautilus uses!
Importantly, it is available pre-installed on many linux distros :) |
174,725 | Let's say that I am building an application to a DEB package, which has as recommended dependency a package, let's call it package1.
So, package1, if installed, can provide extra functionality to my program, but not directly related to my program's basic functionality (that's why it is a recommended package)
So, the ... | 2012/08/11 | [
"https://askubuntu.com/questions/174725",
"https://askubuntu.com",
"https://askubuntu.com/users/31053/"
] | If you're using python, `python-aptdaemon-gtk` is probably the way to go. For a good example of how to do this, look at `/usr/share/doc/python-aptdaemon.gtk3widgets/examples/gtk3-demo.py.gz`
You get nice install prompts like:

In the case of using C++, you could ... | This is an old question but I've found the answer, which is `apturl`.
It works as follows:
`apturl apt:packagename` and it is exactly what I need and what nautilus uses!
Importantly, it is available pre-installed on many linux distros :) |
74,409,510 | Hi How can we control the line space? It seems we can only adjust font
For example, how can I make 'my name' 'is' closer to each other without changing the font?
```
import PySimpleGUI as sg
layout = [
[sg.pin(sg.T('Hello'))],
[sg.pin(sg.T('my name'))],
[sg.pin(sg.T('is'))],
[sg.pin(sg.T('Mike'))],
]
... | 2022/11/12 | [
"https://Stackoverflow.com/questions/74409510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20043803/"
] | Try this, to dynamically create the column names and avoid hardcoding the speed:
```
for (i in 1:nrow(Aircraft)) {
varname <- paste("Time",Aircraft$type[i] , sep="_")
Destination[[varname]] <-with(Destination, Distance/Aircraft$Speed[i])
}
Destination
Location Distance Time_X Time_Y Time_Z
1 A ... | Would this work?
```
library(dplyr)
Destination<-mutate(Destination
,TimeX=Distance/50
,TimeY=Distance/60
,TimeZ=Distance/70 )
Destination
Location Distance TimeX TimeY TimeZ
A 50 1 0.8333333 0.7142857
B 150 3 ... |
74,409,510 | Hi How can we control the line space? It seems we can only adjust font
For example, how can I make 'my name' 'is' closer to each other without changing the font?
```
import PySimpleGUI as sg
layout = [
[sg.pin(sg.T('Hello'))],
[sg.pin(sg.T('my name'))],
[sg.pin(sg.T('is'))],
[sg.pin(sg.T('Mike'))],
]
... | 2022/11/12 | [
"https://Stackoverflow.com/questions/74409510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20043803/"
] | You first have to merge your datasets together, then, after computing your new variables, restructure to wide format.
For the merge, it looks like you want to match all rows in `Aircraft` with all rows in `Destnation`. This is called a “Cartesian” or [“cross join,”](https://en.wikipedia.org/wiki/Join_(SQL)) and can be... | Would this work?
```
library(dplyr)
Destination<-mutate(Destination
,TimeX=Distance/50
,TimeY=Distance/60
,TimeZ=Distance/70 )
Destination
Location Distance TimeX TimeY TimeZ
A 50 1 0.8333333 0.7142857
B 150 3 ... |
30,380,283 | Please suggest any solution?
I'm new to android.I'm getting error while invoking web service
```
W/System.err﹕ java.io.IOException: Method Not Allowed
```
Here is my activity which calls a web service(method) which takes one string parameter and gives output. I'd be glad if anybody posts code snippet using asynctask... | 2015/05/21 | [
"https://Stackoverflow.com/questions/30380283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4921136/"
] | As I'm new to programming, I can't tell you why this happens, but I was having the exact same problem. If you install a package using meteor add (package) while you have your app open in a code editor, it causes the app to break. Try closing the editor and refreshing everything. It worked for me. | Kill the meteor processes and reset the project.
```
ps aux | grep meteor
kill -1 [PID_OF_METEOR_PROC]
cd /path/to/project/
meteor reset
```
Replace [PID\_OF\_METEOR\_PROC] with the actual PID or run once for each PID, and use the correct path to your meteor project |
71,176,119 | I have a very big array, I will try to explain the issue in small examples:
Input:
```
Array (
[alert:accountDisabled:heading] => XYZ
[alert:accountDisabled:message] => XYZ
[alert:accountExpired:heading] => XYZ
[alert:accountExpired:message] => XYZ
[alert:errorResponse:heading] => XYZ
[button:back] => XYZ
)
``... | 2022/02/18 | [
"https://Stackoverflow.com/questions/71176119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
$input = [
'alert:accountDisabled:heading' => 'XYZ_1',
'alert:accountDisabled:message' => 'XYZ_2',
'alert:accountExpired:heading' => 'XYZ_3',
'alert:accountExpired:message' => 'XYZ_4',
'alert:errorResponse:heading' => 'XYZ_5',
'button:back' => 'XYZ_6'
];
$results = [];... | Based on Lukas.j answer, you can use this function:
```
function parsePath($array, $separator = ':'){
$result = [];
foreach($array as $key => $value){
if(strpos($key, $separator) !== FALSE){
$keys = explode($separator, $key);
$inner_result = $value;
foreach (array_revers... |
6,049,075 | OK this is probably a really stupid question but I can't seem to find the answer.
I know how to sort arrays using sort descriptors but what about a simple array containing only a series of numbers?
For example an array containing the following numbers:
21,3,11,58,32,76,19,45,7,92
I just need the numbers in ascending... | 2011/05/18 | [
"https://Stackoverflow.com/questions/6049075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/659152/"
] | I'm assuming you mean an `NSArray` of `NSNumber`s.
Fairly simple:
```
NSArray *unorderedNumbers; // assume exists
NSArray *sortedArray = [unorderedNumbers
sortedArrayUsingSelector:@selector(compare:)];
```
(See [sortedArrayUsingSelector:](http://developer.apple.com/library/mac/documentation/cocoa/re... | The C standard library includes `qsort`
See: <http://www.cplusplus.com/reference/clibrary/cstdlib/qsort/> |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | It's a convention, but a particularly useful one when you think about it. In general, if a program succeeds that's all you need to know. If it fails, however, you might need to know all kinds of information about the failure - why it happened, how to fix it, etc. Having zero mean 'success' and non-zero mean failure let... | Maybe a good way to remember it is :
* Return codes answer "what's the answer?" true (or other result) or false
* Exit codes answer "what's the problem?" exit code or no problem (0) |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | It's just a convention that a 0 exit code means success. [EXIT\_SUCCESS](http://www.cplusplus.com/reference/clibrary/cstdlib/EXIT_SUCCESS/) will be 0 on almost every modern system.
EDIT:
"why both test 0 and test 1 returns 0(success) ?"
That's a completely different question. The answer is that passing a single argu... | it's a convention dated back to the early days of Unix.
By convention, all system calls return 0 if succeed, non-zero otherwise, because then different numbers can be used to indicate different reason of failure.
Shells follow this convention, 0 means last command succeeded, non-zero otherwise. Similarly, the non-zer... |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | Bash is a programming (scripting) language, but it's also a shell and a user-interface. If `0` was error, then the program could only present one kind of error.
However in Bash, any nonzero value is an error, and we may use any number from 1-255 to represent an error. This means we can have many different kinds of err... | Although the question is not tagged for C programming and most answers seem to explain the real reason indirectly, I thought I'll answer, what I hope, a C programmer would find useful.
IMHO, the true source of ambiguity is the C standard. For example, in C11 draft spec's (<http://www.open-std.org/jtc1/sc22/wg14/www/do... |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | it's a convention dated back to the early days of Unix.
By convention, all system calls return 0 if succeed, non-zero otherwise, because then different numbers can be used to indicate different reason of failure.
Shells follow this convention, 0 means last command succeeded, non-zero otherwise. Similarly, the non-zer... | Your trying to equate true/false with success/failure.
They are two completely, although subtly at first, different dichotomies!
In shell scripting, there is no such thing as true/false. Shell 'expressions' aren't interpreted as true/false. Rather, shell 'expressions' are processes that either succeed or fail.
Obvi... |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | Bash is a programming (scripting) language, but it's also a shell and a user-interface. If `0` was error, then the program could only present one kind of error.
However in Bash, any nonzero value is an error, and we may use any number from 1-255 to represent an error. This means we can have many different kinds of err... | Maybe a good way to remember it is :
* Return codes answer "what's the answer?" true (or other result) or false
* Exit codes answer "what's the problem?" exit code or no problem (0) |
2,933,849 | All lines in my AppStats look like this: `real=19ms cpu=0ms api=0ms overhead=0ms`, it has the correct real time, but the other values are always 0. Anyone have this problem before or know how to fix this? | 2010/05/29 | [
"https://Stackoverflow.com/questions/2933849",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243494/"
] | It's a convention, but a particularly useful one when you think about it. In general, if a program succeeds that's all you need to know. If it fails, however, you might need to know all kinds of information about the failure - why it happened, how to fix it, etc. Having zero mean 'success' and non-zero mean failure let... | **There are two related issues here.**
First, the OP's question, *Why 0 is true but false is 1 in the shell?* and the second, *why do applications return 0 for success and non-zero for failure?*
To answer the OP's question we need to understand the second question. The numerous answers to this post have described th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.