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 |
|---|---|---|---|---|---|
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | Since last year, these kind of pills are theoretically available without prescription, however it's been recently discussed and it might get forbidden again (conservative government). What's more, we also have a stuipd law called "conscience clause" which tells that a doctor or a pharmacist may refuse to give you any k... | From my understanding, the morning after pill is currently available without a prescription but that may soon change, due to the conservative government. If you check out the Gynopedia page on Warsaw (<http://gynopedia.org/Warsaw>), you can find updated information on the availability of morning after pill, birth contr... |
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | Since last year, these kind of pills are theoretically available without prescription, however it's been recently discussed and it might get forbidden again (conservative government). What's more, we also have a stuipd law called "conscience clause" which tells that a doctor or a pharmacist may refuse to give you any k... | In Cracow you can get pill in gynecological clinic NZOZ Arka. Here is the address:
NZOZ Arka Cracow
Krolowej Jadwigi 15
Emergency phone number: +48 692464346 |
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | Since last year, these kind of pills are theoretically available without prescription, however it's been recently discussed and it might get forbidden again (conservative government). What's more, we also have a stuipd law called "conscience clause" which tells that a doctor or a pharmacist may refuse to give you any k... | For anyone else reading this topic: you can't buy a morning-after pill without a prescription in Poland.
As of July 2018, in order to buy a morning-after pill you need a prescription. And the doctor can refuse to write you one, just like the pharmacist can refuse to sell you pills (even if you have a prescription) - s... |
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | From my understanding, the morning after pill is currently available without a prescription but that may soon change, due to the conservative government. If you check out the Gynopedia page on Warsaw (<http://gynopedia.org/Warsaw>), you can find updated information on the availability of morning after pill, birth contr... | In Cracow you can get pill in gynecological clinic NZOZ Arka. Here is the address:
NZOZ Arka Cracow
Krolowej Jadwigi 15
Emergency phone number: +48 692464346 |
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | From my understanding, the morning after pill is currently available without a prescription but that may soon change, due to the conservative government. If you check out the Gynopedia page on Warsaw (<http://gynopedia.org/Warsaw>), you can find updated information on the availability of morning after pill, birth contr... | For anyone else reading this topic: you can't buy a morning-after pill without a prescription in Poland.
As of July 2018, in order to buy a morning-after pill you need a prescription. And the doctor can refuse to write you one, just like the pharmacist can refuse to sell you pills (even if you have a prescription) - s... |
60,197 | I am going to visit Poland for some time, and I was wondering if there is ANY kind of morning-after pill available without medical prescription in Poland?
I am in Germany right now and they made it available here without prescription but only the person who is going to use can buy it, maybe you know if there is any c... | 2015/12/19 | [
"https://travel.stackexchange.com/questions/60197",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/36273/"
] | In Cracow you can get pill in gynecological clinic NZOZ Arka. Here is the address:
NZOZ Arka Cracow
Krolowej Jadwigi 15
Emergency phone number: +48 692464346 | For anyone else reading this topic: you can't buy a morning-after pill without a prescription in Poland.
As of July 2018, in order to buy a morning-after pill you need a prescription. And the doctor can refuse to write you one, just like the pharmacist can refuse to sell you pills (even if you have a prescription) - s... |
18,478,053 | I have implemented the jQuery file upload plugin with a php framework it was relatively straight forward following the instructions.
<https://github.com/blueimp/jQuery-File-Upload>
My question is specifically towards the PHP class, When the images upload they upload into my framework folder (where the php script is e... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18478053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443386/"
] | You can do it in two ways:
1.. by changing the line 40 in server / php / UploadHandler.php and put the directory you want
```
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
```
2.. by adding the upload dir as parameter when initializing the class
```
$options = array ('upload_dir' =>... | I found by changing the path located in UploadHandeler.php on lines 40 and 41 this changed the specified path. |
18,478,053 | I have implemented the jQuery file upload plugin with a php framework it was relatively straight forward following the instructions.
<https://github.com/blueimp/jQuery-File-Upload>
My question is specifically towards the PHP class, When the images upload they upload into my framework folder (where the php script is e... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18478053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443386/"
] | Add these options to your UploadHandler() function.
Make sure to add "/" to end of path.
```
$upload_handler = new UploadHandler(array(
'upload_dir' => '/Your/absolute/upload/folder/path/',
'upload_url' => '/url/of/above/path/',
'script_url' => '/url/of/uploadhandler/script',
... | I found by changing the path located in UploadHandeler.php on lines 40 and 41 this changed the specified path. |
18,478,053 | I have implemented the jQuery file upload plugin with a php framework it was relatively straight forward following the instructions.
<https://github.com/blueimp/jQuery-File-Upload>
My question is specifically towards the PHP class, When the images upload they upload into my framework folder (where the php script is e... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18478053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443386/"
] | You can do it in two ways:
1.. by changing the line 40 in server / php / UploadHandler.php and put the directory you want
```
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
```
2.. by adding the upload dir as parameter when initializing the class
```
$options = array ('upload_dir' =>... | You can override the callback function as per
```
$('#fileupload').fileupload({
add: function (e, data) {
var jqXHR = data.submit()
.success(function (result, textStatus, jqXHR) {/* ... */})
.error(function (jqXHR, textStatus, errorThrown) {/* ... */})
.complete(function (result, textStatus... |
18,478,053 | I have implemented the jQuery file upload plugin with a php framework it was relatively straight forward following the instructions.
<https://github.com/blueimp/jQuery-File-Upload>
My question is specifically towards the PHP class, When the images upload they upload into my framework folder (where the php script is e... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18478053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443386/"
] | Add these options to your UploadHandler() function.
Make sure to add "/" to end of path.
```
$upload_handler = new UploadHandler(array(
'upload_dir' => '/Your/absolute/upload/folder/path/',
'upload_url' => '/url/of/above/path/',
'script_url' => '/url/of/uploadhandler/script',
... | You can override the callback function as per
```
$('#fileupload').fileupload({
add: function (e, data) {
var jqXHR = data.submit()
.success(function (result, textStatus, jqXHR) {/* ... */})
.error(function (jqXHR, textStatus, errorThrown) {/* ... */})
.complete(function (result, textStatus... |
18,478,053 | I have implemented the jQuery file upload plugin with a php framework it was relatively straight forward following the instructions.
<https://github.com/blueimp/jQuery-File-Upload>
My question is specifically towards the PHP class, When the images upload they upload into my framework folder (where the php script is e... | 2013/08/28 | [
"https://Stackoverflow.com/questions/18478053",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1443386/"
] | You can do it in two ways:
1.. by changing the line 40 in server / php / UploadHandler.php and put the directory you want
```
'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
```
2.. by adding the upload dir as parameter when initializing the class
```
$options = array ('upload_dir' =>... | Add these options to your UploadHandler() function.
Make sure to add "/" to end of path.
```
$upload_handler = new UploadHandler(array(
'upload_dir' => '/Your/absolute/upload/folder/path/',
'upload_url' => '/url/of/above/path/',
'script_url' => '/url/of/uploadhandler/script',
... |
564,457 | It is quite clear that the word "signify" is derived from *sign* and the suffix *-ify*:
* sign + -ify = signify
The letter "g" in the word *sign* is silent but when the suffix is added, it becomes pronounced:
* /ˈsɪ**g**nɪfaɪ/
Although the "g" doesn't get pronounced when another suffix *-able* is added:
* sign + -... | 2021/04/07 | [
"https://english.stackexchange.com/questions/564457",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/-1/"
] | Your question is based on a false premise. According to Etymology online the word [signify](https://www.etymonline.com/word/signify#etymonline_v_23506) comes not from 'sign' but from the Latin 'significare' via the Old French 'signifier'. The same source gives the origin of both the noun and verb [sign](https://www.ety... | There is apparently nothing particular about "-*ify*" and the most probable phenomenon to be associated to this restitution of the g (widely applicable) is the reduction of the long vowel (/aɪ/, /eɪ/, /u:/ to a short one (/ɪ/, /ʌ/) or simply the possible choice of a short vowel before non ending "*-gn*" (dignity); the ... |
31,427,841 | I am a beginner in programming and have started working on Python.I am running following code.Please explain me the sequence flow for the output
```
class Employee:
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
self.empCount += 1
def displayEmployee(s... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31427841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4689113/"
] | You are using augmented assignment. For an immutable type like an integer, you are essentially doing *the same thing* as this:
```
self.empCount = self.empCount + 1
```
The `self.empCount` retrieves either an instance attribute (if it exists) or a class attribute. Because there is no such instance attribute, it is... | ```
class Employee:
empCount = 0
```
by here, Total Emp, which just show Employee.empCount remains 0.
```
def __init__(self, name, salary):
self.name = name
self.salary = salary
self.empCount += 1
```
this inherits and defines the Employee, and adds self.empcount. Which as a result, adds 1 to... |
1,766,267 | A coin is tossed 6 times. What is the probability that the no. of heads in the first 3 throws is the same as the number number in the last three throws?
To be honest, I don't know how to tackle this problem. Please help. | 2016/05/01 | [
"https://math.stackexchange.com/questions/1766267",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/261563/"
] | Split it into **disjoint** events, and add up their probabilities:
* The probability of $\color\red0$ heads in each part is $\frac{\binom{3}{\color\red0}}{2^3}\cdot\frac{\binom{3}{\color\red0}}{2^3}$
* The probability of $\color\red1$ heads in each part is $\frac{\binom{3}{\color\red1}}{2^3}\cdot\frac{\binom{3}{\color... | Hint:
Let $X$ be the number of heads in the first three rolls, and $Y$ be the number of rolls in the last three. Then $X$ and $Y$ are independent and follow what kind of distribution?
Further, we are asked to calculated
$$P(X = Y) = \sum\_{k = 0}^3P(X = k, Y=k).$$ |
31,332,495 | I am creating an App in Appgyver Composer.
I have a PHP file which perfect and gives appropriate response when triggered. I tried making this a service by putting appropriate credentials. However, the test returned the following error :
```
"Test failed: Error: Origin is not allowed by Access-Control-Allow-Origin"
``... | 2015/07/10 | [
"https://Stackoverflow.com/questions/31332495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4838442/"
] | That's what you want to do. If the file exists you'll get it. Otherwise you'll create it. You can check whether the file exists by calling `fileToSave.exists()` on it and act appropriately if it does not.
The `new` keyword is creating a `File` object in code, not necessarily a new file on the device.
I would cautio... | try this..
```
File fileToSave = new File(dirOfTheFile);
if(fileToSave.exists())
{
// the file exists. use it
} else {
// create file here
}
```
if parent folder is not there you may have to call `fileToSave.getParentFile().mkdirs()` to create parent folders |
31,332,495 | I am creating an App in Appgyver Composer.
I have a PHP file which perfect and gives appropriate response when triggered. I tried making this a service by putting appropriate credentials. However, the test returned the following error :
```
"Test failed: Error: Origin is not allowed by Access-Control-Allow-Origin"
``... | 2015/07/10 | [
"https://Stackoverflow.com/questions/31332495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4838442/"
] | The `File` object is just a *reference* to a file (a wrapper around the path of the file); creating a new `File` object does not actually create or read the file; to do that, use [FileInputStream](http://developer.android.com/reference/java/io/FileInputStream.html) to read, [FileOutputStream](http://developer.android.c... | try this..
```
File fileToSave = new File(dirOfTheFile);
if(fileToSave.exists())
{
// the file exists. use it
} else {
// create file here
}
```
if parent folder is not there you may have to call `fileToSave.getParentFile().mkdirs()` to create parent folders |
7,717,244 | Java beginner here who is terribly confused as to why
1) this is **valid**:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] myArray = new MyArrayOfObjects[5];
void InstantiateElements (){
myArray[0] = new MyArrayOfObjects();
}
}
```
2) while this is **not**:
```
public class MyArrayOf... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7717244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/582485/"
] | Statements other than variable declarations must occur in:
* Methods
* Constructors
* Initializer blocks
In your second block of code, the statement assigning a value to the first element of the array is *not* a variable declaration, so it can't occur directly in the class.
As for why Java is designed this way - to ... | `myArray[0] = new MyArrayOfObjects();` is a statement – a line of *executable* code.
Statements can only appear in methods or initializer blocks.
Class definitions can only contain *declarations* (fields, methods, constructors, inner classes), not statements.
Fields can also have initializers. |
7,717,244 | Java beginner here who is terribly confused as to why
1) this is **valid**:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] myArray = new MyArrayOfObjects[5];
void InstantiateElements (){
myArray[0] = new MyArrayOfObjects();
}
}
```
2) while this is **not**:
```
public class MyArrayOf... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7717244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/582485/"
] | `myArray[0] = new MyArrayOfObjects();` is a statement – a line of *executable* code.
Statements can only appear in methods or initializer blocks.
Class definitions can only contain *declarations* (fields, methods, constructors, inner classes), not statements.
Fields can also have initializers. | You have to put this line:
`myArray[0] = new MyArrayOfObjects();`
into an constructor. The class body can't contain statements, just declarations. |
7,717,244 | Java beginner here who is terribly confused as to why
1) this is **valid**:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] myArray = new MyArrayOfObjects[5];
void InstantiateElements (){
myArray[0] = new MyArrayOfObjects();
}
}
```
2) while this is **not**:
```
public class MyArrayOf... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7717244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/582485/"
] | `myArray[0] = new MyArrayOfObjects();` is a statement – a line of *executable* code.
Statements can only appear in methods or initializer blocks.
Class definitions can only contain *declarations* (fields, methods, constructors, inner classes), not statements.
Fields can also have initializers. | Not exactly an answer to why, this has been answered already but as an addition. You could initialize your array on declaration with an array initializer:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] foo = new MyArrayOfObjects[] { new MyArrayOfObjects(), null, null, null, null };
}
``` |
7,717,244 | Java beginner here who is terribly confused as to why
1) this is **valid**:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] myArray = new MyArrayOfObjects[5];
void InstantiateElements (){
myArray[0] = new MyArrayOfObjects();
}
}
```
2) while this is **not**:
```
public class MyArrayOf... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7717244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/582485/"
] | Statements other than variable declarations must occur in:
* Methods
* Constructors
* Initializer blocks
In your second block of code, the statement assigning a value to the first element of the array is *not* a variable declaration, so it can't occur directly in the class.
As for why Java is designed this way - to ... | You have to put this line:
`myArray[0] = new MyArrayOfObjects();`
into an constructor. The class body can't contain statements, just declarations. |
7,717,244 | Java beginner here who is terribly confused as to why
1) this is **valid**:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] myArray = new MyArrayOfObjects[5];
void InstantiateElements (){
myArray[0] = new MyArrayOfObjects();
}
}
```
2) while this is **not**:
```
public class MyArrayOf... | 2011/10/10 | [
"https://Stackoverflow.com/questions/7717244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/582485/"
] | Statements other than variable declarations must occur in:
* Methods
* Constructors
* Initializer blocks
In your second block of code, the statement assigning a value to the first element of the array is *not* a variable declaration, so it can't occur directly in the class.
As for why Java is designed this way - to ... | Not exactly an answer to why, this has been answered already but as an addition. You could initialize your array on declaration with an array initializer:
```
public class MyArrayOfObjects {
MyArrayOfObjects[] foo = new MyArrayOfObjects[] { new MyArrayOfObjects(), null, null, null, null };
}
``` |
25,373,511 | I am trying to **import** a rather **small** (217 rows, 87 colums, 15k) **csv** file for analysis in **Python** using **Panda**. The file is rather poorly structured, but I would like to still import it, since it is the raw data which I do not want to manipulate manually outside Python (e.g. with Excel). Unfortunately ... | 2014/08/18 | [
"https://Stackoverflow.com/questions/25373511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3954399/"
] | It is because of invalid character (e.g. 0xe0) in the file
If you add `encoding` parameter to the read\_csv() call, you will see this stacktrace instead of a segfault
```
>>> df = pandas.read_csv("/tmp/lo_1986.csv", delimiter=";", encoding="utf-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <mod... | Thanks a lot for your remarks. I could not agree more to the comment, that this is indeed a very messed up csv. But unfortunately that is the way the Austrian State Lottery shares their information an drawn numbers and payout quotes.
I continued playing around, also looking at the special characters. In the end the, a... |
22,512,029 | I want to remove public folder and index.php from my url.
Example
My current url looks like
```
http://localhost/elibrary/public/
```
i want to remove public, and my url should looks like
```
http://localhost/elibrary/
```
my .htaccess file contains.
```
Options +FollowSymLinks -MultiViews
RewriteEngine On
Rew... | 2014/03/19 | [
"https://Stackoverflow.com/questions/22512029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1831664/"
] | Personally, I would stick with the standard .htaccess file, ie;
```
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
#... | Change your last rule to this:
```
# remove /public/ from URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/public/ [NC]
RewriteRule ^(.*?)/?$ public/$1 [L]
```
And make sure to use absolute path in your css, js, images files rather than a relative one. Which me... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | As others have mentioned here using just `dd` won't work due to the copy of the GPT table placed at the end of the disk.
I have managed to perform a migration to a smaller drive using the following method:
First - boot into liveCD distro of your choice.
Resize the source drive partitions to indeed fit within the sma... | The physical drive should not start smoking, at least, but chances are very good that your filesystem will not work anymore (I mean, the target filesystem; if you just copied and did not touch anything in the source, the source itself should be fine). Data inside a partition is not necessarily allocated in increasing o... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | Although at first the proposed "challenge" may seem difficult, not feasible or sound naive as some have commented, it isn't. The main idea behind using dd to migrate from a bigger to a smaller disk is perfectly fine and have benefits for migrating the data. Of course, having enough free space so that the occupied data ... | I would like to share my experience with this topic, should this prove useful to another reader. Recently I used **DDRESCUE** to recover the first 1/3 of an NTFS partition from a malfunctioned hard drive, and successfully rebuilt the recovered segment of the partition onto a smaller hard drive - thereby rescuing the fi... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | As others have mentioned here using just `dd` won't work due to the copy of the GPT table placed at the end of the disk.
I have managed to perform a migration to a smaller drive using the following method:
First - boot into liveCD distro of your choice.
Resize the source drive partitions to indeed fit within the sma... | I would like to share my experience with this topic, should this prove useful to another reader. Recently I used **DDRESCUE** to recover the first 1/3 of an NTFS partition from a malfunctioned hard drive, and successfully rebuilt the recovered segment of the partition onto a smaller hard drive - thereby rescuing the fi... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | The physical drive should not start smoking, at least, but chances are very good that your filesystem will not work anymore (I mean, the target filesystem; if you just copied and did not touch anything in the source, the source itself should be fine). Data inside a partition is not necessarily allocated in increasing o... | Although at first the proposed "challenge" may seem difficult, not feasible or sound naive as some have commented, it isn't. The main idea behind using dd to migrate from a bigger to a smaller disk is perfectly fine and have benefits for migrating the data. Of course, having enough free space so that the occupied data ... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | If you want to fit a car in a passageway that's 20cm narrower than the car, and you cut the left 20cm of the car, will the car still work? Probably not.
If you copy a the beginning of a disk to another disk and cut the copy short because the target disk is smaller, the result isn't going to work. Even if there would b... | You need to shrink the partitions on the source first (or delete those out-of-bounds).
Than `dd` and after you will probably need to repair the partition table by using `gdisk /dev/sd<target>`
and the key sequence to repair the table is `v r d w`
I suggest you to shring the partitions a bit smaller than neede... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | Although at first the proposed "challenge" may seem difficult, not feasible or sound naive as some have commented, it isn't. The main idea behind using dd to migrate from a bigger to a smaller disk is perfectly fine and have benefits for migrating the data. Of course, having enough free space so that the occupied data ... | If you want to fit a car in a passageway that's 20cm narrower than the car, and you cut the left 20cm of the car, will the car still work? Probably not.
If you copy a the beginning of a disk to another disk and cut the copy short because the target disk is smaller, the result isn't going to work. Even if there would b... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | As others have mentioned here using just `dd` won't work due to the copy of the GPT table placed at the end of the disk.
I have managed to perform a migration to a smaller drive using the following method:
First - boot into liveCD distro of your choice.
Resize the source drive partitions to indeed fit within the sma... | Although at first the proposed "challenge" may seem difficult, not feasible or sound naive as some have commented, it isn't. The main idea behind using dd to migrate from a bigger to a smaller disk is perfectly fine and have benefits for migrating the data. Of course, having enough free space so that the occupied data ... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | The physical drive should not start smoking, at least, but chances are very good that your filesystem will not work anymore (I mean, the target filesystem; if you just copied and did not touch anything in the source, the source itself should be fine). Data inside a partition is not necessarily allocated in increasing o... | You need to shrink the partitions on the source first (or delete those out-of-bounds).
Than `dd` and after you will probably need to repair the partition table by using `gdisk /dev/sd<target>`
and the key sequence to repair the table is `v r d w`
I suggest you to shring the partitions a bit smaller than neede... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | The physical drive should not start smoking, at least, but chances are very good that your filesystem will not work anymore (I mean, the target filesystem; if you just copied and did not touch anything in the source, the source itself should be fine). Data inside a partition is not necessarily allocated in increasing o... | I would like to share my experience with this topic, should this prove useful to another reader. Recently I used **DDRESCUE** to recover the first 1/3 of an NTFS partition from a malfunctioned hard drive, and successfully rebuilt the recovered segment of the partition onto a smaller hard drive - thereby rescuing the fi... |
161,859 | I've used `dd` to clone disks like this:
```
dd if=/dev/sdb of=/dev/sda bs=4096 conv=notrunc,noerror,sync
```
And it's always worked fine. Any and all docs on 'dd' take pains to remind you that the target disk must be the same size or bigger than the source. Does that absolutely have to be true?
Now, I quite unde... | 2014/10/13 | [
"https://unix.stackexchange.com/questions/161859",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/56145/"
] | The physical drive should not start smoking, at least, but chances are very good that your filesystem will not work anymore (I mean, the target filesystem; if you just copied and did not touch anything in the source, the source itself should be fine). Data inside a partition is not necessarily allocated in increasing o... | If you want to fit a car in a passageway that's 20cm narrower than the car, and you cut the left 20cm of the car, will the car still work? Probably not.
If you copy a the beginning of a disk to another disk and cut the copy short because the target disk is smaller, the result isn't going to work. Even if there would b... |
141,367 | I'd like to delete a question of mine that was downvoted and has close votes, so I flagged it and asked for a mod to delete it but they didn't. Why can it not be deleted? [Here it is.](https://stackoverflow.com/questions/11670748/how-can-analyse-this-data-set-with-r)
I can understand that users shouldn't be able to de... | 2012/07/27 | [
"https://meta.stackexchange.com/questions/141367",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/158509/"
] | While the question isn't very strong, the answer given has been upvoted by at least 3 people. By design, you cannot delete your own post if any answer has been upvoted. You flagged for delete, but it was declined, so now your best bet would be to edit your question, make it stronger, and you could get some upvotes from... | Normally, questions are eventually deleted once they are closed, except when they are spam, a random sequence of characters, or a they contain offensive, abusive, or hate speech without even asking a question (among other things).
There are many factors to consider when deleting a question, and the score of the existi... |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | This is a Bash-only (>= version 3) solution that uses regular expressions:
```
if [[ "$WORD" =~ ^(cat|dog|horse)$ ]]; then
echo "$WORD is in the list"
else
echo "$WORD is not in the list"
fi
```
If your word list is long, you can store it in a file (one word per line) and do this:
```
if [[ "$WORD" =~ $(ech... | ```
case $word in
dog|cat|horse) echo yes;;
*) echo no;;
esac
``` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | This is a Bash-only (>= version 3) solution that uses regular expressions:
```
if [[ "$WORD" =~ ^(cat|dog|horse)$ ]]; then
echo "$WORD is in the list"
else
echo "$WORD is not in the list"
fi
```
If your word list is long, you can store it in a file (one word per line) and do this:
```
if [[ "$WORD" =~ $(ech... | For this purpose associate arrays together with `test -v` (checks if variable exists) are a good solution when you need an exact match:
```
#!/bin/bash
# declare associative array with all animals and no value
declare -A ANIMALS=(["dog"]= ["cat"]= ["horse"]=)
test_animal() {
# check if parameter is found within the... |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | You could use `fgrep` to specify all allowed words:
```
if echo "$WORD" | grep -F -wq -e dog -e cat -e horse; then
echo yes
else
echo no
fi
```
The `-w` flag matches only full words, the `-q` flag makes it operate silently (because all we need is the return value for the if statement to use), and each `-e` ... | You may want to put the list of words into a file,
in case you change the list often, or you want it to be shared by multiple scripts.
And you may need to put the words into a file
if the list gets too long to manage in a script.
Then you can say
```
if fgrep –qx "$WORD" word_list
``` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | I just had the same problem and found a surprisingly understandable solution which does not require any regex knowledge.
This works in Bash and ksh, and in zsh with `setopt kshglob`:
```
WORD=abc
[[ "$WORD" == @(def|abc|ghi|foo|barbaz) ]] && echo Word is in set.
```
(Native zsh version would be the same without the... | This worked for me:
```
#!/bin/bash
phrase=(cat dog parrot cow horse)
findthis=parrot
for item in ${phrase[*]}
do
test "$item" == "$findthis" && { echo "$findthis found!"; break; }
done
``` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | ```
if (echo "$set" | fgrep -q "$WORD")
``` | You may want to put the list of words into a file,
in case you change the list often, or you want it to be shared by multiple scripts.
And you may need to put the words into a file
if the list gets too long to manage in a script.
Then you can say
```
if fgrep –qx "$WORD" word_list
``` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | ```
if (echo "$set" | fgrep -q "$WORD")
``` | I know this is old, but a trick I use is to see if the list is equal to the query plus padding on both sides.
```
list=" cat dog horse "
query="cat"
if [[ "$list" == *" $query "* ]]; then echo true; else echo false; fi
```
I added spaces in my list, and also around my query, to make sure I don't accidentally catch "... |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | ```
if (echo "$set" | fgrep -q "$WORD")
``` | For this purpose associate arrays together with `test -v` (checks if variable exists) are a good solution when you need an exact match:
```
#!/bin/bash
# declare associative array with all animals and no value
declare -A ANIMALS=(["dog"]= ["cat"]= ["horse"]=)
test_animal() {
# check if parameter is found within the... |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | You could use `fgrep` to specify all allowed words:
```
if echo "$WORD" | grep -F -wq -e dog -e cat -e horse; then
echo yes
else
echo no
fi
```
The `-w` flag matches only full words, the `-q` flag makes it operate silently (because all we need is the return value for the if statement to use), and each `-e` ... | If words are a list where values are separated by a newline, you can do:
```
WORDS="$(ls -1)"
if echo "${WORDS}" | grep --quiet --line-regexp --fixed-strings "${WORD}"; then
echo yes
else
echo no
fi
``` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | I just had the same problem and found a surprisingly understandable solution which does not require any regex knowledge.
This works in Bash and ksh, and in zsh with `setopt kshglob`:
```
WORD=abc
[[ "$WORD" == @(def|abc|ghi|foo|barbaz) ]] && echo Word is in set.
```
(Native zsh version would be the same without the... | i was searching for a 'one line' solution to validate my script argument, and used [Joseph R. answer](https://unix.stackexchange.com/a/111518/52123) above to come up with:
`[[ "$ARG" =~ ^(true|false)$ ]] || { echo "Argument received invalid value" ; exit 1 ; }` |
111,508 | I am looking for a construct in `bash`, to decide if a variable `$WORD` is one of defined words. I need something like this:
```
if "$WORD" in dog cat horse ; then
echo yes
else
echo no
fi
```
does bash have such construct? If not, what would be the closest? | 2014/01/29 | [
"https://unix.stackexchange.com/questions/111508",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/43007/"
] | ```
if (echo "$set" | fgrep -q "$WORD")
``` | i was searching for a 'one line' solution to validate my script argument, and used [Joseph R. answer](https://unix.stackexchange.com/a/111518/52123) above to come up with:
`[[ "$ARG" =~ ^(true|false)$ ]] || { echo "Argument received invalid value" ; exit 1 ; }` |
7,123,226 | I believe this has been answered before but how can I have buttons / images / whatever so that when I click them it inserts the `<b></b>` around the cursor position like what you find in forums (and even the StackOverflow ask a question page)?
Again, I know this has been answered but all I could find was using jQuer... | 2011/08/19 | [
"https://Stackoverflow.com/questions/7123226",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/584026/"
] | Here's one I wrote awhile ago [jsFiddle](http://jsfiddle.net/HXnru/)
```
function boldText(textAreaId, link)
{
var browser=navigator.appName
var b_version=navigator.appVersion
if (browser=="Microsoft Internet Explorer" && b_version>='4')
{
var str = document.select... | see what alex king's approach is:
<http://alexking.org/blog/2003/06/02/inserting-at-the-cursor-using-javascript> |
33,568,952 | I have a vertical linear layout with some input fields. Using TextInputLayout I get a nice flow with labels and built-in error messages. My problem is when I add and remove the error-messages.
If I add an error message it is positioned below the edit-text and everything looks good.
If I remove the error message wit... | 2015/11/06 | [
"https://Stackoverflow.com/questions/33568952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/510732/"
] | As of Support library version 23.1.1 (and perhaps earlier), this should no longer be the case. You should be able to call `TextInputLayout.setErrorEnabled(false)` to hide the error TextView and calling `TextInputLayout.setError(error)` now internally calls `TextInputLayout.setErrorEnabled(true)` if the error isn't null... | For me, below code is working fine.
```
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(mobileNoInputLayout.isErrorEnabled()){
mobileNoInputLayout.setErrorEnabled(false);
}
}
``` |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | Yes, I'd see this as appropriate to pass along. I would suggest focusing more on results than time here as the boss is likely looking more for results than just time spent on something. Some tasks could be done in 2 hours or 200 hours depending on how nit picky one wants to get and thus I'd look more on progress and ch... | First, it is your manager's job to *manage* - so be careful that you are not crossing that line.
A "friendly heads-up" that a boss is about to "talk" to a stressed and anxious co-worker is likely not going to be productive. If you think being direct with your colleague is acceptable and will lead to a productive, "how... |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | Yes, I'd see this as appropriate to pass along. I would suggest focusing more on results than time here as the boss is likely looking more for results than just time spent on something. Some tasks could be done in 2 hours or 200 hours depending on how nit picky one wants to get and thus I'd look more on progress and ch... | I know you want to be helpful, but be careful that you don't get caught in the middle. If you bring up her lack of performance, and then the boss "talks" to her about it, she may think you were the one who complained.
However, if you absolutely feel like you want to help, you might ask her to sit down with you to disc... |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | Yes, I'd see this as appropriate to pass along. I would suggest focusing more on results than time here as the boss is likely looking more for results than just time spent on something. Some tasks could be done in 2 hours or 200 hours depending on how nit picky one wants to get and thus I'd look more on progress and ch... | It's not your problem, and it's not your place to lecture your colleague on performance. So don't. Simple as that. |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | Yes, I'd see this as appropriate to pass along. I would suggest focusing more on results than time here as the boss is likely looking more for results than just time spent on something. Some tasks could be done in 2 hours or 200 hours depending on how nit picky one wants to get and thus I'd look more on progress and ch... | The fact that your boss said this in front of you could be seen as an implicit indication for you to pass this info along to your coworker, particularly since you have more experience and could potentially provide some mentoring in this area.
What to do next will depend in large part upon your working relationship wit... |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | I know you want to be helpful, but be careful that you don't get caught in the middle. If you bring up her lack of performance, and then the boss "talks" to her about it, she may think you were the one who complained.
However, if you absolutely feel like you want to help, you might ask her to sit down with you to disc... | First, it is your manager's job to *manage* - so be careful that you are not crossing that line.
A "friendly heads-up" that a boss is about to "talk" to a stressed and anxious co-worker is likely not going to be productive. If you think being direct with your colleague is acceptable and will lead to a productive, "how... |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | First, it is your manager's job to *manage* - so be careful that you are not crossing that line.
A "friendly heads-up" that a boss is about to "talk" to a stressed and anxious co-worker is likely not going to be productive. If you think being direct with your colleague is acceptable and will lead to a productive, "how... | It's not your problem, and it's not your place to lecture your colleague on performance. So don't. Simple as that. |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | First, it is your manager's job to *manage* - so be careful that you are not crossing that line.
A "friendly heads-up" that a boss is about to "talk" to a stressed and anxious co-worker is likely not going to be productive. If you think being direct with your colleague is acceptable and will lead to a productive, "how... | The fact that your boss said this in front of you could be seen as an implicit indication for you to pass this info along to your coworker, particularly since you have more experience and could potentially provide some mentoring in this area.
What to do next will depend in large part upon your working relationship wit... |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | I know you want to be helpful, but be careful that you don't get caught in the middle. If you bring up her lack of performance, and then the boss "talks" to her about it, she may think you were the one who complained.
However, if you absolutely feel like you want to help, you might ask her to sit down with you to disc... | It's not your problem, and it's not your place to lecture your colleague on performance. So don't. Simple as that. |
59,100 | I work as a software engineer and during a recent meeting my boss mentioned offhand that if one of my coworkers (not present) didn't start making some progress on the project we are working on, that he would need to have a 'talk' with her.
I don't believe that her job is in jeopardy, but I can remember when I was new... | 2015/12/09 | [
"https://workplace.stackexchange.com/questions/59100",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/44817/"
] | I know you want to be helpful, but be careful that you don't get caught in the middle. If you bring up her lack of performance, and then the boss "talks" to her about it, she may think you were the one who complained.
However, if you absolutely feel like you want to help, you might ask her to sit down with you to disc... | The fact that your boss said this in front of you could be seen as an implicit indication for you to pass this info along to your coworker, particularly since you have more experience and could potentially provide some mentoring in this area.
What to do next will depend in large part upon your working relationship wit... |
280,241 | I uploaded an html 403 and 404 page to my WordPress theme directory and if I hit a random mistake after .com such as .com/yyyy then it loads the 404 page for example - so all is good...
However...I would like the 403.php to be shown when someone outside my permitted IP string attempts to access my log in page.
This .... | 2017/09/17 | [
"https://wordpress.stackexchange.com/questions/280241",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/93691/"
] | >
> it create a never-ending loop as WordPress tries to find the 403.php page
>
>
>
Not WordPress, but Apache. WordPress never even sees the request.
You need to make an exception for your custom 403 error document, otherwise, the directives you have posted would issue another 403 for the error document itself...... | 1. Wordpress has built in 404 and 403 template, it called in 404.php and 403.php in your template.
2. OR, You can also defined which page / action will load when specified error code sent by detected http response code, put this on your functions.php file:
`function detect_response_header(){
if (http_response_code() ... |
29,237,355 | **Can this be done without media queries or javascript?**
I have a set of blocks that I want to show inline and left-aligned in a shrink-to-fit container. I also want the group of them to be horizontally centered in the browser window.
, y=res)) +
geom_hline(yintercept = -6:2, color="grey") +
geom_boxplot(aes(fill=factor(model)), outlier.size=NA) +
opts(axis.text.x = theme_text(angle = 45)) +
geom_point()... | If you remove `geom_point()` from your plot, you will see, that these are indeed outliers (as you suspected), which are depicted as points per `?geom_boxplot`.
Why you would want to depict all data points in addition to the boxplot is beyond me. |
2,954,688 | >
> Consider two dice. One $10$-sided, one $6$-sided, both fair. Guess a number between $2$ and $16$, if the sum of the dice shows that number, you get that number of dollars. What is the best number to guess to maximize winnings?
>
>
>
The answer is $11$, but I'm not sure why. I thought that since $\mathbb{E}[D\... | 2018/10/14 | [
"https://math.stackexchange.com/questions/2954688",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | **The number $9$ is the expected value $\mathbb E[D\_6 + D\_{10}]$, but in general that's not necessarily the likeliest value.**
After all, if you were playing the same game with just a single $D\_6$, you wouldn't guess $3.5$. If you did, it would take a very long time before that number was rolled.
Here, it turns ou... | \begin{align}
Pr(D\_6 + D\_{10}=x) &= \sum\_{y=1}^6Pr(D\_6 + D\_{10}=x|D\_6=y)Pr(D\_6=y) \\
&= \frac16 \sum\_{y=1}^6 Pr(D\_{10}=x-y)\\
&= \frac16 \sum\_{y=\max(1,x-10)}^{\min(x-1,6)} Pr(D\_{10}=x-y) \\
&= \frac1{60}[\min(x-1,6)-\max(1,x-10)+1]
\end{align}
Hence, we want to maximize
$$\frac{x}{60}[\min(x-1,6)-\max(1,... |
2,954,688 | >
> Consider two dice. One $10$-sided, one $6$-sided, both fair. Guess a number between $2$ and $16$, if the sum of the dice shows that number, you get that number of dollars. What is the best number to guess to maximize winnings?
>
>
>
The answer is $11$, but I'm not sure why. I thought that since $\mathbb{E}[D\... | 2018/10/14 | [
"https://math.stackexchange.com/questions/2954688",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | **The number $9$ is the expected value $\mathbb E[D\_6 + D\_{10}]$, but in general that's not necessarily the likeliest value.**
After all, if you were playing the same game with just a single $D\_6$, you wouldn't guess $3.5$. If you did, it would take a very long time before that number was rolled.
Here, it turns ou... | The expected number of winnings when guessing a number $n$ is going to be the dollar value $n$ multiplied by the probability that the sum of the two dice is $n.$ So even though $9$ is the expected value for the sum of the dice, the expected winnings by guessing $9$ is going to be $9 \cdot \frac{1}{10} = \$0.90,$ becaus... |
2,954,688 | >
> Consider two dice. One $10$-sided, one $6$-sided, both fair. Guess a number between $2$ and $16$, if the sum of the dice shows that number, you get that number of dollars. What is the best number to guess to maximize winnings?
>
>
>
The answer is $11$, but I'm not sure why. I thought that since $\mathbb{E}[D\... | 2018/10/14 | [
"https://math.stackexchange.com/questions/2954688",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | \begin{align}
Pr(D\_6 + D\_{10}=x) &= \sum\_{y=1}^6Pr(D\_6 + D\_{10}=x|D\_6=y)Pr(D\_6=y) \\
&= \frac16 \sum\_{y=1}^6 Pr(D\_{10}=x-y)\\
&= \frac16 \sum\_{y=\max(1,x-10)}^{\min(x-1,6)} Pr(D\_{10}=x-y) \\
&= \frac1{60}[\min(x-1,6)-\max(1,x-10)+1]
\end{align}
Hence, we want to maximize
$$\frac{x}{60}[\min(x-1,6)-\max(1,... | The expected number of winnings when guessing a number $n$ is going to be the dollar value $n$ multiplied by the probability that the sum of the two dice is $n.$ So even though $9$ is the expected value for the sum of the dice, the expected winnings by guessing $9$ is going to be $9 \cdot \frac{1}{10} = \$0.90,$ becaus... |
37,489,589 | We have inserted a Telerik RadMultiPage control on a webpage which has 7 tabs in it.
On some of those tabs, we'd like to display a combo box which will show the user a list of table names they can choose from to edit/view data.
We'd like that list of table names to be filtered based on the tab selected.
Is ther... | 2016/05/27 | [
"https://Stackoverflow.com/questions/37489589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1028115/"
] | DISCLAIMER
==========
The method outlined below is 100% insecure and if the code makes it into the public realm then you can kiss your server goodbye.
---
For deleting one file you can do this:
**index.php**
```
<form method="POST" action="delete.php">
<input type="hidden" name="delete_path" value="/path/to/yo... | I am use path unlink(**FILE**)
echo $new\_file\_dert = **FILE** . '/'.$template\_name;
```
<form method="post">
<input type="hidden" name="unlink" value="<?php echo $new_file_dert; ?>" />
<input name="delete" type="submit" cl... |
24,779,356 | Iam printing some content using php code inside html but, when i tried to click on that div its not calling the function in onClick ??
Here is my php code
```
echo '<div class="col-sm-12 col-xs-12 " ><div class="row ">';
echo '<div class="col-sm-10" onClick="openUrlInNewTab("'.$myarray['Job']['link'].'");"><h3>';
e... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24779356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3755198/"
] | You should use single quotes.
Instead of
```
<div class="col-sm-10 " onClick="openUrlInNewTab("www.example.com");" >
```
you should have
```
<div class="col-sm-10 " onClick="openUrlInNewTab('www.example.com');" >
```
If you put double quotes inside double quotes it simple won't work.
So in PHP you should chang... | You know how to use jQuery, right?
```
$(document).ready(function()
{
$('div').on('click', function()
{
alert('clicked!');
});
});
```
You can put onclick on div, but it most likely won't work like you're currently doing it because how javascript and php works. (I don't think those noclicks ever ... |
24,779,356 | Iam printing some content using php code inside html but, when i tried to click on that div its not calling the function in onClick ??
Here is my php code
```
echo '<div class="col-sm-12 col-xs-12 " ><div class="row ">';
echo '<div class="col-sm-10" onClick="openUrlInNewTab("'.$myarray['Job']['link'].'");"><h3>';
e... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24779356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3755198/"
] | You should use single quotes.
Instead of
```
<div class="col-sm-10 " onClick="openUrlInNewTab("www.example.com");" >
```
you should have
```
<div class="col-sm-10 " onClick="openUrlInNewTab('www.example.com');" >
```
If you put double quotes inside double quotes it simple won't work.
So in PHP you should chang... | `onClick="openUrlInNewTab("www.example.com");"`
should be
`onClick="openUrlInNewTab('http://www.example.com');"`
Use single quotes inside the function for the url. |
24,779,356 | Iam printing some content using php code inside html but, when i tried to click on that div its not calling the function in onClick ??
Here is my php code
```
echo '<div class="col-sm-12 col-xs-12 " ><div class="row ">';
echo '<div class="col-sm-10" onClick="openUrlInNewTab("'.$myarray['Job']['link'].'");"><h3>';
e... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24779356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3755198/"
] | You should use single quotes.
Instead of
```
<div class="col-sm-10 " onClick="openUrlInNewTab("www.example.com");" >
```
you should have
```
<div class="col-sm-10 " onClick="openUrlInNewTab('www.example.com');" >
```
If you put double quotes inside double quotes it simple won't work.
So in PHP you should chang... | ```
onClick="openUrlInNewTab("www.example.com");"
```
should be
```
onclick="openUrlInNewTab('http://www.example.com');"
```
the rest is fine |
24,779,356 | Iam printing some content using php code inside html but, when i tried to click on that div its not calling the function in onClick ??
Here is my php code
```
echo '<div class="col-sm-12 col-xs-12 " ><div class="row ">';
echo '<div class="col-sm-10" onClick="openUrlInNewTab("'.$myarray['Job']['link'].'");"><h3>';
e... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24779356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3755198/"
] | `onClick="openUrlInNewTab("www.example.com");"`
should be
`onClick="openUrlInNewTab('http://www.example.com');"`
Use single quotes inside the function for the url. | You know how to use jQuery, right?
```
$(document).ready(function()
{
$('div').on('click', function()
{
alert('clicked!');
});
});
```
You can put onclick on div, but it most likely won't work like you're currently doing it because how javascript and php works. (I don't think those noclicks ever ... |
24,779,356 | Iam printing some content using php code inside html but, when i tried to click on that div its not calling the function in onClick ??
Here is my php code
```
echo '<div class="col-sm-12 col-xs-12 " ><div class="row ">';
echo '<div class="col-sm-10" onClick="openUrlInNewTab("'.$myarray['Job']['link'].'");"><h3>';
e... | 2014/07/16 | [
"https://Stackoverflow.com/questions/24779356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3755198/"
] | ```
onClick="openUrlInNewTab("www.example.com");"
```
should be
```
onclick="openUrlInNewTab('http://www.example.com');"
```
the rest is fine | You know how to use jQuery, right?
```
$(document).ready(function()
{
$('div').on('click', function()
{
alert('clicked!');
});
});
```
You can put onclick on div, but it most likely won't work like you're currently doing it because how javascript and php works. (I don't think those noclicks ever ... |
49,084,742 | I'm learning some PHP while trying to build my own framework as apractice excersice, currently I have a config.php file where I store the database info to connect to plus some PDO settings, both stored into two different arrays.
I also have a Conectar.php file to stablish connection, in this the conexion(coection) met... | 2018/03/03 | [
"https://Stackoverflow.com/questions/49084742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are trying to access to the `$config` variable which is not accessible in your `conexion()` function. Instead, you have to use the member's variable of your class, defined in your constructor :
```
$con = new PDO("{$this->driver}:host={$this->host};dbname={$this->database};charset={$this->charset}",
... | ```
$con= new PDO("mysql:host={$config['host']};dbname={$config['dbname']}",$config['user'],$config['pass'],charset=$config['charset']);
```
You need curly braces in the quoted string. |
12,981,379 | I'm working on a game that has cocos2d with ARC.
The game builds & runs fine in Simulator, but when I build for device I get `Apple Mac-O Linker Errors`, saying that I'm missing the libraries for libcocos2d.a etc.
```
clang: error: no such file or directory: '/Users/aleksandartrpeski/Library/Developer/Xcode/DerivedDat... | 2012/10/19 | [
"https://Stackoverflow.com/questions/12981379",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389398/"
] | I've solved the issue, the builds for the binaries were somehow ignored by XCode because they were for another architecture, by settings the build settings for the cocos2d target `Build For Active Architectures Only` to `NO`, the issue dissapeared. | Sounds like you'll have to add these libraries to the Link Binary With Libraries build phase.
See my [tutorial on Enabling ARC for Cocos2D projects](http://www.learn-cocos2d.com/2012/04/enabling-arc-cocos2d-project-howto-stepbystep-tutorialguide/) for details.
It's strange that it would work for the Simulator though... |
28,050,486 | I have a splash screen implementation on Codename One with an animated text sequence. I do not want to use the nextForm property on my Splash Form since I want the sequence complete before I navigate. Hence, I have used showForm. It works fine on the emulator but when I test on a real device, the next form I have loade... | 2015/01/20 | [
"https://Stackoverflow.com/questions/28050486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2526035/"
] | You have two simple options, the first which I think it better is to not use the "next form" property and then just invoke `showForm("mainFormName", null)` when the animation completes.
The second is really how the next form was designed to work, its designed for you to do a background process on a background thread t... | You're looking for an [AnimationListener](https://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html)
```
anim.setAnimationListener(new Animation.AnimationListener() {
@Override public void onAnimationStart(Animation animation) {
}
@Overr... |
28,050,486 | I have a splash screen implementation on Codename One with an animated text sequence. I do not want to use the nextForm property on my Splash Form since I want the sequence complete before I navigate. Hence, I have used showForm. It works fine on the emulator but when I test on a real device, the next form I have loade... | 2015/01/20 | [
"https://Stackoverflow.com/questions/28050486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2526035/"
] | You can do something like this:
```
@Override
protected void postSplash(Form f) {
UITimer timer = new UITimer(new Runnable() {
public void run() {
showForm("MainForm", null);
}
});
timer.schedule(XX-MiliSec, false, f);
}
```
So in your splas... | You're looking for an [AnimationListener](https://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html)
```
anim.setAnimationListener(new Animation.AnimationListener() {
@Override public void onAnimationStart(Animation animation) {
}
@Overr... |
41,842,809 | I have a page with an input field where I'd like to send the user to the URL they enter in the input, with -.html appended at the end. My HTML is as follows:
```
<form name="codeform">
<input type="text" id="code" name="code" autofocus>
</form>
<a href="#" class="button" id="submit">SUBMIT</a>
```
And my javascrip... | 2017/01/25 | [
"https://Stackoverflow.com/questions/41842809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3407701/"
] | Because your `a.button` is outside from the form, you need to add trigger to the form and the `a.button` too. Then just detect the [Enter keycode](https://duckduckgo.com/?q=javascript%20enter%20keycode), and done.
```js
$('form').submit(function(e) {
e.preventDefault();
console.log(window.document.codeform.code.... | You can add a keydown listener that only runs on enter (keycode 13), and then prevents the default form submission action:
```
$('#submit').click(function () { location.href = window.document.codeform.code.value + '.html'; });
$('#code').keydown(function (event) {
if(event.which==13){
event.preventDefault(... |
41,842,809 | I have a page with an input field where I'd like to send the user to the URL they enter in the input, with -.html appended at the end. My HTML is as follows:
```
<form name="codeform">
<input type="text" id="code" name="code" autofocus>
</form>
<a href="#" class="button" id="submit">SUBMIT</a>
```
And my javascrip... | 2017/01/25 | [
"https://Stackoverflow.com/questions/41842809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3407701/"
] | Because your `a.button` is outside from the form, you need to add trigger to the form and the `a.button` too. Then just detect the [Enter keycode](https://duckduckgo.com/?q=javascript%20enter%20keycode), and done.
```js
$('form').submit(function(e) {
e.preventDefault();
console.log(window.document.codeform.code.... | Since you have the logic attached to the button click() event, you can simply attach a keypress() event to the input box to subsequently execute the button click.
```
$("#code").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
$('#submit').click();
}
});
```
... |
23,450 | I stumbled upon [this question](https://math.stackexchange.com/questions/1274684/volume-of-a-solid-bounded-by-given-surfaces?rq=1) which was marked as a duplicate, and rightly so as the OP had realised himself in [their comment](https://math.stackexchange.com/questions/1274684/volume-of-a-solid-bounded-by-given-surface... | 2016/06/15 | [
"https://math.meta.stackexchange.com/questions/23450",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/290074/"
] | Usually, duplicate targets are not deleted. They cannot be deleted by votes. Only, auto-deletion can happen, yet usually duplicate targets are not eligible for auto-deletion as they need to be answered to be valid dupe-targets.
Yet, there is an exception, when the two posts are from the same poster, which was the cas... | >
> * Undeleting the page not found question may be against the wishes of the person that deleted it in the first place, but for a question to have been marked as a dupe with respect to the page not found question it must have had some answers (right?)
>
>
>
Ordinary users (even moderators) cannot delete duplicate... |
15,303,904 | I'm curious if anyone has any recommendations as to the best method to leverage PHP/CURL (or another technology even) to download content from a website. Right now I'm using curl\_multi to do 10 requests at a time, which helps some.
I literally need to request about 100K pages daily, which can get a bit tedious (takes... | 2013/03/08 | [
"https://Stackoverflow.com/questions/15303904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/524481/"
] | It depends what you're doing with the content but try a queuing system.
I suggest [Resque](https://github.com/chrisboulton/php-resque). It uses Redis to handle queues. It's designed for speed and multiple requests at the same time. It also has a `resque-web` option that gives out a nice hosted UI.
You could use one ... | To retrieve a Web content you can use curl or fsockopen. A comparison between two methods can be see in [Which is better approach between fsockopen and curl?](https://stackoverflow.com/questions/5933682/which-is-better-approach-between-fsockopen-and-curl). |
488,009 | 
Why do we use a cylinder as a Gaussian surface for infinitely long charged wire and not some other shape like cube? | 2019/06/25 | [
"https://physics.stackexchange.com/questions/488009",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/235342/"
] | Gauss' theorem would apply to a cube or other shape. You can write
$$
\int {\bf E} \cdot d{\bf S} = \frac{Q}{\epsilon\_0}
$$
where the surface has any shape you like. However, the next step is to do the integral. How can we evaluate ${\bf E} \cdot d{\bf S}$ if we don't even know the angle between $\bf E$ and $d{\bf S}$... | As a matter of fact you can choose any arbitrary shape to be your gaussian surface, as long as the charges are inside it. But just because we can, should we? Gauss Law can be thought of geometric approach to coulombs law. We use the geometric symmetries of the charge distribution to make our problem simpler.
Remember,... |
488,009 | 
Why do we use a cylinder as a Gaussian surface for infinitely long charged wire and not some other shape like cube? | 2019/06/25 | [
"https://physics.stackexchange.com/questions/488009",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/235342/"
] | Gauss' theorem would apply to a cube or other shape. You can write
$$
\int {\bf E} \cdot d{\bf S} = \frac{Q}{\epsilon\_0}
$$
where the surface has any shape you like. However, the next step is to do the integral. How can we evaluate ${\bf E} \cdot d{\bf S}$ if we don't even know the angle between $\bf E$ and $d{\bf S}$... | As mentioned by others, any Gaussian surface can be used. There are some rules of thumb that are helpful. If you have some element of your system that extends uniformly and infinitely in some direction, then you want your Gaussian surface to be uniform in that direction as well. This suggests you want a cylinder of som... |
23,012,793 | I am trying to write a simple program in Haskell. It should basically run two shell commands in parallel. Here is the code:
```
import System.Cmd
import System.Exit
import Control.Monad
exitCodeToBool ExitSuccess = True
exitCodeToBool (ExitFailure _) = False
run :: String -> IO Bool
run = (fmap exitCodeToBool) . sys... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23012793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179926/"
] | I think using `&&` for conditional execution is something of a bad habit. Sure it's just a matter of reason to do this for *side-effect-free* stuff like the `False && all (/=0) [1..]`, but when there are side-effects it's quite confusionsome to make them dependent in such a hidden way. (Because the practise is so wides... | You say that you want to run commands in parallel and run "bar" only if "foo" succeeds. It makes no sense. You have to decide, if you want to run it in parallel or sequential.
If you want run "bar" only if "foo" succeed, try:
```
import System.Process
main = do callCommand "foo"
callCommand "bar"
```
Or ... |
23,012,793 | I am trying to write a simple program in Haskell. It should basically run two shell commands in parallel. Here is the code:
```
import System.Cmd
import System.Exit
import Control.Monad
exitCodeToBool ExitSuccess = True
exitCodeToBool (ExitFailure _) = False
run :: String -> IO Bool
run = (fmap exitCodeToBool) . sys... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23012793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179926/"
] | You say that you want to run commands in parallel and run "bar" only if "foo" succeeds. It makes no sense. You have to decide, if you want to run it in parallel or sequential.
If you want run "bar" only if "foo" succeed, try:
```
import System.Process
main = do callCommand "foo"
callCommand "bar"
```
Or ... | The IO action
```
liftM2 f action1 action2
```
runs both actions for *any* binary function `f` is (e.g., `(&&)` in your case). If you want to just run `action1` you can code it as follows:
```
--| Short-circuit &&
sAnd :: IO Bool -> IO Bool -> IO Bool
sAnd action1 action2 = do
b <- action1
if b then action2... |
23,012,793 | I am trying to write a simple program in Haskell. It should basically run two shell commands in parallel. Here is the code:
```
import System.Cmd
import System.Exit
import Control.Monad
exitCodeToBool ExitSuccess = True
exitCodeToBool (ExitFailure _) = False
run :: String -> IO Bool
run = (fmap exitCodeToBool) . sys... | 2014/04/11 | [
"https://Stackoverflow.com/questions/23012793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1179926/"
] | I think using `&&` for conditional execution is something of a bad habit. Sure it's just a matter of reason to do this for *side-effect-free* stuff like the `False && all (/=0) [1..]`, but when there are side-effects it's quite confusionsome to make them dependent in such a hidden way. (Because the practise is so wides... | The IO action
```
liftM2 f action1 action2
```
runs both actions for *any* binary function `f` is (e.g., `(&&)` in your case). If you want to just run `action1` you can code it as follows:
```
--| Short-circuit &&
sAnd :: IO Bool -> IO Bool -> IO Bool
sAnd action1 action2 = do
b <- action1
if b then action2... |
3,799,866 | I've been stuck on this for a while, it is a decade old qualifying exam problem from my university:
Let $f$ be a analytic function in the open unit disk $D$ such that $|f(z)|\leq 1$ for all $z\in D$. Let $g$ be the restriction of $f$ to the real interval $(0,1)$ and assume $\lim\_{r\rightarrow 1}g(r)=1$ and $\lim\_{r\... | 2020/08/22 | [
"https://math.stackexchange.com/questions/3799866",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/419831/"
] | Here is another idea. The intuition is this. We modify $f$ so that $f(0) = 0$ so we can apply Schwarz lemma. Then we want to "Taylor" expand at $z = 1$.
Assume $f$ isn't constant. Let $f\_1 = \psi \circ f$ where $\psi$ is the conformal map chosen so $\psi(1) = 1$ and $\psi(f(0)) = 0$.
We can take $$ \psi(z) = w \frac{... | We can assume wlog $|f(z)| <1, |z| <1$ as otherwise $f$ is constant $1$ by maximum modulus.
Let $M\_s=\sup\_{s \le r <1}|g'(r)|$. By the limit hypothesis we have $M\_s \to 0, s \to 1$. Also extend $g'(1)=0$ so $g'$ is continuos and bounded on $[0,1]$
Then since $\frac{f(s)-f(r)}{s-r}=-\frac{1}{s-r}\int\_{[s,r]}g'(t)d... |
148,608 | Is there any difference when learning the designing of a physical board-game and digital board game, meaning if I watch a tutorial about a physical board-game design is it applicable on a digital one?
Note: I'm focusing only on design process, **not the art-design**, only on the gameplay-design (rules, levels, obstacl... | 2017/09/19 | [
"https://gamedev.stackexchange.com/questions/148608",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/102605/"
] | One big difference between physical board games and digital ones is how they deal with complexity. If players forget about rules in a physical board game, then they're playing a different game. So you have to work hard to make each rule count, to make it both intuitive and easy to use. If there is a conflict, inconsist... | The principles of design are the same, but there is one crucial difference for digital versions of board games: the lack of physical pieces.
As [Quintin Smith argues in this Kotaku article from 2013](https://kotaku.com/a-board-game-piece-is-more-than-a-mere-chunk-of-plastic-479506066): (emphasis added)
>
> **The gam... |
4,957,793 | A client asks for an admin table and one column will have different cell colors based on some rules.
My problem is : what is the best css practice for this.
* we know inline is bad from the start
* we could do some css classes for each color and give them a good name but this will just clutter then main css file with... | 2011/02/10 | [
"https://Stackoverflow.com/questions/4957793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/357314/"
] | >
> So what would be a good approach for this simple problem ?
>
>
>
You have essentially already outlined your two options. It's your choice.
I would always go with classes, and never with inline CSS. If you're worried about cluttering, you could add some order using comments:
```
/** Table highlight styles **/... | Personally, I would recommend using something like [dotless](http://www.dotlesscss.org/)(DotNet) or [less](http://lesscss.org/) (Ruby).
Here you can define a colour like `@MyMainColour` and then have `div.SomeBackground { background: @MyMainColour; }`
These tools will allow you to "compile" your CSS compress and turn... |
4,957,793 | A client asks for an admin table and one column will have different cell colors based on some rules.
My problem is : what is the best css practice for this.
* we know inline is bad from the start
* we could do some css classes for each color and give them a good name but this will just clutter then main css file with... | 2011/02/10 | [
"https://Stackoverflow.com/questions/4957793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/357314/"
] | >
> So what would be a good approach for this simple problem ?
>
>
>
You have essentially already outlined your two options. It's your choice.
I would always go with classes, and never with inline CSS. If you're worried about cluttering, you could add some order using comments:
```
/** Table highlight styles **/... | You might consider:
Keep a separate css file for specific adjustments. This might be a good compromise between keeping a main style file uncluttered, but still be able to target specific GUIs with adjustments.
Let a GUI have an id. This way you can let GUI specific adjustments only affect that GUI with styles given i... |
4,957,793 | A client asks for an admin table and one column will have different cell colors based on some rules.
My problem is : what is the best css practice for this.
* we know inline is bad from the start
* we could do some css classes for each color and give them a good name but this will just clutter then main css file with... | 2011/02/10 | [
"https://Stackoverflow.com/questions/4957793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/357314/"
] | Personally, I would recommend using something like [dotless](http://www.dotlesscss.org/)(DotNet) or [less](http://lesscss.org/) (Ruby).
Here you can define a colour like `@MyMainColour` and then have `div.SomeBackground { background: @MyMainColour; }`
These tools will allow you to "compile" your CSS compress and turn... | You might consider:
Keep a separate css file for specific adjustments. This might be a good compromise between keeping a main style file uncluttered, but still be able to target specific GUIs with adjustments.
Let a GUI have an id. This way you can let GUI specific adjustments only affect that GUI with styles given i... |
55,060 | I have invested some bitcoins on a website.
They have made a payment to me of 0.002 bitcoins to my BTC wallet, but it is unconfirmed for more than 24 hours now.
Is it due to low mining fees is given from the sending party?
What can I do about this? | 2017/06/30 | [
"https://bitcoin.stackexchange.com/questions/55060",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/52615/"
] | Unfortunately there is not much you can do yourself, other than contacting the sending party or simply waiting a bit longer. It is, as you suspect, most likely due to low transaction fees.
For more information you can take a look at this similar question (which is from a senders perspective):
[Why is my transaction n... | You could try an accelerator:
<https://www.viabtc.com/tools/txaccelerator/> |
44,868,410 | I was wondering how to prove that `(So (not (y == y)))` is an instance of `Uninhabited`, and I'm not sure how to go about it. Is it provable in Idris, or is not provable due to the possibility of a weird `Eq` implementation for y? | 2017/07/02 | [
"https://Stackoverflow.com/questions/44868410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2553416/"
] | The `Eq` interface does not require an implementation to follow the normal laws of equality. But, we can define an extended `LawfulEq` interface which does:
```
%default total
is_reflexive : (t -> t -> Bool) -> Type
is_reflexive {t} rel = (x : t) -> rel x x = True
is_symmetric : (t -> t -> Bool) -> Type
is_symmetric... | Shersh is right: you can't. Implementations of `(==)` aren't guaranteed to be reflexive, so it might not be true.
You could restrict the type of `y` so that you are proving a property of a specific implementation of `(==)`, but I suspect you want to use `decEq` and `(=)` instead of `So` and `(==)`. It's easy to show `... |
46,065,666 | I have several classes that contain various attributes. Here is one example:
```cs
[XmlInclude(typeof(AFReader))]
[XmlInclude(typeof(SQLReader))]
[XmlInclude(typeof(MySQLReader))]
[Serializable]
[DataContract]
public class DataSource
{
...
}
```
I need to be able to filter through these a... | 2017/09/06 | [
"https://Stackoverflow.com/questions/46065666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11806934/"
] | I replaced the code with this and it worked:
```
Collections.swap(mMatches,holder.getAdapterPosition() ,0 );
mRecyclerView.getAdapter().notifyItemMoved(holder.getAdapterPosition(), 0);
``` | If It didn't work, try using `notifyDataSetChanged()` after swapping data as the last resort. |
46,065,666 | I have several classes that contain various attributes. Here is one example:
```cs
[XmlInclude(typeof(AFReader))]
[XmlInclude(typeof(SQLReader))]
[XmlInclude(typeof(MySQLReader))]
[Serializable]
[DataContract]
public class DataSource
{
...
}
```
I need to be able to filter through these a... | 2017/09/06 | [
"https://Stackoverflow.com/questions/46065666",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11806934/"
] | I replaced the code with this and it worked:
```
Collections.swap(mMatches,holder.getAdapterPosition() ,0 );
mRecyclerView.getAdapter().notifyItemMoved(holder.getAdapterPosition(), 0);
``` | I am not sure what's wrong with the code that cause the RecyclerView not updated its items. But from you code as shown below
```
Collections.swap(mMatches, 0, position);
notifyItemMoved(position, 0);
```
I found that, by swap two items in collection, you should move two items, not just one.
That is, for example, the... |
106,311 | In the cruel jargon of software, it is common to see the phrase "[messaging system](http://en.wikipedia.org/wiki/Enterprise_messaging_system)", as if "messaging" were an adjective. Yet if I am "brushing" my teeth, it's a verb. There is an act of "brushing", and I suppose I could invent a "brushing device".
Is the answ... | 2013/03/06 | [
"https://english.stackexchange.com/questions/106311",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/38882/"
] | It can be all three!
>
> Messaging is fun!
>
>
>
noun
>
> I'm messaging my great-uncle Jehoshaphat.
>
>
>
verb
>
> Have you downloaded the new messaging app?
>
>
>
adjective
These are [polysemes](http://en.wikipedia.org/wiki/Polysemy) of each other. | An adjective tells you more about a noun. So in the case of "Messaging System", the "Messaging" tells you more about the System, making it an adjective. |
106,311 | In the cruel jargon of software, it is common to see the phrase "[messaging system](http://en.wikipedia.org/wiki/Enterprise_messaging_system)", as if "messaging" were an adjective. Yet if I am "brushing" my teeth, it's a verb. There is an act of "brushing", and I suppose I could invent a "brushing device".
Is the answ... | 2013/03/06 | [
"https://english.stackexchange.com/questions/106311",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/38882/"
] | Yes. *Messaging* fits in the three parts of speech listed.
Firstly there is the verb [*to message*](http://oxforddictionaries.com/definition/english/message?q=message#message__15) which is transitive and can be used in all the usual ways, e.g.:
>
> I message people all the time.
>
>
> Yes, Tony! I'm **messaging** ... | It can be all three!
>
> Messaging is fun!
>
>
>
noun
>
> I'm messaging my great-uncle Jehoshaphat.
>
>
>
verb
>
> Have you downloaded the new messaging app?
>
>
>
adjective
These are [polysemes](http://en.wikipedia.org/wiki/Polysemy) of each other. |
106,311 | In the cruel jargon of software, it is common to see the phrase "[messaging system](http://en.wikipedia.org/wiki/Enterprise_messaging_system)", as if "messaging" were an adjective. Yet if I am "brushing" my teeth, it's a verb. There is an act of "brushing", and I suppose I could invent a "brushing device".
Is the answ... | 2013/03/06 | [
"https://english.stackexchange.com/questions/106311",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/38882/"
] | Yes. *Messaging* fits in the three parts of speech listed.
Firstly there is the verb [*to message*](http://oxforddictionaries.com/definition/english/message?q=message#message__15) which is transitive and can be used in all the usual ways, e.g.:
>
> I message people all the time.
>
>
> Yes, Tony! I'm **messaging** ... | An adjective tells you more about a noun. So in the case of "Messaging System", the "Messaging" tells you more about the System, making it an adjective. |
106,311 | In the cruel jargon of software, it is common to see the phrase "[messaging system](http://en.wikipedia.org/wiki/Enterprise_messaging_system)", as if "messaging" were an adjective. Yet if I am "brushing" my teeth, it's a verb. There is an act of "brushing", and I suppose I could invent a "brushing device".
Is the answ... | 2013/03/06 | [
"https://english.stackexchange.com/questions/106311",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/38882/"
] | Jackson. Your #2 use of "messaging" is the present participle used as part of a verb phrase. The present participle used alone is either a type of noun (a gerund) or an adjective. When used in combination with another active verb (in this case - am) it is a verb phrase. Some call this construction the Progressive; othe... | An adjective tells you more about a noun. So in the case of "Messaging System", the "Messaging" tells you more about the System, making it an adjective. |
106,311 | In the cruel jargon of software, it is common to see the phrase "[messaging system](http://en.wikipedia.org/wiki/Enterprise_messaging_system)", as if "messaging" were an adjective. Yet if I am "brushing" my teeth, it's a verb. There is an act of "brushing", and I suppose I could invent a "brushing device".
Is the answ... | 2013/03/06 | [
"https://english.stackexchange.com/questions/106311",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/38882/"
] | Yes. *Messaging* fits in the three parts of speech listed.
Firstly there is the verb [*to message*](http://oxforddictionaries.com/definition/english/message?q=message#message__15) which is transitive and can be used in all the usual ways, e.g.:
>
> I message people all the time.
>
>
> Yes, Tony! I'm **messaging** ... | Jackson. Your #2 use of "messaging" is the present participle used as part of a verb phrase. The present participle used alone is either a type of noun (a gerund) or an adjective. When used in combination with another active verb (in this case - am) it is a verb phrase. Some call this construction the Progressive; othe... |
1,542 | I'm seeking to customize my categories listing (archive.php) so that it shows a thumbnail image of the first image attached to each post
However, apparently the archive.php file is one of those that does not natively support the attachment object. For example, the code below will do most of what I want (though if no a... | 2010/09/08 | [
"https://wordpress.stackexchange.com/questions/1542",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/366/"
] | You could use the WordPress function get\_children. Although I don't think it makes a difference, performance-wise.
```
<?php while (have_posts()) : the_post(); ?>
<?php $attachment = array_values( get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' =>... | WP has core function to view this, see my post <http://wpengineer.com/1735/easier-better-solutions-to-get-pictures-on-your-posts/> |
45,030,014 | I was trying to implement the Auto Resizing textviews added in Api level 26 with the release of Android O. But i get the above error while compiling. It seems like the autoSizeTextType parameter is not available. I use the below code.
<https://developer.android.com/preview/features/autosizing-textview.html>
```
<Rela... | 2017/07/11 | [
"https://Stackoverflow.com/questions/45030014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1809268/"
] | Docs say:
>
> The Support Library 26.0 Beta provides full support to the autosizing
> TextView feature on devices running Android versions prior to Android
> O.
>
>
>
You need to upgrade your support lib to beta2.
>
> compile 'com.android.support:support-v4:26.0.0-beta2'
>
>
>
Don't forget to change your ... | ```
/**Try to use Beta2 Gradle dependency in build.gradle file **/
compile 'com.android.support:appcompat-v7:26.0.0-beta2'
// REQUIRED: Google's new Maven repo is required for the latest
// support library that is compatible with Android O
repositories
{
maven
{
url 'https://maven.google.com'
... |
141,202 | While using my external harddrive (NTFS) i had a crc32 error. Now i would like to see how much data is corrupted. If its a few KBs i wont mind but if its a few MB i should consider getting a new harddrive. How can i check using windows7 | 2010/05/14 | [
"https://superuser.com/questions/141202",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | You could also try
```
chkdsk volume /R
```
This will attempt to locate bad sectors on the disk and fix them if possible. Otherwise, they will be marked as bad and not used in future. | First of all, you don't need a new hard drive. Copy all the files that are not messed up to a different disk and reformat, or just stay on the current disk and do a few `fdisk`s on it. A single write fault is certainly not good grounds for new hardware, heck, it might not have been a write fault at all but simply a ran... |
19,127,036 | Can I use the item's tag attribute to store a special key/ID or is it meant for something else?
Example of intended use:
```
- (void)awakeFromNib {
[self.popup addItemWithTitle: [NSString stringWithFormat: @"dummy title" ]];
[[self.popup lastItem] setTag: 1658 ];
}
- (IBAction)popupAction: (id)sender ... | 2013/10/01 | [
"https://Stackoverflow.com/questions/19127036",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/156372/"
] | yeah the `tag` of all controls is free for your devious use, you may use different numbers for different items, or to identify them as a kind of item, it is up to you. | As [the documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPopUpButton_Class/Reference/Reference.html#//apple_ref/occ/instm/NSPopUpButton/selectItemWithTag%3a) says:
>
> You typically assign tags to menu items from Interface Builder, but you can also assign t... |
26,314,112 | What does break; do in the following code? I basically need to go out of the inner loop, but continue the outer loop
```
for(i=0;i<n;i++)
{
for(j=i;j<n;j++)
{
if(condition)
{
count++;
break;
}
}
}
``` | 2014/10/11 | [
"https://Stackoverflow.com/questions/26314112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4132172/"
] | The `break` in your code will break out of the inner loop.Then the outer loop continues(if the condition in it is true) just as you want. Note that `break` has no effect on `if`s. It will break out of loops like `for`,`while` etc and when it is placed inside nested loops as the one you have,it will break out of the inn... | As soon as the program hits the **break** statement. It exits out from the inner **for loop** and controll reach to the end of the **inner for loop**
Here, an example
```
for(i=0;i<3;i++)
{
for(j=1;j<3;j++)
{
if(i == j)
{
break;
}
printf("Inside the inner for l... |
23,189,106 | Its a simple question and wont take too much time.
Suppose this:
```
Class A{ ... }
Class B{
@OneToMany
private A a;
}
```
It means that one B can have many A or many A can have one B? | 2014/04/21 | [
"https://Stackoverflow.com/questions/23189106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3551820/"
] | If you are not receiving any POST data, you have to check for the [`post_max_size`](http://www.php.net/manual/en/ini.core.php#ini.post-max-size) directive and comparing to how much POST data you are sending to the server.
As you already experienced, the behavior of having no post data is clearly described on the [docs... | Its not working because you are adding files=>true to the route array:
```
{{ Form::open(array('route' => 'notebook.store', 'files' => true)) }}
```
Instead try this
```
{{ Form::model(array('route'=>array('notebook.store'),'files'=>true)) }}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.