qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
137,685 | I work in a large team (~50 headcount) at the head office of a large multinational bank. Last year I was diagnosed with cancer - thankfully a very survivable form of it. I had an operation to remove the tumour and I spent 3 weeks away from work recovering.
Currently I’m on a surveillance programme where I get my blood... | 2019/05/31 | [
"https://workplace.stackexchange.com/questions/137685",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/105300/"
] | Homo sapiens is a social animal. Regardless or not of whether your behaviour is "any of their business", people who interact with you will notice it and notice the fact that what you are doing is different from what is "normal" in the working environment.
The simplest way to scratch that communal itch is to put the in... | When I was diagnosed I was rather open about it, but did not tell more than a few people at work.
At the time I told those few I asked them to spread the word, so that the rest would hear it as well.
While you have waited a lot longer, my solution would still work for you, especially if you ask those people in the ... |
137,685 | I work in a large team (~50 headcount) at the head office of a large multinational bank. Last year I was diagnosed with cancer - thankfully a very survivable form of it. I had an operation to remove the tumour and I spent 3 weeks away from work recovering.
Currently I’m on a surveillance programme where I get my blood... | 2019/05/31 | [
"https://workplace.stackexchange.com/questions/137685",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/105300/"
] | Firstly, I hope everything turns out well for you. It sounds like you are doing everything you can to give your health the best chance. Quite right too!
If I understand correctly, you would rather keep the explanation for your extended absence and 4-day week to yourself (and your chosen trusted confidantes), but other... | Do so reluctantly. It's vain, and burdens them.
-----------------------------------------------
They don't need to know. They don't know how to react or what to say, it simply fills them with worry and awkwardness.
I think a big part of why you're willing to talk about it is *because your outcomes are so good*. That... |
137,685 | I work in a large team (~50 headcount) at the head office of a large multinational bank. Last year I was diagnosed with cancer - thankfully a very survivable form of it. I had an operation to remove the tumour and I spent 3 weeks away from work recovering.
Currently I’m on a surveillance programme where I get my blood... | 2019/05/31 | [
"https://workplace.stackexchange.com/questions/137685",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/105300/"
] | This won't work for everyone, because some (well a lot, probable) of people are very private about things like this, but when I was diagnosed with MS nine years ago, I missed work for a week because I was admitted to the hospital and was on IV steroids. I was basically "out" about it from the moment I came back. I didn... | Do so reluctantly. It's vain, and burdens them.
-----------------------------------------------
They don't need to know. They don't know how to react or what to say, it simply fills them with worry and awkwardness.
I think a big part of why you're willing to talk about it is *because your outcomes are so good*. That... |
137,685 | I work in a large team (~50 headcount) at the head office of a large multinational bank. Last year I was diagnosed with cancer - thankfully a very survivable form of it. I had an operation to remove the tumour and I spent 3 weeks away from work recovering.
Currently I’m on a surveillance programme where I get my blood... | 2019/05/31 | [
"https://workplace.stackexchange.com/questions/137685",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/105300/"
] | Homo sapiens is a social animal. Regardless or not of whether your behaviour is "any of their business", people who interact with you will notice it and notice the fact that what you are doing is different from what is "normal" in the working environment.
The simplest way to scratch that communal itch is to put the in... | This won't work for everyone, because some (well a lot, probable) of people are very private about things like this, but when I was diagnosed with MS nine years ago, I missed work for a week because I was admitted to the hospital and was on IV steroids. I was basically "out" about it from the moment I came back. I didn... |
59,574 | The (American) "western interior" states (the drier, more rural, less populated ones between the west coast and the center of the country (North and South Dakota, Kansas, Nebraska, Oklahoma, Texas) tend to vote Republican in Presidential elections. At least two exceptions stand out from the [2016 campaign](https://en.w... | 2020/10/31 | [
"https://politics.stackexchange.com/questions/59574",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/1654/"
] | In the United States, large cities tend to skew Democratic. Denver's combined statistical area, which currently makes up 3.62 million of Colorado's 5.75 million people, represents 63% of the state's population. As Denver and it's surrounding metropolitan area have grown, so has the "blueness" of the state of Colorado.
... | New Mexico has a large Hispanic population in percentage. Colorado has a relatively large Hispanic percentage so the explanation is urbanization.
The rest of the states aren't blue because they're rural. Utah is Mormon, and Arizona is expected to go blue in 2020.
Arizona, for now is redder than CO or especially NM be... |
59,574 | The (American) "western interior" states (the drier, more rural, less populated ones between the west coast and the center of the country (North and South Dakota, Kansas, Nebraska, Oklahoma, Texas) tend to vote Republican in Presidential elections. At least two exceptions stand out from the [2016 campaign](https://en.w... | 2020/10/31 | [
"https://politics.stackexchange.com/questions/59574",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/1654/"
] | New Mexico has a large Hispanic population in percentage. Colorado has a relatively large Hispanic percentage so the explanation is urbanization.
The rest of the states aren't blue because they're rural. Utah is Mormon, and Arizona is expected to go blue in 2020.
Arizona, for now is redder than CO or especially NM be... | The other answers make good points, but I'll elaborate a bit more about Colorado, where I live and have been involved actively in politics for the last 24 years.
Colorado was in living memory a much more conservative state, comparable, to Nebraska.
What changed?
* The oil and gas industry, which used to be the domin... |
59,574 | The (American) "western interior" states (the drier, more rural, less populated ones between the west coast and the center of the country (North and South Dakota, Kansas, Nebraska, Oklahoma, Texas) tend to vote Republican in Presidential elections. At least two exceptions stand out from the [2016 campaign](https://en.w... | 2020/10/31 | [
"https://politics.stackexchange.com/questions/59574",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/1654/"
] | In the United States, large cities tend to skew Democratic. Denver's combined statistical area, which currently makes up 3.62 million of Colorado's 5.75 million people, represents 63% of the state's population. As Denver and it's surrounding metropolitan area have grown, so has the "blueness" of the state of Colorado.
... | I'm going to focus more on New Mexico here, because I think that the explanation for Colorado (save for a few southern counties that are culturally much more similar to northern New Mexico than the rest of Colorado) is urbanization, as stated in the other answers.
**To summarize**
The first thing to note is that if y... |
59,574 | The (American) "western interior" states (the drier, more rural, less populated ones between the west coast and the center of the country (North and South Dakota, Kansas, Nebraska, Oklahoma, Texas) tend to vote Republican in Presidential elections. At least two exceptions stand out from the [2016 campaign](https://en.w... | 2020/10/31 | [
"https://politics.stackexchange.com/questions/59574",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/1654/"
] | In the United States, large cities tend to skew Democratic. Denver's combined statistical area, which currently makes up 3.62 million of Colorado's 5.75 million people, represents 63% of the state's population. As Denver and it's surrounding metropolitan area have grown, so has the "blueness" of the state of Colorado.
... | The other answers make good points, but I'll elaborate a bit more about Colorado, where I live and have been involved actively in politics for the last 24 years.
Colorado was in living memory a much more conservative state, comparable, to Nebraska.
What changed?
* The oil and gas industry, which used to be the domin... |
59,574 | The (American) "western interior" states (the drier, more rural, less populated ones between the west coast and the center of the country (North and South Dakota, Kansas, Nebraska, Oklahoma, Texas) tend to vote Republican in Presidential elections. At least two exceptions stand out from the [2016 campaign](https://en.w... | 2020/10/31 | [
"https://politics.stackexchange.com/questions/59574",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/1654/"
] | I'm going to focus more on New Mexico here, because I think that the explanation for Colorado (save for a few southern counties that are culturally much more similar to northern New Mexico than the rest of Colorado) is urbanization, as stated in the other answers.
**To summarize**
The first thing to note is that if y... | The other answers make good points, but I'll elaborate a bit more about Colorado, where I live and have been involved actively in politics for the last 24 years.
Colorado was in living memory a much more conservative state, comparable, to Nebraska.
What changed?
* The oil and gas industry, which used to be the domin... |
428,482 | I recall seeing an italicized 'i' to indicate that the second vowel in Joseph should be pronounced like the weak sound of the second vowel in "tendon," instead of a regular "i" sound. Can you tell me about any incidents of similar phonetic alphabet usage on the weak "i" sound elsewhere?" | 2018/01/28 | [
"https://english.stackexchange.com/questions/428482",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/278634/"
] | IPA [ə], [ɪ], [ɪ̈], [ɨ], or [ᵻ]
===============================
If you’re looking for a short answer:
* In American transcriptions, *Joseph* can be represented as [ˈdʒosəf], or perhaps [ˈdʒozəf] for those who voice the middle consonant.
* It British transcriptions, *Joseph* might be represented as [ˈdʒəʊsɨf], or perh... | Answer to Chulsoo Chin's question about the correct weak form of 'e' in 'Joseph'. Normally, it would be the same 'i' vowel as in 'bid' or 'pit', phonetic symbol the capped lower case 'i', but it could on occasions be the 'schwa' symbol, as in the first syllable of 'amount' or 'arrive'. |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | You can use this package keyboard\_visibility and listen to `keyboard visibility`. Then you can give your logic to implement your feature like you can shorten the home `container` height. That's not perfect . But I think it's the only way right now. | You should try setting `resizeToAvoidBottomPadding: false` like so:
```
return Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
``` |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | I use something like that:
```
AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 100),
curve: Curves.decelerate,
child: ....
)
```
This animates the padding based on the viewInsets(software keyboard height). | You should try setting `resizeToAvoidBottomPadding: false` like so:
```
return Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
``` |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | The desired output can be achieved using AnimatedPadding Widget, though this is not perfect, but better than nothing :d
[Open issue as of 15/03/21, for reference](https://github.com/flutter/flutter/issues/19279)
```
import 'dart:math';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(25... | You should try setting `resizeToAvoidBottomPadding: false` like so:
```
return Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
``` |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | You need to use [keyboard\_visibility](https://pub.dev/packages/flutter_keyboard_visibility) package and use it to trigger your AnimatedContainer or AnimatedPadding
```
bool _isKeyboardActive = false;
@override
void initState() {
super.initState();
//add keyboard visibility Listener
KeyboardVisibility.onChange.l... | You should try setting `resizeToAvoidBottomPadding: false` like so:
```
return Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
``` |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | I use something like that:
```
AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 100),
curve: Curves.decelerate,
child: ....
)
```
This animates the padding based on the viewInsets(software keyboard height). | You can use this package keyboard\_visibility and listen to `keyboard visibility`. Then you can give your logic to implement your feature like you can shorten the home `container` height. That's not perfect . But I think it's the only way right now. |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | The desired output can be achieved using AnimatedPadding Widget, though this is not perfect, but better than nothing :d
[Open issue as of 15/03/21, for reference](https://github.com/flutter/flutter/issues/19279)
```
import 'dart:math';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(25... | You can use this package keyboard\_visibility and listen to `keyboard visibility`. Then you can give your logic to implement your feature like you can shorten the home `container` height. That's not perfect . But I think it's the only way right now. |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | I use something like that:
```
AnimatedPadding(
padding: MediaQuery.of(context).viewInsets,
duration: const Duration(milliseconds: 100),
curve: Curves.decelerate,
child: ....
)
```
This animates the padding based on the viewInsets(software keyboard height). | You need to use [keyboard\_visibility](https://pub.dev/packages/flutter_keyboard_visibility) package and use it to trigger your AnimatedContainer or AnimatedPadding
```
bool _isKeyboardActive = false;
@override
void initState() {
super.initState();
//add keyboard visibility Listener
KeyboardVisibility.onChange.l... |
54,563,854 | I'm building a Flutter app, mainly for iOS.
One of my views has a text field, and iOS keyboard appears when you tap on it. The problem is - layout does not change smoothly like it does in native iOS apps. Instead, it instantly jumps to the final available screen height even before keyboard opening animation finishes.
... | 2019/02/06 | [
"https://Stackoverflow.com/questions/54563854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6374527/"
] | The desired output can be achieved using AnimatedPadding Widget, though this is not perfect, but better than nothing :d
[Open issue as of 15/03/21, for reference](https://github.com/flutter/flutter/issues/19279)
```
import 'dart:math';
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(25... | You need to use [keyboard\_visibility](https://pub.dev/packages/flutter_keyboard_visibility) package and use it to trigger your AnimatedContainer or AnimatedPadding
```
bool _isKeyboardActive = false;
@override
void initState() {
super.initState();
//add keyboard visibility Listener
KeyboardVisibility.onChange.l... |
25,574,767 | I am developing an activity with a ListView in which I need to change the current row by another layout by clicking on the row, and I'm not finding any way to do as much as I look (I take hours searching for possible solutions and I have not seen any reference to this problem). I do not know if this can be done in Andr... | 2014/08/29 | [
"https://Stackoverflow.com/questions/25574767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1378372/"
] | Single-table inheritance might be what you need. In a nutshell: it allows several classes with the same kind of data to be put into one table. The only requirement is that that table has a `type` column, a `string`.
Basically, it's about common sense. Let's say, a user can have passes to an event: a vendor's pass and ... | Let's say that every event has a ticket which is unique to an individual, an event and says whether the person is being admitted as a faculty member or vendor.
```
class User < ActiveRecord::Base
has_many :tickets
has_many :events, through: :tickets
end
class Event < ActiveRecord::Base
has_many :tickets
has_... |
1,078,506 | If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. | 2009/07/03 | [
"https://Stackoverflow.com/questions/1078506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | Double click the cursor fields in your result record. On the right side there is a "..." icon. Click this and you'll see the contents | Hi I know this was asked a while ago but I've just figured this out and it might help someone else. Not sure if this is exactly what you're looking for but this is how I call a stored proc and view the output in SQL Developer.
In SQL Developer when viewing the proc, right click and choose 'Run' or select Ctrl+F11 to... |
1,078,506 | If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. | 2009/07/03 | [
"https://Stackoverflow.com/questions/1078506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | Double click the cursor fields in your result record. On the right side there is a "..." icon. Click this and you'll see the contents | there are no way to display a refcursor in datagrid in sqldeveloper.
we can define a refcursor,call SP,then print refcursor,then data will be printed in Script output window in a plane text mode,but not in Query Result window. |
1,078,506 | If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. | 2009/07/03 | [
"https://Stackoverflow.com/questions/1078506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | Double click the cursor fields in your result record. On the right side there is a "..." icon. Click this and you'll see the contents | ```
SET SERVEROUTPUT ON;
VARIABLE X REFCURSOR;
EXEC PROCEDURE_WITH_OUTPUT_SYS_REFCURSOR(:X);
PRINT X;
``` |
1,078,506 | If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. | 2009/07/03 | [
"https://Stackoverflow.com/questions/1078506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | Hi I know this was asked a while ago but I've just figured this out and it might help someone else. Not sure if this is exactly what you're looking for but this is how I call a stored proc and view the output in SQL Developer.
In SQL Developer when viewing the proc, right click and choose 'Run' or select Ctrl+F11 to... | there are no way to display a refcursor in datagrid in sqldeveloper.
we can define a refcursor,call SP,then print refcursor,then data will be printed in Script output window in a plane text mode,but not in Query Result window. |
1,078,506 | If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. | 2009/07/03 | [
"https://Stackoverflow.com/questions/1078506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/116/"
] | ```
SET SERVEROUTPUT ON;
VARIABLE X REFCURSOR;
EXEC PROCEDURE_WITH_OUTPUT_SYS_REFCURSOR(:X);
PRINT X;
``` | there are no way to display a refcursor in datagrid in sqldeveloper.
we can define a refcursor,call SP,then print refcursor,then data will be printed in Script output window in a plane text mode,but not in Query Result window. |
266,554 | I have a small, slow and steady trickle of water running down the outside of a vertical 15 mm copper pipe.
How can I capture the leak and divert the water into a receptacle?
I'm not asking for a permanent fix for the leak itself. I have that in hand - the parts should arrive in couple of days. In the meantime I have ... | 2023/02/09 | [
"https://diy.stackexchange.com/questions/266554",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/105361/"
] | I used a cotton fabric wrapped around a pipe draped into a bucket - works well for slow flows. | I had the same thing once, in the cellar under the bathroom.
While we waited for the plumber to come I got creative with some aluminium foil and duct tape. I secured the foil where the water was running, and formed it into a point, so it dripped into a bucket.
Sorry, this was a long time ago, no pictures. |
266,554 | I have a small, slow and steady trickle of water running down the outside of a vertical 15 mm copper pipe.
How can I capture the leak and divert the water into a receptacle?
I'm not asking for a permanent fix for the leak itself. I have that in hand - the parts should arrive in couple of days. In the meantime I have ... | 2023/02/09 | [
"https://diy.stackexchange.com/questions/266554",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/105361/"
] | Form a spout out of [BluTack](https://www.amazon.co.uk/s?k=bue%20tack&adgrpid=119469621109&gclid=CjwKCAiA0JKfBhBIEiwAPhZXDz0lNsmnJ0MbDZFfWwsb-zZlPn8szVddTthICQhtMcMVAlcbNrHtyhoCuxYQAvD_BwE&hvadid=592915235196&hvdev=c&hvlocphy=1007046&hvnetw=g&hvqmt=e&hvrand=4162756065236781453&hvtargid=kwd-664282872197&hydadcr=17220_21... | I had the same thing once, in the cellar under the bathroom.
While we waited for the plumber to come I got creative with some aluminium foil and duct tape. I secured the foil where the water was running, and formed it into a point, so it dripped into a bucket.
Sorry, this was a long time ago, no pictures. |
266,554 | I have a small, slow and steady trickle of water running down the outside of a vertical 15 mm copper pipe.
How can I capture the leak and divert the water into a receptacle?
I'm not asking for a permanent fix for the leak itself. I have that in hand - the parts should arrive in couple of days. In the meantime I have ... | 2023/02/09 | [
"https://diy.stackexchange.com/questions/266554",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/105361/"
] | Wicking with string or yarn (has to be a type that wets well to wick, not something hydrophobic) tied around the pipe and suspended to drip into a container has usually worked for me, as yet another option. | I had the same thing once, in the cellar under the bathroom.
While we waited for the plumber to come I got creative with some aluminium foil and duct tape. I secured the foil where the water was running, and formed it into a point, so it dripped into a bucket.
Sorry, this was a long time ago, no pictures. |
266,554 | I have a small, slow and steady trickle of water running down the outside of a vertical 15 mm copper pipe.
How can I capture the leak and divert the water into a receptacle?
I'm not asking for a permanent fix for the leak itself. I have that in hand - the parts should arrive in couple of days. In the meantime I have ... | 2023/02/09 | [
"https://diy.stackexchange.com/questions/266554",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/105361/"
] | I used a cotton fabric wrapped around a pipe draped into a bucket - works well for slow flows. | Wicking with string or yarn (has to be a type that wets well to wick, not something hydrophobic) tied around the pipe and suspended to drip into a container has usually worked for me, as yet another option. |
266,554 | I have a small, slow and steady trickle of water running down the outside of a vertical 15 mm copper pipe.
How can I capture the leak and divert the water into a receptacle?
I'm not asking for a permanent fix for the leak itself. I have that in hand - the parts should arrive in couple of days. In the meantime I have ... | 2023/02/09 | [
"https://diy.stackexchange.com/questions/266554",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/105361/"
] | Form a spout out of [BluTack](https://www.amazon.co.uk/s?k=bue%20tack&adgrpid=119469621109&gclid=CjwKCAiA0JKfBhBIEiwAPhZXDz0lNsmnJ0MbDZFfWwsb-zZlPn8szVddTthICQhtMcMVAlcbNrHtyhoCuxYQAvD_BwE&hvadid=592915235196&hvdev=c&hvlocphy=1007046&hvnetw=g&hvqmt=e&hvrand=4162756065236781453&hvtargid=kwd-664282872197&hydadcr=17220_21... | Wicking with string or yarn (has to be a type that wets well to wick, not something hydrophobic) tied around the pipe and suspended to drip into a container has usually worked for me, as yet another option. |
57,947,864 | I was wondering If I could get some help.
I am trying to create a HERO and here you can see how I have written it along with the and tags
<https://www.screencast.com/t/COOZ3dCy9l>
Here you can see how I did the css
<https://www.screencast.com/t/gSt4tvpY2C>
Here you can see how the results are not good at all
<https:... | 2019/09/15 | [
"https://Stackoverflow.com/questions/57947864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12071352/"
] | Whenever your `it` reach the `friendlyName_id.end()` the loop is over (by the loop's condition), and you will never reach this part inside your loop.
```
void returnFriendlyName(int input)
{
std::map<std::string, int>::iterator it;
for (it = friendlyName_id.begin(); it != friendlyName_id.end(); it++) {
... | >
> Is my understanding of this code incorrect? Am I missing something that is causing the else if to not evaluate?
>
>
>
Yes, it is incorrect. The `else` clause is for the `if`, not for the `for`.
You may be confused by the `else` clauses of other languages, like Python's.
If you add braces, you will see it cl... |
6,661,589 | What is the diference between those two examples of code?
```
public Test(int x)
{
List<int> list= new List<int>();
List<int> list1 = new List<int>();
list= CreateList(x);
list1 = CreateList(x + 1);
DoStuff(list, list1);
list.Clear();
list = null;
... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6661589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562581/"
] | Nothing.
For readability and therefore future maintenance reasons, use the second one. It's clearly much easier to understand, and because of the design of C# and the CLR, much of the code in your first example is not required.
I'll try to explain what I mean. You don't need to clear or set to null any references to ... | You're not actually comparing like with like as all `var` means is "let the compiler decide what type this is". It will compile to the same code (assuming that `CreateList` returns a `List<int>`). So while your code is functionally identically you're doing extra work in the first example that you're not replicating in ... |
6,661,589 | What is the diference between those two examples of code?
```
public Test(int x)
{
List<int> list= new List<int>();
List<int> list1 = new List<int>();
list= CreateList(x);
list1 = CreateList(x + 1);
DoStuff(list, list1);
list.Clear();
list = null;
... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6661589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562581/"
] | Nothing.
For readability and therefore future maintenance reasons, use the second one. It's clearly much easier to understand, and because of the design of C# and the CLR, much of the code in your first example is not required.
I'll try to explain what I mean. You don't need to clear or set to null any references to ... | The only difference that is worth mentioning is that when you clear the list manually, you're releasing references to the objects at that point. In the other version, the list will clear the references during it's disposal by the garbage collector, which can occur at any time.
That's a minor difference, because the re... |
6,661,589 | What is the diference between those two examples of code?
```
public Test(int x)
{
List<int> list= new List<int>();
List<int> list1 = new List<int>();
list= CreateList(x);
list1 = CreateList(x + 1);
DoStuff(list, list1);
list.Clear();
list = null;
... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6661589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562581/"
] | Nothing.
For readability and therefore future maintenance reasons, use the second one. It's clearly much easier to understand, and because of the design of C# and the CLR, much of the code in your first example is not required.
I'll try to explain what I mean. You don't need to clear or set to null any references to ... | It depends on what you do with "DoStuff". If you create another reference to the list the garbage collector won't clear them in the second example. So the first example guarantees the lists are cleared and in the second it depends on "DoStuff".
I would use the following code:
```
DoStuff(CreateList(nCount), CreateLis... |
6,661,589 | What is the diference between those two examples of code?
```
public Test(int x)
{
List<int> list= new List<int>();
List<int> list1 = new List<int>();
list= CreateList(x);
list1 = CreateList(x + 1);
DoStuff(list, list1);
list.Clear();
list = null;
... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6661589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562581/"
] | You're not actually comparing like with like as all `var` means is "let the compiler decide what type this is". It will compile to the same code (assuming that `CreateList` returns a `List<int>`). So while your code is functionally identically you're doing extra work in the first example that you're not replicating in ... | The only difference that is worth mentioning is that when you clear the list manually, you're releasing references to the objects at that point. In the other version, the list will clear the references during it's disposal by the garbage collector, which can occur at any time.
That's a minor difference, because the re... |
6,661,589 | What is the diference between those two examples of code?
```
public Test(int x)
{
List<int> list= new List<int>();
List<int> list1 = new List<int>();
list= CreateList(x);
list1 = CreateList(x + 1);
DoStuff(list, list1);
list.Clear();
list = null;
... | 2011/07/12 | [
"https://Stackoverflow.com/questions/6661589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562581/"
] | You're not actually comparing like with like as all `var` means is "let the compiler decide what type this is". It will compile to the same code (assuming that `CreateList` returns a `List<int>`). So while your code is functionally identically you're doing extra work in the first example that you're not replicating in ... | It depends on what you do with "DoStuff". If you create another reference to the list the garbage collector won't clear them in the second example. So the first example guarantees the lists are cleared and in the second it depends on "DoStuff".
I would use the following code:
```
DoStuff(CreateList(nCount), CreateLis... |
70,754,579 | From an XML Schema using `xmlschema` package, I extracted an XsdEnumerationFacets like the one below
```py
XsdEnumerationFacets(['OP1', 'OP2', 'OP3', 'OP3', 'OP4', ...])
```
How can I extract the possible values from it? ('OP1', 'OP2', 'OP3', 'OP3', 'OP4' and so on in this case).
I had one idea to convert it into s... | 2022/01/18 | [
"https://Stackoverflow.com/questions/70754579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813946/"
] | ```
import xmlschema
schema = xmlschema.XMLSchema("schema.xsd")
tshirt = schema.elements["Tshirt"]
enumerate_values = {}
for c in tshirt.type.content:
for comp in c.type.iter_components():
if isinstance(comp, xmlschema.validators.XsdEnumerationFacets):
enumerat... | I created get\_enum\_values function to get the values from an XsdEnumerationFacets object. This is the whole code, that works with the xsd file in the question.
```py
import xmlschema
schema = xmlschema.XMLSchema("schema.xsd")
tshirt = schema.elements["Tshirt"]
def get_enum_values(enum):
"""Get values from XsdE... |
59,289,636 | How can I assign first level keys using a column value from the third level of a multidimensional array?
My input:
```
$array = [
[
["ID" => 2, "vendor_id" => "37", "order_id" => 776],
],
[
["ID" => 2, "vendor_id" => "37", "order_id" => 786],
]
];
```
My current output is like this:
... | 2019/12/11 | [
"https://Stackoverflow.com/questions/59289636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12519385/"
] | Get the `current` item or use `reset` and extract the entire columns indexing by `order_id`:
```
$result = array_column(current($array), null, 'order_id');
```
If there could be multiple arrays, then just loop and append:
```
$result = [];
foreach($array as $v) {
$result += array_column($v, null, 'order_id');
}... | you can use that function
```
//$array is your input array
//$mergedArray is the result wanted
$mergedArray = array_reduce($array, function($acc, $val) {
foreach ($val as $order) {
$acc[$order['order_id']] = $order;
}
return $acc;
}, []);
```
you can try it on <http://sandbox.onlinephpfuncti... |
59,289,636 | How can I assign first level keys using a column value from the third level of a multidimensional array?
My input:
```
$array = [
[
["ID" => 2, "vendor_id" => "37", "order_id" => 776],
],
[
["ID" => 2, "vendor_id" => "37", "order_id" => 786],
]
];
```
My current output is like this:
... | 2019/12/11 | [
"https://Stackoverflow.com/questions/59289636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12519385/"
] | Get the `current` item or use `reset` and extract the entire columns indexing by `order_id`:
```
$result = array_column(current($array), null, 'order_id');
```
If there could be multiple arrays, then just loop and append:
```
$result = [];
foreach($array as $v) {
$result += array_column($v, null, 'order_id');
}... | The other answers do not maintain the multi-level structure described as your desired output. The `order_id` values must be used as first level keys, and the second level keys must be incremented/indexed as they are encountered. This will allow for multiple entries which share the same first level key.
`foreach()` ins... |
234,657 | I have a fuel level sensor that varies its resistance from 9.5 ohm(empty) to 155ohm(full). The sensor is powered using 12V battery connected to a 30kVA Generator.
The problem is that the level that I get fluctuates,i.e, 47.57% for 30s and then 48.4 for 30s or so. The level is calculated using the equation level(%)=18... | 2016/05/17 | [
"https://electronics.stackexchange.com/questions/234657",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/107023/"
] | The voltage difference needed to cause this difference in fuel level is (48.4-47-57)/187.41=4.4mV, so the measured fluctuation is indeed too low.
But your ADC has 10Bit, i.e. gives 1024 different values. At an ADC range of 5V, one step is 5V/1024=4.883mV, which corresponds to 0.9% fuel level. This is the resolution o... | To improve the accuracy of your measurement, you can use the following simple techniques:
* digital averaging: takes several measurement and display the average of them. The number of samples you can average will depend on the sample rate of your ADC and the frequency of the measurement you want.
* analog low pass fi... |
27,904,706 | I have searched and tested different solutions all day without luck. In the below code I want (when clicked) to set a session on the "open" links I echo in the foreach loop. I tried using AJAX but I am new to AJAX and could not make it work. I know how to do it using GET but it is too risky, so i welcome your suggestio... | 2015/01/12 | [
"https://Stackoverflow.com/questions/27904706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405833/"
] | What have you tried and what doesn't work, because this looks like what you need...
HTML:
```
<a href="home.php?a=register">Register Now!</a>
```
PHP:
```
if(isset($_GET['a'])){
$_SESSION['link']= 'whatever';
}
```
And if you need to do it without a page refresh, then use AJAX. | You should use ajax on click of link:
```
$.ajax({
url: 'test.php',
dataType: 'json',
type: 'post',
data: {name: "value", name2: "value2" /* ... */},
success: function (data) {
}
});
```
in your test.php, `$_POST['name']` is equal to "value". and there you can do everything... |
27,904,706 | I have searched and tested different solutions all day without luck. In the below code I want (when clicked) to set a session on the "open" links I echo in the foreach loop. I tried using AJAX but I am new to AJAX and could not make it work. I know how to do it using GET but it is too risky, so i welcome your suggestio... | 2015/01/12 | [
"https://Stackoverflow.com/questions/27904706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405833/"
] | What have you tried and what doesn't work, because this looks like what you need...
HTML:
```
<a href="home.php?a=register">Register Now!</a>
```
PHP:
```
if(isset($_GET['a'])){
$_SESSION['link']= 'whatever';
}
```
And if you need to do it without a page refresh, then use AJAX. | first, add html class on "Open" link and custom html5 attribute to store your card data. for example data-card.
```
<a href="#" class="your-class" data-card="card_nr_value">Open</a>
```
next, create Onclick event for a link to send an ajax request.
```
$( document ).ready(function() {
$(".your-class").click(fun... |
9,137,732 | So I'm working on a networking assignment to produce a basic HTTP/1.0 web server in C. I have most of it figured out, but one of the requirements is that it properly populate the Content-Type field in the header, and I can't seem to find any way to do this automatically.
I'm already using fstat() to get the file size ... | 2012/02/04 | [
"https://Stackoverflow.com/questions/9137732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175868/"
] | Some systems contain a file called `/etc/mime.types` which contains a bunch of extensions and MIME type pairs.
See [the documentation for such a file](http://wiki.debian.org/MIME/etc/mime.types). | A file is only a bag of bytes, so there is no way to know for sure that a .html file doesn't contain C code, for example. You could delegate to the [file command](http://en.wikipedia.org/wiki/File_%28command%29), which contains a lot of heuristics for determining these kinds of things based on the first few bytes of a ... |
9,137,732 | So I'm working on a networking assignment to produce a basic HTTP/1.0 web server in C. I have most of it figured out, but one of the requirements is that it properly populate the Content-Type field in the header, and I can't seem to find any way to do this automatically.
I'm already using fstat() to get the file size ... | 2012/02/04 | [
"https://Stackoverflow.com/questions/9137732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175868/"
] | Probably the best approach is a lookup table based on extensions. The idea that a given file has a single "type" associated with it is just wrong. At least using extensions gives you a bit of power to control how the file contents are interpreted. For example if you wanted to show an example of how html source works, y... | A file is only a bag of bytes, so there is no way to know for sure that a .html file doesn't contain C code, for example. You could delegate to the [file command](http://en.wikipedia.org/wiki/File_%28command%29), which contains a lot of heuristics for determining these kinds of things based on the first few bytes of a ... |
9,137,732 | So I'm working on a networking assignment to produce a basic HTTP/1.0 web server in C. I have most of it figured out, but one of the requirements is that it properly populate the Content-Type field in the header, and I can't seem to find any way to do this automatically.
I'm already using fstat() to get the file size ... | 2012/02/04 | [
"https://Stackoverflow.com/questions/9137732",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175868/"
] | Some systems contain a file called `/etc/mime.types` which contains a bunch of extensions and MIME type pairs.
See [the documentation for such a file](http://wiki.debian.org/MIME/etc/mime.types). | Probably the best approach is a lookup table based on extensions. The idea that a given file has a single "type" associated with it is just wrong. At least using extensions gives you a bit of power to control how the file contents are interpreted. For example if you wanted to show an example of how html source works, y... |
10,297,002 | Powershell seems to drop empty string arguments when passed to a command. I have this code
```
PS D:\> $b.name = "foo bar"
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
Arg 1 is foo bar
PS D:\> $b.name = ""
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
```
You can assume that $b has a 'name' member. How ... | 2012/04/24 | [
"https://Stackoverflow.com/questions/10297002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1353535/"
] | If you want an empty string to appear try escaped quotes around the argument like so:
```
PS> $b = [psobject]@{name = ''}
PS> echoargs `"$($b.Name)`"
Arg 0 is <>
Command line:
"C:\Users\Keith\Pscx\Trunk\Src\Pscx\bin\Release\Apps\EchoArgs.exe" ""
```
Note that I tested this on V3 so I'm not sure if the behavior wil... | Try to pass an empty single quote string enclosed in double quotes, or vice versa.
```
./echoargs $b.name, "''"
```
or
```
./echoargs $b.name, '""'
``` |
10,297,002 | Powershell seems to drop empty string arguments when passed to a command. I have this code
```
PS D:\> $b.name = "foo bar"
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
Arg 1 is foo bar
PS D:\> $b.name = ""
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
```
You can assume that $b has a 'name' member. How ... | 2012/04/24 | [
"https://Stackoverflow.com/questions/10297002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1353535/"
] | Try to pass an empty single quote string enclosed in double quotes, or vice versa.
```
./echoargs $b.name, "''"
```
or
```
./echoargs $b.name, '""'
``` | This should also work:
```
./echoargs [String]::Empty
``` |
10,297,002 | Powershell seems to drop empty string arguments when passed to a command. I have this code
```
PS D:\> $b.name = "foo bar"
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
Arg 1 is foo bar
PS D:\> $b.name = ""
PS D:\> ./echoargs $b.name
Arg 0 is D:\echoargs.exe
```
You can assume that $b has a 'name' member. How ... | 2012/04/24 | [
"https://Stackoverflow.com/questions/10297002",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1353535/"
] | If you want an empty string to appear try escaped quotes around the argument like so:
```
PS> $b = [psobject]@{name = ''}
PS> echoargs `"$($b.Name)`"
Arg 0 is <>
Command line:
"C:\Users\Keith\Pscx\Trunk\Src\Pscx\bin\Release\Apps\EchoArgs.exe" ""
```
Note that I tested this on V3 so I'm not sure if the behavior wil... | This should also work:
```
./echoargs [String]::Empty
``` |
8,275 | A. All in $100
B. Raise it to $300
C. Re-Raise it to $600
Then B folds
A turns his cards
C may be protecting A, or doesn't want to show his hand
So C folds his hand
Who does win the side pot? | 2016/10/03 | [
"https://poker.stackexchange.com/questions/8275",
"https://poker.stackexchange.com",
"https://poker.stackexchange.com/users/4624/"
] | When B folds, the side pot belongs to C, immediately, regardless of what C might later do. If you suspect that C is cheating by protecting A, you are entitled to ask the floorman to expose C's hand and make that judgment. | The main pot is $100 each for $300
There was a side pot between B and C of $200
When C folded A won the main pot
I think C is still entitled to the $200 side pot with B |
16,325,168 | In java, i need to be able to go through an array and find the max value. How would I compare the elements of the array to find the max? | 2013/05/01 | [
"https://Stackoverflow.com/questions/16325168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1955969/"
] | If you can change the order of the elements:
```
int[] myArray = new int[]{1, 3, 8, 5, 7, };
Arrays.sort(myArray);
int max = myArray[myArray.length - 1];
```
If you can't change the order of the elements:
```
int[] myArray = new int[]{1, 3, 8, 5, 7, };
int max = Integer.MIN_VALUE;
for(int i = 0; i < myArray.leng... | Iterate over the Array. First initialize the maximum value to the first element of the array and then for each element optimize it if the element under consideration is greater. |
16,325,168 | In java, i need to be able to go through an array and find the max value. How would I compare the elements of the array to find the max? | 2013/05/01 | [
"https://Stackoverflow.com/questions/16325168",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1955969/"
] | Have a max int and set it to the first value in the array. Then in a for loop iterate through the whole array and see if the max int is larger than the int at the current index.
```
int max = array.get(0);
for (int i = 1; i < array.length; i++) {
if (array.get(i) > max) {
max = array.get(i);
}
}
``` | Iterate over the Array. First initialize the maximum value to the first element of the array and then for each element optimize it if the element under consideration is greater. |
18,929,176 | Hi I have a database to which new data is added every minute. I have a C# datagrid in winform which displays this db table. We refresh this datagrid every 5 minutes. Is there a way I show only the new added data and not the older ones | 2013/09/21 | [
"https://Stackoverflow.com/questions/18929176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/88412/"
] | While the issue could be Ember related, write the `script` tag in HAML to be consistent:
```
%td
%script{:type => "text/x-handlebars"}
{{#linkTo 'notes'}}Edit{{/linkTo}}
``` | I think this error ins't related to the haml. This happens when you try to extend a class and some value isn't a javascritpt object or mixin. In your case is coming a function.
```
// some mistake set a function to this
App.MyMixin = function() {}
// here will crash
App.SomeView = Ember.View.extend(App.MyMixin, {
... |
46,198,430 | M using odoo 8 running on windows, i inhereted the res.company model, and added few columns
```py
class res_ company(models.Model):
_name = "res.company"
_inherit = "res.company"
manager_name = fields.Char()
```
but it when i restart odoo, i receive the following error:
```
ProgrammingError: column res.co... | 2017/09/13 | [
"https://Stackoverflow.com/questions/46198430",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4378079/"
] | Solved the problem, i had to update the base module, now it works. | In terminal you can update your base and it solves the problem
Cmd : Python odoo-bin -c -d -u base
It takes time to update so be patient |
2,008,358 | I have got a question Which is as follow:
**If there are n participants in a knockout tournament then prove that (n-1) matches will be needed to declare a champion**.
If I prove this problem using knowledge of combinatorics then it is not so hard, but the question specifically asks to prove the question by use of pri... | 2016/11/10 | [
"https://math.stackexchange.com/questions/2008358",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/363566/"
] | $$\frac{y}{y+1}dy=2xdx$$
$$(1-\frac{1}{y+1})dy=2xdx$$
integrate both sides
$$y-\log|y+1|=x^2+C$$ | You missed it when you tried to solve the terms separately like that.
The solution is not too hard: The equation is
$$
2x(y+1)dx = y\,dy
$$
which makes it natural to use $v = y+1$ whence $dy = dv$ and
$$2x\,dx = (1-\frac1v) dv \\
x^2 = V - \log v +K \\
x = \sqrt{y+(K+1) - \log(y+1)} = \sqrt{y+C - \log(y+1)}
$$
and... |
72,150,475 | [](https://i.stack.imgur.com/jbh2B.png)
Trying to get current user info after creating a new user but getting this error " The function can't be unconditionally invoked because it can be 'null' " while trying to invoke ".currentUser()" method how to f... | 2022/05/07 | [
"https://Stackoverflow.com/questions/72150475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10118807/"
] | solved it the problem was i was calling "final user =\_auth.currentUser()" function which had been changed to "final user =\_auth.currentUser" currentUser was a getter and also no need of await keyword and to get email ,uid etc from user we should check
if user is null then acess email and uid etc.
```
enter code here... | As the error says, you should add a null check as below:
```
filan user = await _auth!.currentUser();
```
Because `_auth` can be null. Also you can use this code:
```
filan user = await _auth?.currentUser() ?? User(); // the name of user class
``` |
31,381,385 | I'm getting following error and I don't know why (this error is VERY RARE and not reproducable for me):
```
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setBounds(int, int, int, int)' on a null object reference
at android.widget.ImageView.animateTransform(Im... | 2015/07/13 | [
"https://Stackoverflow.com/questions/31381385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1439522/"
] | A Fragment or Activity transition is trying to animate an ImageView which has no drawable set. Ensure you always have a Drawable set for your ImageView when you animate it with ChangeImageTransform (or disable this kind of animation) | I followed answer made by @BladeCoder in this thread. His solution was just one part if you used Universal Image Loader.
After adding placeholder to ImageView, you need also to put some image or color (depends of your needs) to XML. |
48,306,750 | Our team is trying to create an ETL into Redshift to be our data warehouse for some reporting. We are using Microsoft SQL Server and have partitioned out our database into 40+ datasources. We are looking for a way to be able to pipe the data from all of these identical data sources into 1 Redshift DB.
Looking at AWS G... | 2018/01/17 | [
"https://Stackoverflow.com/questions/48306750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3379952/"
] | This sounds like an excellent use-case for Matillion ETL for Redshift.
*(Full disclosure: I am the product manager for Matillion ETL for Redshift)*
Matillion is an ELT tool - it will Extract data from your (numerous) SQL server databases and Load them, via an efficient Redshift COPY, into some staging tables (which c... | You can use AWS DMS for this.
Steps:
1. set up and configure DMS instance
2. set up target endpoint for redshift
3. set up source endpoints for each sql server instance see
<https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.SQLServer.html>
4. set up a task for each sql server source, you can specify the ta... |
266,613 | (Please see the edit part for the real problem)
I have two expressions which are same but written in different ways.
```
expr1 = ConditionalExpression[Plus[1, Times[-1, x]],
Inequality[0, LessEqual, x, LessEqual, Rational[1, 2]]]
```
[](https://... | 2022/04/12 | [
"https://mathematica.stackexchange.com/questions/266613",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/82512/"
] | ```
f[x_] = Hypergeometric1F1[ 1 + (-2 (2 - 2 Sqrt[2 x]) - 4 Sqrt[2 x])/(4 Sqrt[2 (-x)]), 2, 10 Sqrt[2 (-x)]];
plot=Plot[Re[f[x]], {x, 0, 10}, Mesh -> {{0}}, MeshFunctions -> {#2 &}, MeshStyle -> Red, Method -> {"AxesInFront" -> False}];
list = Cases[plot, Point[a_] :> a, Infinity][[1]];
pts = Cases[plot, Grap... | You might analyse the plot using `Graphics`Mesh`FindIntersections`
```
pic = Plot[{Re[f[x]], 0}, {x, 0, 10}]
np = Graphics`Mesh`FindIntersections[pic[[All, 1]]];
(*{{0.0493613, 8.13152*10^-20}, {0.141112, 0.}, {0.444084,4.33681*10^-19},
{1.05335,0.}, {1.23352, -3.48029*10^-17}, {2.38238, 0.},
{2.41799,2.98407*... |
26,089,759 | Starting from the Launcher activity i need a way to know what level (hierarchy) the app is at.
For example image the user is in a shopping app & takes the following path:
1. Main Activity ---> 2. list of shoes to buy ----> 3. shopping cart ---> 4. checkout
so checkout would be level 4. and when the user is just loo... | 2014/09/28 | [
"https://Stackoverflow.com/questions/26089759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/835883/"
] | I'm not sure if I clearly understand what you mean by *The reduce function will get an array of quadruplets like { variance, sumsquare, sum, count } for each subset of the entire dataset that was mapped onto a set of workers*. Still, based on your code snipped I'd use something like:
```js
Array.sums = function (arr, ... | As far as I can tell, the "naive" solution that was added to the original question is as good as it gets, in the sense that it relies on three aggregations (count, sum, and sumsquare) that would be required to calculate a variance in one pass anyway, and all it does is to sum the individual aggregations, which would al... |
607,695 | I am writing a shell script for docker containers.
I want to check before running my script whether it's docker container or host machine.
something like this:
```
if $MACHINE=docker; then
echo proceed
elif $MACHINE=host; then
echo 'it's not container'
exit
fi
``` | 2020/09/03 | [
"https://unix.stackexchange.com/questions/607695",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/205721/"
] | You can check if any of the control groups belong to docker:
```
if grep -q docker /proc/1/cgroup; then
echo inside docker
else
echo on host
exit
fi
``` | You can use `virt-what`, it can identify Docker now. You can install it either using `apt install virt-what` or `yum install virt-what`, on Debian and derivatives or Red Hat and derivatives respectively. If it returns code 0, no error, it's a physical machine or unidentified virtual machine type. Docker returns `docker... |
607,695 | I am writing a shell script for docker containers.
I want to check before running my script whether it's docker container or host machine.
something like this:
```
if $MACHINE=docker; then
echo proceed
elif $MACHINE=host; then
echo 'it's not container'
exit
fi
``` | 2020/09/03 | [
"https://unix.stackexchange.com/questions/607695",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/205721/"
] | You can use `virt-what`, it can identify Docker now. You can install it either using `apt install virt-what` or `yum install virt-what`, on Debian and derivatives or Red Hat and derivatives respectively. If it returns code 0, no error, it's a physical machine or unidentified virtual machine type. Docker returns `docker... | This doesn’t work with cgroup 2.0, and it doesn’t work inside Docker Desktop on Mac.
```
root@8a1d175a0b6c:/# cat /proc/self/cgroup
0::/
```
The presence of a `/.dockerenv` file on the root filesystem in Linux is probably a more reliable way to know that you’re running inside a Docker container, but that doesn’t gi... |
607,695 | I am writing a shell script for docker containers.
I want to check before running my script whether it's docker container or host machine.
something like this:
```
if $MACHINE=docker; then
echo proceed
elif $MACHINE=host; then
echo 'it's not container'
exit
fi
``` | 2020/09/03 | [
"https://unix.stackexchange.com/questions/607695",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/205721/"
] | You can check if any of the control groups belong to docker:
```
if grep -q docker /proc/1/cgroup; then
echo inside docker
else
echo on host
exit
fi
``` | This doesn’t work with cgroup 2.0, and it doesn’t work inside Docker Desktop on Mac.
```
root@8a1d175a0b6c:/# cat /proc/self/cgroup
0::/
```
The presence of a `/.dockerenv` file on the root filesystem in Linux is probably a more reliable way to know that you’re running inside a Docker container, but that doesn’t gi... |
70,527,200 | Trying to solve this puzzle in JavaScript:
Input: An array containing x amoung of arrays of numbers. Heres example:
```
[
[1,4],
[6,8],
[10]
]
```
Expected Output: I would want to run some sort of code to turn it into:
```
1-4,6-8,10
```
I've tried join("-") and tried the same thing within a forEach() loop but c... | 2021/12/30 | [
"https://Stackoverflow.com/questions/70527200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17544803/"
] | It is better to show your work than to search for answers to copy and paste here.
The below example below does not take responsive design into account, using bootstrap-4.
You can take it as reference and check the meaning of different class like `ml-3`, `shadow` from [Bootstrap](https://getbootstrap.com/docs/4.6/gett... | You can simply use **transform:skew();**
here is an exapmle.
```html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.parallelogram {
width: 100px;
height: 50px;
transform: skew(20deg);
background: #555;
}
</style>
</head>
<body>
<h2>Parallelo... |
32,090,531 | I'm using Squeryl 0.9.5-7 and Postgres 9.4 with jsonb datatype and want to insert some data:
```
case class Log(id: String, meta: String) //meta will contain json
val logs = table[Log]
logs.insert(Log(randomId, "{\"Hi\": \"I'm a json!\"}"))
```
But got a typecast error that says *"Column meta has jsonb type but expr... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32090531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2578910/"
] | I found a better way, that doesn't require to create a CAST in the database.
If you're using squeryl 0.9.6, you can add an explicit cast in your schema which tells squeryl to explicitly cast your string into a jsonb.
```
on(logs)(s => declare(
s.meta is (dbType("jsonb").explicitCast) // enables explicit casting in... | With Squeryl 0.9.6 you can register support for your own custom types. Here's [an example](https://github.com/max-l/squeryl-extended-field-types-example/blob/master/src/main/scala/example/MyCustomTypes.scala). For non standard operators, take a look at [custom functions](http://squeryl.org/custom-functions.html) |
32,090,531 | I'm using Squeryl 0.9.5-7 and Postgres 9.4 with jsonb datatype and want to insert some data:
```
case class Log(id: String, meta: String) //meta will contain json
val logs = table[Log]
logs.insert(Log(randomId, "{\"Hi\": \"I'm a json!\"}"))
```
But got a typecast error that says *"Column meta has jsonb type but expr... | 2015/08/19 | [
"https://Stackoverflow.com/questions/32090531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2578910/"
] | I found a better way, that doesn't require to create a CAST in the database.
If you're using squeryl 0.9.6, you can add an explicit cast in your schema which tells squeryl to explicitly cast your string into a jsonb.
```
on(logs)(s => declare(
s.meta is (dbType("jsonb").explicitCast) // enables explicit casting in... | In my experience with postgres 9.4, reading works fine as a Squeryl String but inserting fails with:
>
> ERROR: column "\*\*\*\*" is of type json but expression is of type
> character varying [error] Hint: You will need to rewrite or cast the
> expression. [error] Position: 166 [error] errorCode: 0, sqlState:
> 42... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | If you chase an enemy piece, you should probably consider three aspects:
* Basic tactical considerations.
* Do you improve the position of the piece you use to chase the enemy piece?
* Do you force the enemy piece on a worse or a better square?
In your example this means if you don't see that you are blundering pawns... | This issue arises when you don't know the openings well enough.
First off your objective in the opening is to occupy the center and gain an advantage using that. Chasing after pieces will most likely end up getting you in trouble especially if you're the type of player who prefers not to give away the queen.
So for s... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | This issue arises when you don't know the openings well enough.
First off your objective in the opening is to occupy the center and gain an advantage using that. Chasing after pieces will most likely end up getting you in trouble especially if you're the type of player who prefers not to give away the queen.
So for s... | Opening theory is NOT the answer to this. Beginner and novice players should NOT be studying opening theory for any reason whatsoever.
This is just simple chess strategy. There is no reason to chase a piece unless you get something out of it, either improving the position of your own pieces or degrading the position ... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | This issue arises when you don't know the openings well enough.
First off your objective in the opening is to occupy the center and gain an advantage using that. Chasing after pieces will most likely end up getting you in trouble especially if you're the type of player who prefers not to give away the queen.
So for s... | In this case ...d4 might be overextending. The answer might not be "when do I stop" but "when can/should I make my threats subtler." I remember I used to like to attack the opponent's queen a lot. I felt active. But the thing is, ...Nf6 instead of ...d4 is a good idea as Nd5 and Ng4 may both be threats.
Similarly, ...... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | This issue arises when you don't know the openings well enough.
First off your objective in the opening is to occupy the center and gain an advantage using that. Chasing after pieces will most likely end up getting you in trouble especially if you're the type of player who prefers not to give away the queen.
So for s... | The best strategy is to feel out your opponent. If he/she is the type of player that tends to sacrifice or maybe tends to defend and doesn't take risks. Whatever the case play each game to your advantage and adjust your game for different players. I swear chess is 90% mental 10% logic reasoning.
It may be difficult as ... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | If you chase an enemy piece, you should probably consider three aspects:
* Basic tactical considerations.
* Do you improve the position of the piece you use to chase the enemy piece?
* Do you force the enemy piece on a worse or a better square?
In your example this means if you don't see that you are blundering pawns... | Opening theory is NOT the answer to this. Beginner and novice players should NOT be studying opening theory for any reason whatsoever.
This is just simple chess strategy. There is no reason to chase a piece unless you get something out of it, either improving the position of your own pieces or degrading the position ... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | If you chase an enemy piece, you should probably consider three aspects:
* Basic tactical considerations.
* Do you improve the position of the piece you use to chase the enemy piece?
* Do you force the enemy piece on a worse or a better square?
In your example this means if you don't see that you are blundering pawns... | In this case ...d4 might be overextending. The answer might not be "when do I stop" but "when can/should I make my threats subtler." I remember I used to like to attack the opponent's queen a lot. I felt active. But the thing is, ...Nf6 instead of ...d4 is a good idea as Nd5 and Ng4 may both be threats.
Similarly, ...... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | If you chase an enemy piece, you should probably consider three aspects:
* Basic tactical considerations.
* Do you improve the position of the piece you use to chase the enemy piece?
* Do you force the enemy piece on a worse or a better square?
In your example this means if you don't see that you are blundering pawns... | The best strategy is to feel out your opponent. If he/she is the type of player that tends to sacrifice or maybe tends to defend and doesn't take risks. Whatever the case play each game to your advantage and adjust your game for different players. I swear chess is 90% mental 10% logic reasoning.
It may be difficult as ... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | Opening theory is NOT the answer to this. Beginner and novice players should NOT be studying opening theory for any reason whatsoever.
This is just simple chess strategy. There is no reason to chase a piece unless you get something out of it, either improving the position of your own pieces or degrading the position ... | In this case ...d4 might be overextending. The answer might not be "when do I stop" but "when can/should I make my threats subtler." I remember I used to like to attack the opponent's queen a lot. I felt active. But the thing is, ...Nf6 instead of ...d4 is a good idea as Nd5 and Ng4 may both be threats.
Similarly, ...... |
8,714 | I'm only a beginner, and I've found that sometimes a piece of mine (esp Queen) will just get chased around relentlessly causing problems, so I've started trying to do the same, but I seem to sometimes overextend and it feels like I am "following" not chasing. Any advice on when to stop chasing? What should I be looking... | 2015/03/04 | [
"https://chess.stackexchange.com/questions/8714",
"https://chess.stackexchange.com",
"https://chess.stackexchange.com/users/6963/"
] | Opening theory is NOT the answer to this. Beginner and novice players should NOT be studying opening theory for any reason whatsoever.
This is just simple chess strategy. There is no reason to chase a piece unless you get something out of it, either improving the position of your own pieces or degrading the position ... | The best strategy is to feel out your opponent. If he/she is the type of player that tends to sacrifice or maybe tends to defend and doesn't take risks. Whatever the case play each game to your advantage and adjust your game for different players. I swear chess is 90% mental 10% logic reasoning.
It may be difficult as ... |
52,088,126 | I've been working with Dates lately for a project and have noticed something strange that I don't think makes sense (or, at least it doesn't make sense to me).
In javascript, you can create a new date, and by default, if you get the month, it will return the current month number minus one.
```
let dt = new Date();//A... | 2018/08/30 | [
"https://Stackoverflow.com/questions/52088126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In addition to the +1, `dt.getMonth()` returns the **local month** based on system settings, whereas Date.UTC will interpret the second parameter as the **UTC month**.
The UTC month differs for the period of the local timezone offset either side of midnight on the last/first day of the month. So if today is 31 August ... | Taken from [this page](https://www.geeksforgeeks.org/date-utc-javascript/):
>
> Parameters Used:
>
>
> […]
>
>
> * month: To specify an integer
> between 0 and 11 representing the month.
>
>
> […]
>
>
>
This means, that you simply should pass a value between 0 and 11, where 0 represents January and 11 repre... |
64,207,323 | I keep getting this error
```
Warning: Cannot update a component from inside the function body of a different component.
```
the code still seems to work even when this error is thrown. It happens when I use setState with textInput components for example -
```
return (
<View style={styles.container}>
... | 2020/10/05 | [
"https://Stackoverflow.com/questions/64207323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13490592/"
] | Disable the button when you making the 1st AJAX request. It will prevent from the second AJAX request. | I have added the following code in the click event of the modal button.This worked for me
```
$(document).on("click", '#proceed', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
$('#confirm').modal('toggle');
--ajax call
});
`... |
64,207,323 | I keep getting this error
```
Warning: Cannot update a component from inside the function body of a different component.
```
the code still seems to work even when this error is thrown. It happens when I use setState with textInput components for example -
```
return (
<View style={styles.container}>
... | 2020/10/05 | [
"https://Stackoverflow.com/questions/64207323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13490592/"
] | You have binding the click event on the `#confirm button#proceed` two times, try this code :
```html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet... | I have added the following code in the click event of the modal button.This worked for me
```
$(document).on("click", '#proceed', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
$('#confirm').modal('toggle');
--ajax call
});
`... |
64,207,323 | I keep getting this error
```
Warning: Cannot update a component from inside the function body of a different component.
```
the code still seems to work even when this error is thrown. It happens when I use setState with textInput components for example -
```
return (
<View style={styles.container}>
... | 2020/10/05 | [
"https://Stackoverflow.com/questions/64207323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13490592/"
] | I had the same problem, a solution is to unbind click from #proceed button.
```
$(document).on("click", '#confirm button#proceed', function(e) {
$('#confirm').modal('toggle');
$("#proceed").off('click').on('click', function(e){
e.preventDefault();
... | I have added the following code in the click event of the modal button.This worked for me
```
$(document).on("click", '#proceed', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
$('#confirm').modal('toggle');
--ajax call
});
`... |
28,278,269 | I try to convert some data into a javascript object. The data looks like this:
```
data = [["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]]
```
What I want to get is:
```
a = {
"a":{
"a":"value1",
"b":"value2"
},
"b":"value3",
"c":{
... | 2015/02/02 | [
"https://Stackoverflow.com/questions/28278269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806392/"
] | This should be the function you're looking for:
```
function addItemToObject(dict, path){
if (path.length == 2){
dict[path[0]] = path[1];
} else {
key = path.shift()
if (! dict[key]) {
dict[key] = {};
}
addItemToObject(dict[key], path);
}
return dict;
}
var result = data.reduce(addIt... | I don't get your desired solution as there are 4 blocks of data but only 3 properties in the final object.
However, this is how you can iterate through an array and its child arrays:
```
var data = [["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]];
//Store your results in h... |
28,278,269 | I try to convert some data into a javascript object. The data looks like this:
```
data = [["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]]
```
What I want to get is:
```
a = {
"a":{
"a":"value1",
"b":"value2"
},
"b":"value3",
"c":{
... | 2015/02/02 | [
"https://Stackoverflow.com/questions/28278269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806392/"
] | Here's a solution using Ramda.js
================================
```js
const data = [
["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]
]
const transformData =
R.pipe(
R.map(R.juxt([R.init, R.last])),
R.reduce(
(obj, [path, value]) =>
... | I don't get your desired solution as there are 4 blocks of data but only 3 properties in the final object.
However, this is how you can iterate through an array and its child arrays:
```
var data = [["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]];
//Store your results in h... |
28,278,269 | I try to convert some data into a javascript object. The data looks like this:
```
data = [["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]]
```
What I want to get is:
```
a = {
"a":{
"a":"value1",
"b":"value2"
},
"b":"value3",
"c":{
... | 2015/02/02 | [
"https://Stackoverflow.com/questions/28278269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806392/"
] | This should be the function you're looking for:
```
function addItemToObject(dict, path){
if (path.length == 2){
dict[path[0]] = path[1];
} else {
key = path.shift()
if (! dict[key]) {
dict[key] = {};
}
addItemToObject(dict[key], path);
}
return dict;
}
var result = data.reduce(addIt... | Here's a solution using Ramda.js
================================
```js
const data = [
["a","a","a","value1"],
["a","a","b","value2"],
["a","b","value3"],
["a","c","a","value4"]
]
const transformData =
R.pipe(
R.map(R.juxt([R.init, R.last])),
R.reduce(
(obj, [path, value]) =>
... |
2,087,205 | I am facing an issue while making a common grid control.
When I put
colModel:[ {name:"ID", index: "ID", width: 400, align: "Left"},{name:"Description", index: "Description", width: 400, align: "Left"}],
It works.
When I am trying to replace the ColModel by a string variable I am not getting right display. colModel:... | 2010/01/18 | [
"https://Stackoverflow.com/questions/2087205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253302/"
] | 1. Try eval("([" + ColModel + "])")
2. [Get FireBug](http://www.getfirebug.org) | The `[]` indicate that its is an array.
Try this
```
var ColModel = [{name:"ID", index: "ID", width: 400, align: "Left"},{name:"Description", index: "Description", width: 400, align: "Left"}]
$("#gridid").jqGrid({
~
colModel:ColModel
~});
``` |
70,581,458 | This is an example of table data that I am working on (the table contained a lot of columns, I am showing here only the relevant ones):
| Id | job\_number | status | parent\_id |
| --- | --- | --- | --- |
| 1 | 42FWD-42 | 0 | 0 |
| 2 | 42FWD-42 | 1 | 1 |
| 3 | 42FWD-42 | 5 | 1 |
`Id` is auto generated. `parent_id` li... | 2022/01/04 | [
"https://Stackoverflow.com/questions/70581458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/262883/"
] | First I must mention you should block identical rows by means of a `unique constraint`. I suggest that once you have eliminated all duplicates you put up a such a constraint to keep this from happening again.
Now for your question, you can do this by grouping on the duplicate columns, and have only those that count mo... | you can try to use `ROW_NUMBER` window function to get duplicate row data and its `id` by `job_number`, then using cte recursive to find all error records by this `id`
**Query 1**:
```
;WITH CTE AS (
SELECT *,ROW_NUMBER() OVER (PARTITION BY job_number ORDER BY Id) rn
FROM T
WHERE status = 0
), CTE1 AS (
S... |
72,209,375 | With Golangs new generics we have the tilde operator ~ which will match the underlying type. In what case is it valid to **NOT** match the underlying type? I'm trying to understand why the current behavior with the tilde is not the default behavior. It seems unnecessary to support both.
For example, why would you writ... | 2022/05/12 | [
"https://Stackoverflow.com/questions/72209375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2221248/"
] | Not using the `~` operator means you only accept the listed exact types. Why should this matter?
You may want to use the values of the exact types to set to other variables and else type conversion would be required. And because the saying goes *"new type, new method set"*. New types having the same underlying type ha... | >
> Why is the tilde behavior not the default, and thus the language would not require another operator?
>
>
>
Because if the approximation would be the default unconditionally you could not express the fact that your polymorphic function requires an `int` and not a `MyInt`. You would then have to introduce an ope... |
72,209,375 | With Golangs new generics we have the tilde operator ~ which will match the underlying type. In what case is it valid to **NOT** match the underlying type? I'm trying to understand why the current behavior with the tilde is not the default behavior. It seems unnecessary to support both.
For example, why would you writ... | 2022/05/12 | [
"https://Stackoverflow.com/questions/72209375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2221248/"
] | >
> Why is the tilde behavior not the default
>
>
>
Because it would be confusing and semantically unsound to write a function like `func Foo[T int](v T)` that accepts type parameters that are not `int`. Then the meaning of `int` in interface constraints would not be the same as everywhere else. ([More on this dis... | >
> Why is the tilde behavior not the default, and thus the language would not require another operator?
>
>
>
Because if the approximation would be the default unconditionally you could not express the fact that your polymorphic function requires an `int` and not a `MyInt`. You would then have to introduce an ope... |
72,209,375 | With Golangs new generics we have the tilde operator ~ which will match the underlying type. In what case is it valid to **NOT** match the underlying type? I'm trying to understand why the current behavior with the tilde is not the default behavior. It seems unnecessary to support both.
For example, why would you writ... | 2022/05/12 | [
"https://Stackoverflow.com/questions/72209375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2221248/"
] | Not using the `~` operator means you only accept the listed exact types. Why should this matter?
You may want to use the values of the exact types to set to other variables and else type conversion would be required. And because the saying goes *"new type, new method set"*. New types having the same underlying type ha... | >
> Why is the tilde behavior not the default
>
>
>
Because it would be confusing and semantically unsound to write a function like `func Foo[T int](v T)` that accepts type parameters that are not `int`. Then the meaning of `int` in interface constraints would not be the same as everywhere else. ([More on this dis... |
182,465 | I have a Netgear VVG2000 VDSL router/modem from my ADSL provider. Its Ethernet ports are 10/100 and it doesn't have external wireless antennae, so I'd rather stick to my D-Link DIR-655 as the primary router. I'm connecting to my ISP using PPPoE. Therefore, my current configuration is this:
All wireless and wired devic... | 2010/09/18 | [
"https://serverfault.com/questions/182465",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Your last paragraph is correct.
The "Recursion Desired" (RD) flag sent by the client in the DNS request header (see RFC 1035) asks the server "please give me the complete answer to this question".
That server than *iteratively* asks the chain of name servers for the correct answer. Those queries shouldn't themselves ... | As far as I understand it, "recursive lookup" is solely from the view of the original querier. So, if it asks a DNS server and gets a completely resolved answer back, then it is a "recursive query". If that server in turn does recursive or iterative lookups is, well, not something the original querier has to care about... |
182,465 | I have a Netgear VVG2000 VDSL router/modem from my ADSL provider. Its Ethernet ports are 10/100 and it doesn't have external wireless antennae, so I'd rather stick to my D-Link DIR-655 as the primary router. I'm connecting to my ISP using PPPoE. Therefore, my current configuration is this:
All wireless and wired devic... | 2010/09/18 | [
"https://serverfault.com/questions/182465",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | As far as I understand it, "recursive lookup" is solely from the view of the original querier. So, if it asks a DNS server and gets a completely resolved answer back, then it is a "recursive query". If that server in turn does recursive or iterative lookups is, well, not something the original querier has to care about... | The first of the two diagrams in your question is incorrect. Root servers don't send queries to other servers. If the root servers did in fact forward queries like shown in that diagram the DNS system would be a lot more vulnerable to DoS attacks than it really is.
The second diagram is mostly correct but too simplifi... |
182,465 | I have a Netgear VVG2000 VDSL router/modem from my ADSL provider. Its Ethernet ports are 10/100 and it doesn't have external wireless antennae, so I'd rather stick to my D-Link DIR-655 as the primary router. I'm connecting to my ISP using PPPoE. Therefore, my current configuration is this:
All wireless and wired devic... | 2010/09/18 | [
"https://serverfault.com/questions/182465",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Your last paragraph is correct.
The "Recursion Desired" (RD) flag sent by the client in the DNS request header (see RFC 1035) asks the server "please give me the complete answer to this question".
That server than *iteratively* asks the chain of name servers for the correct answer. Those queries shouldn't themselves ... | The first of the two diagrams in your question is incorrect. Root servers don't send queries to other servers. If the root servers did in fact forward queries like shown in that diagram the DNS system would be a lot more vulnerable to DoS attacks than it really is.
The second diagram is mostly correct but too simplifi... |
5,571,193 | So I have some code that takes a string and pads some zeros onto the end in order to make it 7 digits in length.
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '#######')
```
The problem with this is when a number like "001" gets put in, it returns "1000000" when I need it to return "00100... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5571193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695423/"
] | It looks like the data type you are starting from (it's not entirely clear) is a numeric data type. If leading zeroes are important and need to be kept, then a numeric data type is the wrong one to use. When "001" is not the same as "1", and you don't intended to add, subtract, etc..., then what you're dealing with is ... | There are no leading zero's in an numeric value so you can't directly do what you want.
Assuming that the max value of your numeric is 999 (3 places) as you implied, do something like the following.
1. Convert the numeric value to a string.
2. Check the length of the string.
3. If the string length is less than 3, pa... |
5,571,193 | So I have some code that takes a string and pads some zeros onto the end in order to make it 7 digits in length.
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '#######')
```
The problem with this is when a number like "001" gets put in, it returns "1000000" when I need it to return "00100... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5571193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695423/"
] | just use the string function
a required number can be specified with '0' in the format string
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '0000000')
``` | It looks like the data type you are starting from (it's not entirely clear) is a numeric data type. If leading zeroes are important and need to be kept, then a numeric data type is the wrong one to use. When "001" is not the same as "1", and you don't intended to add, subtract, etc..., then what you're dealing with is ... |
5,571,193 | So I have some code that takes a string and pads some zeros onto the end in order to make it 7 digits in length.
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '#######')
```
The problem with this is when a number like "001" gets put in, it returns "1000000" when I need it to return "00100... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5571193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695423/"
] | If what's below doesn't do what you want you'll have to provide examples of expected inputs and outputs.
`outputString = left(inputString + fill("0", 7), 7)`
Replacing the constants with variables yields the [rpad](http://www.techonthenet.com/oracle/functions/rpad.php) function available in some languages.
rpad(inpu... | There are no leading zero's in an numeric value so you can't directly do what you want.
Assuming that the max value of your numeric is 999 (3 places) as you implied, do something like the following.
1. Convert the numeric value to a string.
2. Check the length of the string.
3. If the string length is less than 3, pa... |
5,571,193 | So I have some code that takes a string and pads some zeros onto the end in order to make it 7 digits in length.
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '#######')
```
The problem with this is when a number like "001" gets put in, it returns "1000000" when I need it to return "00100... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5571193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695423/"
] | just use the string function
a required number can be specified with '0' in the format string
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '0000000')
``` | If what's below doesn't do what you want you'll have to provide examples of expected inputs and outputs.
`outputString = left(inputString + fill("0", 7), 7)`
Replacing the constants with variables yields the [rpad](http://www.techonthenet.com/oracle/functions/rpad.php) function available in some languages.
rpad(inpu... |
5,571,193 | So I have some code that takes a string and pads some zeros onto the end in order to make it 7 digits in length.
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '#######')
```
The problem with this is when a number like "001" gets put in, it returns "1000000" when I need it to return "00100... | 2011/04/06 | [
"https://Stackoverflow.com/questions/5571193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695423/"
] | just use the string function
a required number can be specified with '0' in the format string
```
uo_sin.uo_em_sin_number.em_sin_number.text = string(long(ilCurrSin), '0000000')
``` | There are no leading zero's in an numeric value so you can't directly do what you want.
Assuming that the max value of your numeric is 999 (3 places) as you implied, do something like the following.
1. Convert the numeric value to a string.
2. Check the length of the string.
3. If the string length is less than 3, pa... |
45,704,513 | I've tried pretty much every possible bucket policy. Also tried adding a policy to the user, but I get Access Denied every time I try to download an object from s3 bucket using the AWS Console.
**Bucket Policy:**
```
{
"Version": "2012-10-17",
"Id": "MyPolicy",
"Statement": [
{
"Effect... | 2017/08/16 | [
"https://Stackoverflow.com/questions/45704513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559036/"
] | As strange as it sounds, it is possible to upload an object to Amazon S3 that the account owning the bucket **cannot access**.
When an object is uploaded to Amazon S3 (`PutObject`), it is possible to specify an Access Control List (ACL). Possible values are:
* private
* public-read
* public-read-write
* authenticated... | You can solve it by using : <http://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-acl.html>
put-object-acl : This has to be done by original uploader.
But is definitely faster than copying data again.
I had TB's of data to deal with.
```
aws s3api put-bucket-acl --bucket $foldername --key $i --grant-ful... |
8,212,295 | I have working in jquery sortable, all are working fine. but empty div will not accept the draggable content.
Here My jquery,
```
$( ".dropfalse" ).sortable({
connectWith: ".dropfalse",
revert: true,
tolerance: 'pointer',
placeholder: "ui-state-highlight"... | 2011/11/21 | [
"https://Stackoverflow.com/questions/8212295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/824280/"
] | Are you sure, the target div does not have zero dimensions, probably height. | I had the same problem with a div that, when empty, wouldn't receive any droppable item. I fixed this just by defining a min-height and min-width for the sortable div, so even when the div is empty, you are going to have the it with same area where you can put the draggable or sortable. Without the minimun dimensions y... |
17,575,653 | Any ideas as to why my data isn't being updated? Is their something fundamentally wrong with how I'm writing my prepared statement?
**The form:**
```
while($log_dates = mysqli_fetch_assoc($q_log_dates_result)) {
echo "<tr>";
echo "<input type='hidden' name='data[][log_dates_ID]' value='" . $log_dates['log_dates... | 2013/07/10 | [
"https://Stackoverflow.com/questions/17575653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1040259/"
] | Your UPDATE syntax is not correct. It should be:
```
UPDATE log_dates
SET week_date = ?, crew_chief = ?, monday_crew = ?
WHERE log_dates_ID = ?
```
You're trying to user `INSERT` syntax in an `UPDATE` statement. They're not similar at all.
[Documentation](http://dev.mysql.com/doc/refman/5.0/en/update.html) | I would do it like this...
Inside a function...
```
function updatedata($week_date, $crew_chief, $monday_crew, $log_dates_ID){
$stmt = $connection->stmt_init();
$stmt->prepare("UPDATE log_dates SET (week_date, crew_chief, monday_crew) VALUES (?, ?, ?) WHERE log_dates_ID = ?"))
$stmt->bind_param($week_date, $crew_... |
2,263,313 | Why doesn't this [`eval`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/eval) call [`alert("Summer")`](https://developer.mozilla.org/en/window.alert)?
```
eval('(caption="Summer";alert(caption))');
```
Does it have something to do with the quotes in "Summer"? | 2010/02/14 | [
"https://Stackoverflow.com/questions/2263313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272697/"
] | ```
Uncaught SyntaxError: Unexpected token ;
```
The outer parentheses make no syntactical sense. Try this:
```
eval('caption="Summer";alert(caption)');
``` | The extra parentheses are wrong, this is correct:
```
eval('caption="Summer";alert(caption)');
``` |
2,263,313 | Why doesn't this [`eval`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/eval) call [`alert("Summer")`](https://developer.mozilla.org/en/window.alert)?
```
eval('(caption="Summer";alert(caption))');
```
Does it have something to do with the quotes in "Summer"? | 2010/02/14 | [
"https://Stackoverflow.com/questions/2263313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272697/"
] | The extra parentheses are wrong, this is correct:
```
eval('caption="Summer";alert(caption)');
``` | A more better way to do this and avoid syntax problem is to do following,
`eval(function(){var x="test"; alert(x)}());` |
2,263,313 | Why doesn't this [`eval`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/eval) call [`alert("Summer")`](https://developer.mozilla.org/en/window.alert)?
```
eval('(caption="Summer";alert(caption))');
```
Does it have something to do with the quotes in "Summer"? | 2010/02/14 | [
"https://Stackoverflow.com/questions/2263313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272697/"
] | ```
Uncaught SyntaxError: Unexpected token ;
```
The outer parentheses make no syntactical sense. Try this:
```
eval('caption="Summer";alert(caption)');
``` | Chrome console:
```
eval('(caption="Summer";alert(caption))')
SyntaxError: Unexpected token ;
```
This works:
```
eval('caption="Summer"; alert(caption)')
``` |
2,263,313 | Why doesn't this [`eval`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/eval) call [`alert("Summer")`](https://developer.mozilla.org/en/window.alert)?
```
eval('(caption="Summer";alert(caption))');
```
Does it have something to do with the quotes in "Summer"? | 2010/02/14 | [
"https://Stackoverflow.com/questions/2263313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272697/"
] | ```
Uncaught SyntaxError: Unexpected token ;
```
The outer parentheses make no syntactical sense. Try this:
```
eval('caption="Summer";alert(caption)');
``` | A more better way to do this and avoid syntax problem is to do following,
`eval(function(){var x="test"; alert(x)}());` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.