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 |
|---|---|---|---|---|---|
12,586,619 | I am trying to insert a contact using an intent and I tried exactly this piece of code, taken from Android Sdk, see it [here](http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html):
```
ArrayList<ContentValues> data = new ArrayList<ContentValues>();
ContentValues row1 = new Con... | 2012/09/25 | [
"https://Stackoverflow.com/questions/12586619",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1175019/"
] | Try this:
```
Intent addPersonIntent = new Intent(Intent.ACTION_INSERT);
addPersonIntent.setType(ContactsContract.Contacts.CONTENT_TYPE);
addPersonIntent.putExtra(ContactsContract.Intents.Insert.NAME, "name");
... | Maybe you your Implementation for `Data` , `Organization` and `Email` Class is wrong.
This is the same code **But** with full implementation of Classes :
```
ArrayList<ContentValues> data = new ArrayList<ContentValues>();
ContentValues row1 = new ContentValues();
row1.put(ContactsContract.Data.MIMETYPE,Contact... |
9,807,214 | This is my script:
HTML Code:
```
<script>
function pickIt(pId){
if(document.getElementById(pId).checked==true){
document.getElementById(pId).checked=false;
}else{
document.getElementById(pId).checked = true;
}
submitForm();
return true;
}
</script>
<img src="images/bagua-square.gi... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9807214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233679/"
] | Checkboxes send their value if they are checked and are not sent at all if they are not.
You should have:
```
<input type="checkbox" id="1" name="box[]" value="1" />
<input type="checkbox" id="2" name="box[]" value="2" />
<input type="checkbox" id="3" name="box[]" value="3" />
```
So the values will be 1, 2 and 3... | A checkbox will be sent to the server (when the form is submitted) only if it's checked, otherwise it's not submitted
also change
```
onclick="pickIt('1');" /
``` |
9,807,214 | This is my script:
HTML Code:
```
<script>
function pickIt(pId){
if(document.getElementById(pId).checked==true){
document.getElementById(pId).checked=false;
}else{
document.getElementById(pId).checked = true;
}
submitForm();
return true;
}
</script>
<img src="images/bagua-square.gi... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9807214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233679/"
] | A checkbox will be sent to the server (when the form is submitted) only if it's checked, otherwise it's not submitted
also change
```
onclick="pickIt('1');" /
``` | Two options:
1. Make hidden fields per checkbox and set the value to 0 or 1 with javascript when you (un)check the checkbox. Then ignore the "on" values in your `$_POST`.
2. Php must know how many (and which) checkboxes there are, so the `$_POST` values that are missing are unchecked boxes. You could do this with a fo... |
9,807,214 | This is my script:
HTML Code:
```
<script>
function pickIt(pId){
if(document.getElementById(pId).checked==true){
document.getElementById(pId).checked=false;
}else{
document.getElementById(pId).checked = true;
}
submitForm();
return true;
}
</script>
<img src="images/bagua-square.gi... | 2012/03/21 | [
"https://Stackoverflow.com/questions/9807214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233679/"
] | Checkboxes send their value if they are checked and are not sent at all if they are not.
You should have:
```
<input type="checkbox" id="1" name="box[]" value="1" />
<input type="checkbox" id="2" name="box[]" value="2" />
<input type="checkbox" id="3" name="box[]" value="3" />
```
So the values will be 1, 2 and 3... | Two options:
1. Make hidden fields per checkbox and set the value to 0 or 1 with javascript when you (un)check the checkbox. Then ignore the "on" values in your `$_POST`.
2. Php must know how many (and which) checkboxes there are, so the `$_POST` values that are missing are unchecked boxes. You could do this with a fo... |
9,853,378 | I'm trying to:
1. display a text in a jLabel,
2. wait for two seconds,
3. then write a new text in the jLabel
this should be simple, but I get a strange bug:
the first text is never written, the application just waits for 2 seconds and then displays the final text. here is the example code:
---
```
private void te... | 2012/03/24 | [
"https://Stackoverflow.com/questions/9853378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/562946/"
] | It looks like the root cause of this was trying to reload rows in the table view while it was refreshing. There must have been some kind of inconsistent state which resulted, crashing the app every time. | solution:
```
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{
// tableView.isEditing ? NSLog(@"show edit controls"):NSLog(@"don't show edit controls");
if(tableView.isEditing){
return NO;
}else{
return YES;
}
}
``` |
30,350,682 | I'm trying to learn some python and the new style class constructor doesn't seem to be working with super.
```
class A(object):
def __init__(self):
print 'Hello A'
class B(A):
def __init__(self):
print 'Hello B'
super(A, self).__init__()
a = A();
b = B();
```
When I run this progra... | 2015/05/20 | [
"https://Stackoverflow.com/questions/30350682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1506088/"
] | You're doing `super(A, self).__init__()` it should be `super(B, self).__init__()` | You are passing the wrong class to the call to `super`. A call to `super` returns a proxy object whose MRO (method resolution order) consists of the classes *after* the class passed as the first object. Here are the MROs for each class:
```
>>> A.__mro__
(<class '__main__.A'>, <type 'object'>)
>>> B.__mro__
(<class '_... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Reducing nested expressions like `2[2[a]3[b]]` to `aabbbaabbb` could be done by *innermost redux* (=reducable expression).
Hence keep substituting the unnested form `digit[letters]` till nothing more can be reduced.
As this seems homework just a sketch:
```
String expression = "...";
for (;;) {
boolean reduced =... | **Assumptions made as question is having ambiguity :**
>
> For 2nd Case ,3[2[a]] -- > 3[aa]-- > aaaaaa
>
>
> For 3rd Case ,If integer is there inside of square bracket –user will
> provide input and decoding it usually.
>
>
> For 4th case ,If integer is there before outside of square bracket –removing such string... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Can be a bit cleaner but seems to solve the question mentioned
**Update** I have updated code to address the issues pointed out by @JimMichel
This takes into account multiple digits for number and does not accept malformed input.
```
public static String decode(String in) {
Deque<Character> stack = new Ar... | **Assumptions made as question is having ambiguity :**
>
> For 2nd Case ,3[2[a]] -- > 3[aa]-- > aaaaaa
>
>
> For 3rd Case ,If integer is there inside of square bracket –user will
> provide input and decoding it usually.
>
>
> For 4th case ,If integer is there before outside of square bracket –removing such string... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Consider what happens if you add a few operators. That is, `"3[a]2[bc]"`becomes `3*[a] + 2*[bc]`. If you redefine the `*` operator to mean "repeat," and the `+` operator to mean "concatenate".
Using the [Shunting yard algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm), you can parse the string into post... | **Assumptions made as question is having ambiguity :**
>
> For 2nd Case ,3[2[a]] -- > 3[aa]-- > aaaaaa
>
>
> For 3rd Case ,If integer is there inside of square bracket –user will
> provide input and decoding it usually.
>
>
> For 4th case ,If integer is there before outside of square bracket –removing such string... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Reducing nested expressions like `2[2[a]3[b]]` to `aabbbaabbb` could be done by *innermost redux* (=reducable expression).
Hence keep substituting the unnested form `digit[letters]` till nothing more can be reduced.
As this seems homework just a sketch:
```
String expression = "...";
for (;;) {
boolean reduced =... | Can be a bit cleaner but seems to solve the question mentioned
**Update** I have updated code to address the issues pointed out by @JimMichel
This takes into account multiple digits for number and does not accept malformed input.
```
public static String decode(String in) {
Deque<Character> stack = new Ar... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Reducing nested expressions like `2[2[a]3[b]]` to `aabbbaabbb` could be done by *innermost redux* (=reducable expression).
Hence keep substituting the unnested form `digit[letters]` till nothing more can be reduced.
As this seems homework just a sketch:
```
String expression = "...";
for (;;) {
boolean reduced =... | I tried this problem using recursion, I think this is the correct approach to decode this:
>
> Example : if we have a string 2[3[abc]]2[xy] then decode it in a level
>
>
>
> >
> > 1 level : 3[abc]3[abc]2[xy]
> >
> >
> >
> > >
> > > 2 level : abcabcabc3[abc]2[xy]
> > >
> > >
> > >
> > > >
> > > > 3 level... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Consider what happens if you add a few operators. That is, `"3[a]2[bc]"`becomes `3*[a] + 2*[bc]`. If you redefine the `*` operator to mean "repeat," and the `+` operator to mean "concatenate".
Using the [Shunting yard algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm), you can parse the string into post... | Can be a bit cleaner but seems to solve the question mentioned
**Update** I have updated code to address the issues pointed out by @JimMichel
This takes into account multiple digits for number and does not accept malformed input.
```
public static String decode(String in) {
Deque<Character> stack = new Ar... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Can be a bit cleaner but seems to solve the question mentioned
**Update** I have updated code to address the issues pointed out by @JimMichel
This takes into account multiple digits for number and does not accept malformed input.
```
public static String decode(String in) {
Deque<Character> stack = new Ar... | I tried this problem using recursion, I think this is the correct approach to decode this:
>
> Example : if we have a string 2[3[abc]]2[xy] then decode it in a level
>
>
>
> >
> > 1 level : 3[abc]3[abc]2[xy]
> >
> >
> >
> > >
> > > 2 level : abcabcabc3[abc]2[xy]
> > >
> > >
> > >
> > > >
> > > > 3 level... |
46,857,104 | I got this problem in Amazon interview.
Given have a String in Java as input `3[a]2[bc]` write a function to decode it so the output should be as "`**aaabcbc**`"
```
Input 3[a]2[bc] -> aaabcbc
Input 3[2[a]]4[b] -> aaaaabbbb
Invalid Input 3[4] `enter code here`
Invalid Input a[3]
```
I have tried the following appr... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46857104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3631878/"
] | Consider what happens if you add a few operators. That is, `"3[a]2[bc]"`becomes `3*[a] + 2*[bc]`. If you redefine the `*` operator to mean "repeat," and the `+` operator to mean "concatenate".
Using the [Shunting yard algorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm), you can parse the string into post... | I tried this problem using recursion, I think this is the correct approach to decode this:
>
> Example : if we have a string 2[3[abc]]2[xy] then decode it in a level
>
>
>
> >
> > 1 level : 3[abc]3[abc]2[xy]
> >
> >
> >
> > >
> > > 2 level : abcabcabc3[abc]2[xy]
> > >
> > >
> > >
> > > >
> > > > 3 level... |
45,370,269 | In the below programs , post increment operator is used just after completion of expression evaluation. Now for the first program shouldn't the answer be 40 n then value of a be incremented to 41.N likewise for program 2 answer should be 41 instead of 42?
```
class IncrementDemo{
public static void main(String [] args... | 2017/07/28 | [
"https://Stackoverflow.com/questions/45370269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7634412/"
] | You can understand the behaviour if you analyze how the statement is executed and the state of `a` in the meanwhile.
```
a = 20
a++ is executed, 20 is the result of the evaluation, a = 21
the second a++ is executed, 21 is the result, a = 22
the two results are added, 20 + 21 = 41, a = 41
```
on the other side, in th... | The difference between those two is, that `++a` will increment the value of a and return the incremented value. On the other hand `a++` will increment the value, but return the original value that a had before being incremented. |
45,370,269 | In the below programs , post increment operator is used just after completion of expression evaluation. Now for the first program shouldn't the answer be 40 n then value of a be incremented to 41.N likewise for program 2 answer should be 41 instead of 42?
```
class IncrementDemo{
public static void main(String [] args... | 2017/07/28 | [
"https://Stackoverflow.com/questions/45370269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7634412/"
] | You can understand the behaviour if you analyze how the statement is executed and the state of `a` in the meanwhile.
```
a = 20
a++ is executed, 20 is the result of the evaluation, a = 21
the second a++ is executed, 21 is the result, a = 22
the two results are added, 20 + 21 = 41, a = 41
```
on the other side, in th... | ```
a = a++ + a++
```
For the first `a++`, the value of `a` being used for the calculation is its actual value: 20, and after that it is incremented to 21.
So, for the second `a++`, the value used for the calculation, is also the actual value of `a`, but this time it is 21 because it has been incremented in the first... |
45,370,269 | In the below programs , post increment operator is used just after completion of expression evaluation. Now for the first program shouldn't the answer be 40 n then value of a be incremented to 41.N likewise for program 2 answer should be 41 instead of 42?
```
class IncrementDemo{
public static void main(String [] args... | 2017/07/28 | [
"https://Stackoverflow.com/questions/45370269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7634412/"
] | You can understand the behaviour if you analyze how the statement is executed and the state of `a` in the meanwhile.
```
a = 20
a++ is executed, 20 is the result of the evaluation, a = 21
the second a++ is executed, 21 is the result, a = 22
the two results are added, 20 + 21 = 41, a = 41
```
on the other side, in th... | The results are correct.
First case
----------
```
int a=20;
a= a++ + a++;
```
This results in the following evaluation steps:
* `a = a++ + a++` (with `a=20`)
* `a = 20 + a++` (with `a=21`)
* `a = 20 + 21` (with `a=22`)
Second case
-----------
```
int a=20;
a= a++ + ++a;
```
This results in the following eval... |
45,370,269 | In the below programs , post increment operator is used just after completion of expression evaluation. Now for the first program shouldn't the answer be 40 n then value of a be incremented to 41.N likewise for program 2 answer should be 41 instead of 42?
```
class IncrementDemo{
public static void main(String [] args... | 2017/07/28 | [
"https://Stackoverflow.com/questions/45370269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7634412/"
] | You can understand the behaviour if you analyze how the statement is executed and the state of `a` in the meanwhile.
```
a = 20
a++ is executed, 20 is the result of the evaluation, a = 21
the second a++ is executed, 21 is the result, a = 22
the two results are added, 20 + 21 = 41, a = 41
```
on the other side, in th... | >
> When operator used in prefix mode, it increments the operand and
> evaluates to the incremented value of that operand. When used in
> postfix mode, it increments its operand, but evaluates to the value of
> that operand before it was incremented.
>
>
>
```
a= a++ + a++;
```
so **first** a++ will yield 20,... |
47,696 | I am trying to replicate encryption/decryption method present in java in Oracle DB, so that data encrypted in java can be decrypted through Oracle Function.
Below is java code:
```
package com.encr;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
... | 2013/08/07 | [
"https://dba.stackexchange.com/questions/47696",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/26806/"
] | I was able to move the Java code to Oracle. I am writing this for people who are facing similar issue.
1. Log on to server where Oracle database is installed through Putty (command prompt in case of windows)
2. Place the Java file in server using WinSCP.
3. Find the Java compiler present in oracle home using command
... | A little late but the answer may be useful:
In Java this line should be changed:
```
final IvParameterSpec iv = new IvParameterSpec(new byte[16]);
```
into this:
```
final IvParameterSpec iv = new IvParameterSpec(new String(Base64.decode('vector_inicializacion')).getBytes());
```
where vector\_inicializacion is ... |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | SQL query to proceed this:
```
UPDATE table SET gender =
(CASE WHEN gender ='male' THEN 'female' else 'male' END)
``` | Simple create a table, let it be *people*:
```
create table people(gender varchar2(10));
insert into people values('&gender');
```
Suppose inputs are male, female, female, male:
```
select * from people;
GENDER
male
female
female
male
select decode(gender, 'male', 'female', 'female', 'male') sex f... |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | Please use this query to update Male to Female and Female to Male.
Reference Images.
[Table data before](https://i.stack.imgur.com/FdLjM.png)
Syntax
```
UPDATE <TABLE_NAME> set <COL_NAME> = (CASE <COL_NAME> WHEN '<DATA>' THEN'<DATA>' ELSE '<DATA>' END);
```
Example:
```
UPDATE users SET gender = (CASE gender ... | The below query works well in [Amazon Redshift](https://en.wikipedia.org/wiki/Amazon_Redshift).
```
update Table1 set gender =
(
select case when gender = 'male' then 'female'
when gender = 'female' then 'male' end
)
``` |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | SQL query to proceed this:
```
UPDATE table SET gender =
(CASE WHEN gender ='male' THEN 'female' else 'male' END)
``` | The below query works well in [Amazon Redshift](https://en.wikipedia.org/wiki/Amazon_Redshift).
```
update Table1 set gender =
(
select case when gender = 'male' then 'female'
when gender = 'female' then 'male' end
)
``` |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | In your case I'd recommend using a Record instead of the FETCH:
```
CREATE OR REPLACE PROCEDURE swap ()
IS
CURSOR cur_gender IS
SELECT * FROM gender;
rec_gender cur_gender%ROWTYPE;
BEGIN
FOR rec_gender IN cur_gender
LOOP
IF cur_gender%FOUND THEN
IF rec_gender.sex ... | ```
/*Logic*/
SELECT Name, CASE
WHEN Gender = 'Male' THEN 'Female'
ELSE 'Male'
END
AS "NewGender"
FROM NameGender ;
/*Here NameGender is the name of the Table*/
``` |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | ```none
ID Username Email Gender
1 sanjay sanjay@gmail.com Male
2 nikky nikky@gmail.com Male
11 raj raj@gmail.com Female
12 Rahul rahul@gmail.com Female
```
```
update users set gender = (case when gender = 'Male' then 'Female' else 'Male' end);
``` | ```
update Employee
set Gender= case Gender when 'Male' then 'Female' when 'Female' then 'Male'
else
Gender
end
``` |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | ```
UPDATE table
SET gender = CASE gender
WHEN 'Male' THEN 'Female'
WHEN 'Female' THEN 'Male'
ELSE gender
END;
``` | Simple create a table, let it be *people*:
```
create table people(gender varchar2(10));
insert into people values('&gender');
```
Suppose inputs are male, female, female, male:
```
select * from people;
GENDER
male
female
female
male
select decode(gender, 'male', 'female', 'female', 'male') sex f... |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | ```
update Table1 set "col" = (case "col" when 'male' then 'female'
else 'male' end);
```
***[fiddle](http://www.sqlfiddle.com/#!4/827b4/1)*** | Please use this query to update Male to Female and Female to Male.
Reference Images.
[Table data before](https://i.stack.imgur.com/FdLjM.png)
Syntax
```
UPDATE <TABLE_NAME> set <COL_NAME> = (CASE <COL_NAME> WHEN '<DATA>' THEN'<DATA>' ELSE '<DATA>' END);
```
Example:
```
UPDATE users SET gender = (CASE gender ... |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | There are a number of issues with what you have. The immediate cause of the PLS-00324 is that `v_gen` is a record, so you need to compare a field with that record to your fixed value, not the whole record:
```
if v_gen='male'
```
becomes
```
if v_gen.sex = 'male'
```
You then have a spurious `select * from gender... | ```
update Employee
set Gender= case Gender when 'Male' then 'Female' when 'Female' then 'Male'
else
Gender
end
``` |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | ```none
ID Username Email Gender
1 sanjay sanjay@gmail.com Male
2 nikky nikky@gmail.com Male
11 raj raj@gmail.com Female
12 Rahul rahul@gmail.com Female
```
```
update users set gender = (case when gender = 'Male' then 'Female' else 'Male' end);
``` | In your case I'd recommend using a Record instead of the FETCH:
```
CREATE OR REPLACE PROCEDURE swap ()
IS
CURSOR cur_gender IS
SELECT * FROM gender;
rec_gender cur_gender%ROWTYPE;
BEGIN
FOR rec_gender IN cur_gender
LOOP
IF cur_gender%FOUND THEN
IF rec_gender.sex ... |
17,968,933 | I have one table, *gender*, in which only two entries are there, 'male' and 'female' number of rows with these two entries only. Now I want to write a procedure which replaces these two values and the output should be as below,
```
Input Output
sex sex
------------------------
male fe... | 2013/07/31 | [
"https://Stackoverflow.com/questions/17968933",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1334522/"
] | There are a number of issues with what you have. The immediate cause of the PLS-00324 is that `v_gen` is a record, so you need to compare a field with that record to your fixed value, not the whole record:
```
if v_gen='male'
```
becomes
```
if v_gen.sex = 'male'
```
You then have a spurious `select * from gender... | SQL query to proceed this:
```
UPDATE table SET gender =
(CASE WHEN gender ='male' THEN 'female' else 'male' END)
``` |
54,737,683 | I have a dataframe like this that resulted from a cumsum of variables:
```
id v1 v2 v3
1 4 5 9
2 1 1 4
```
I I would like to get the difference among columns, such as the dataframe is transformed as:
```
id v1 v2 v3
1 4 1 4
2 1 0 3
```
So effectively "de-acumulating" the result... | 2019/02/17 | [
"https://Stackoverflow.com/questions/54737683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7824826/"
] | Not sure of the real requirement but to accomplish what you want you could use `.match` instead of `.split`.
```js
const items =
'hello!world.what?'.match(/\w+\W/g);
console.log(items);
```
[](https://i.stack.imgur.com/Pizvl.png)
---
**update ... | One solution could be first to use `replace()` for add a token after each searched character, then you can split by this token.
```js
let input = "hello!world.what?";
const customSplit = (str) =>
{
let token = "#";
return str.replace(/[!.?]/g, (match) => match + "#")
.split(token)
.filte... |
43,347,230 | In my Table i have four columns .
* r\_id
* id (User id)
* v\_id (company id)
* rate
All i am doing is to rate the company (v\_id) from user.
Suppose, if user one is rate the 1st Company (v\_id),Again when same user rate the same Company Then rate column automatically updated. if user one wants to rate another comp... | 2017/04/11 | [
"https://Stackoverflow.com/questions/43347230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4371195/"
] | Your on the right track. These simple changes should do the job.
**Model**
```
function ratings($data, $id, $v_id)
{
$query = $this->db->query("select r_id from user_ratings where id = $id and v_id = $v_id");
if($query->num_rows() > 0)
{
$data['r_id'] = $query->row()->r_id;
return $this->d... | ```
You have putted static value of v_id column try by replacing v_id ="2" with v_id = "'.$v_id.'" hope this will help you.
<?php
function ratings($insert,$id,$update,$v_id) {
$query = $this->db->query('select id, v_id from user_ratings where id = "'.$id.'" and v_id = "'.$v_id.'"')->num_rows();
if ($q... |
25,686 | How can we set the locale of a sharepoint site for a particular user according to his/her system locale through coding?
Edit: Specifically, I've created a list through coding. Suppose that I've added an item to that list. Then I've changed the locale. Then again when I'm trying to add another item within than list it ... | 2011/12/21 | [
"https://sharepoint.stackexchange.com/questions/25686",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6050/"
] | The general Regional Settings you can set via the `SPWeb` object: [`SPWeb.Locale`](http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.locale.aspx). The per user setting is stored with the `SPUser` object, specifically [`SPuser.RegionalSettings`](http://msdn.microsoft.com/en-us/library/microsoft.sharepoi... | Depending on your requirements will depend on which language you use and how you implement this.
You can update the regional settings for a web site using PowerShell by using SPWeb.Locale property. This could be used by a script which configures new sites automatically.
This site describes SPWeb.Locale: <http://msdn.... |
25,686 | How can we set the locale of a sharepoint site for a particular user according to his/her system locale through coding?
Edit: Specifically, I've created a list through coding. Suppose that I've added an item to that list. Then I've changed the locale. Then again when I'm trying to add another item within than list it ... | 2011/12/21 | [
"https://sharepoint.stackexchange.com/questions/25686",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6050/"
] | Try:
```
using (SPSite site = new SPSite("http://sp"))
{
try
{
using (SPWeb web = site.RootWeb)
{
if (web != null)
{
web.AllowUnsafeUpdates = true;
CultureInfo culture = new CultureInfo("en-US");
if (culture != null)
... | Depending on your requirements will depend on which language you use and how you implement this.
You can update the regional settings for a web site using PowerShell by using SPWeb.Locale property. This could be used by a script which configures new sites automatically.
This site describes SPWeb.Locale: <http://msdn.... |
25,686 | How can we set the locale of a sharepoint site for a particular user according to his/her system locale through coding?
Edit: Specifically, I've created a list through coding. Suppose that I've added an item to that list. Then I've changed the locale. Then again when I'm trying to add another item within than list it ... | 2011/12/21 | [
"https://sharepoint.stackexchange.com/questions/25686",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6050/"
] | The general Regional Settings you can set via the `SPWeb` object: [`SPWeb.Locale`](http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.locale.aspx). The per user setting is stored with the `SPUser` object, specifically [`SPuser.RegionalSettings`](http://msdn.microsoft.com/en-us/library/microsoft.sharepoi... | Try:
```
using (SPSite site = new SPSite("http://sp"))
{
try
{
using (SPWeb web = site.RootWeb)
{
if (web != null)
{
web.AllowUnsafeUpdates = true;
CultureInfo culture = new CultureInfo("en-US");
if (culture != null)
... |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Note that this code:
```
if something
return true
else
return false
end
```
is completely equivalent to:
```
!!something
```
Or directly `something` if it's a boolean. Note also that's not idiomatic to explicitly write `return` when you are writing the last expression of a method.
Also, try to avoid repeatin... | There are various solutions to this problem. One is to use[andand](https://github.com/raganwald/andand). Your code would become something like:
```
def has_things?
things.andand[:something].andand[:else].andand[:matters]
end
```
While not terribly pretty, it would solve the problem. |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Note that this code:
```
if something
return true
else
return false
end
```
is completely equivalent to:
```
!!something
```
Or directly `something` if it's a boolean. Note also that's not idiomatic to explicitly write `return` when you are writing the last expression of a method.
Also, try to avoid repeatin... | You could use [`try`](http://api.rubyonrails.org/classes/Object.html#method-i-try):
```
def has_thing?
!! things.try(:[], :something).try(:[], :else).try(:[], :matters)
end
```
A more verbose version using `Hash#fetch`:
```
def has_thing?
true if things &&
things.fetch(:something){ return false }.
... |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Note that this code:
```
if something
return true
else
return false
end
```
is completely equivalent to:
```
!!something
```
Or directly `something` if it's a boolean. Note also that's not idiomatic to explicitly write `return` when you are writing the last expression of a method.
Also, try to avoid repeatin... | I'd probably go with:
```
def has_thing?
!!(
things &&
things[:something] &&
things[:something][:else] &&
things[:something][:else][:matters]
)
end
```
Being able to quickly understand what code is doing is important for long-term code maintenance.
Vertical alignment makes it easy for us to quic... |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Two options I might suggest:
```
def has_thing?
!!(things && things[:something] && things[:something][:else] && things[:something][:else][:matters])
end
```
Or for more readable
```
def has_thing?
return false unless things
return false unless things[:something]
return false unless things[:something][:else]... | There are various solutions to this problem. One is to use[andand](https://github.com/raganwald/andand). Your code would become something like:
```
def has_things?
things.andand[:something].andand[:else].andand[:matters]
end
```
While not terribly pretty, it would solve the problem. |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | You could use [`try`](http://api.rubyonrails.org/classes/Object.html#method-i-try):
```
def has_thing?
!! things.try(:[], :something).try(:[], :else).try(:[], :matters)
end
```
A more verbose version using `Hash#fetch`:
```
def has_thing?
true if things &&
things.fetch(:something){ return false }.
... | There are various solutions to this problem. One is to use[andand](https://github.com/raganwald/andand). Your code would become something like:
```
def has_things?
things.andand[:something].andand[:else].andand[:matters]
end
```
While not terribly pretty, it would solve the problem. |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | I'd probably go with:
```
def has_thing?
!!(
things &&
things[:something] &&
things[:something][:else] &&
things[:something][:else][:matters]
)
end
```
Being able to quickly understand what code is doing is important for long-term code maintenance.
Vertical alignment makes it easy for us to quic... | There are various solutions to this problem. One is to use[andand](https://github.com/raganwald/andand). Your code would become something like:
```
def has_things?
things.andand[:something].andand[:else].andand[:matters]
end
```
While not terribly pretty, it would solve the problem. |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Two options I might suggest:
```
def has_thing?
!!(things && things[:something] && things[:something][:else] && things[:something][:else][:matters])
end
```
Or for more readable
```
def has_thing?
return false unless things
return false unless things[:something]
return false unless things[:something][:else]... | You could use [`try`](http://api.rubyonrails.org/classes/Object.html#method-i-try):
```
def has_thing?
!! things.try(:[], :something).try(:[], :else).try(:[], :matters)
end
```
A more verbose version using `Hash#fetch`:
```
def has_thing?
true if things &&
things.fetch(:something){ return false }.
... |
8,246,948 | I have this program which accepts input from the user through JOptionPane. What my program is doing is recording everything I input from the JOptionPane in the JTextArea. Now, I want to remove some of my input in the JTextArea but I don't know how.
I'm thinking that there must be something like a JList that I can use ... | 2011/11/23 | [
"https://Stackoverflow.com/questions/8246948",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1025698/"
] | Two options I might suggest:
```
def has_thing?
!!(things && things[:something] && things[:something][:else] && things[:something][:else][:matters])
end
```
Or for more readable
```
def has_thing?
return false unless things
return false unless things[:something]
return false unless things[:something][:else]... | I'd probably go with:
```
def has_thing?
!!(
things &&
things[:something] &&
things[:something][:else] &&
things[:something][:else][:matters]
)
end
```
Being able to quickly understand what code is doing is important for long-term code maintenance.
Vertical alignment makes it easy for us to quic... |
48,148 | I have been testing VM on Azure. I have created a SQL VM running SQL 2012 on Windows 2012 and would like to connect to it via SSMS 2012 on my local instead of connecting via RDP through Azure Portal.
Thanks! | 2013/08/14 | [
"https://dba.stackexchange.com/questions/48148",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/18984/"
] | Yes, [this is well documented](http://www.windowsazure.com/en-us/manage/windows/common-tasks/install-sql-server/#SSMS).
Once you have configured the firewall, the ports, and your instance to use SQL authentication, you should be able to connect to the computer name (i.e. name.cloudapp.net) | You would need to leverage Windows Azure Virtual Network for this type of connectivity. |
71,818 | I designed a big front-cover for a magazine in Photoshop.
I put the PNG into an ODT-Open-Office-File and then save it as a PDF.
When I view it with Adobe Reader ...
[](https://i.stack.imgur.com/ruiLJ.jpg)
It seems to be a display-problem!?
I want th... | 2016/05/30 | [
"https://graphicdesign.stackexchange.com/questions/71818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/67673/"
] | If your image looks as it should when you zoom in there is nothing wrong with your image. OpenOffice may be resampling or compressing your image, but if it looks as it should at a higher zoom level then I assume that's not the problem. The problem is how Adobe Reader is rendering your image.
It's physically impossible... | This is a bit of a guess, but it's possible that the 140% ratio relates to the difference between 96dpi (which I think is the default DPI of OpenOffice) and 72dpi (the default DPI of Photoshop). Which is a ratio of 1.333.
If you haven't already, try changing the DPI of your original image to 96. Don't resample it, jus... |
71,818 | I designed a big front-cover for a magazine in Photoshop.
I put the PNG into an ODT-Open-Office-File and then save it as a PDF.
When I view it with Adobe Reader ...
[](https://i.stack.imgur.com/ruiLJ.jpg)
It seems to be a display-problem!?
I want th... | 2016/05/30 | [
"https://graphicdesign.stackexchange.com/questions/71818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/67673/"
] | If your image looks as it should when you zoom in there is nothing wrong with your image. OpenOffice may be resampling or compressing your image, but if it looks as it should at a higher zoom level then I assume that's not the problem. The problem is how Adobe Reader is rendering your image.
It's physically impossible... | I second that disparagement of PDF viewers and PDF because I have had numerous problems over the years.
* I created a simple graphic in inkscape that rendered differently 4 ways on 4 viewers.
* Badly formed (per Adobe) PDF files can display ok on 3rd party viewers but not in acroread.
* A PDF file can be viewable fine... |
71,818 | I designed a big front-cover for a magazine in Photoshop.
I put the PNG into an ODT-Open-Office-File and then save it as a PDF.
When I view it with Adobe Reader ...
[](https://i.stack.imgur.com/ruiLJ.jpg)
It seems to be a display-problem!?
I want th... | 2016/05/30 | [
"https://graphicdesign.stackexchange.com/questions/71818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/67673/"
] | Short answer: **Never trust a `.pdf` viewer.**
Long answer: `.pdf` viewers are fallible. The PDF standard is very broad and has many applications. It displays files on-screen, and also creates print-ready files. Because of this broad application of the file type, there is no single `.pdf` viewer that can render all ki... | This is a bit of a guess, but it's possible that the 140% ratio relates to the difference between 96dpi (which I think is the default DPI of OpenOffice) and 72dpi (the default DPI of Photoshop). Which is a ratio of 1.333.
If you haven't already, try changing the DPI of your original image to 96. Don't resample it, jus... |
71,818 | I designed a big front-cover for a magazine in Photoshop.
I put the PNG into an ODT-Open-Office-File and then save it as a PDF.
When I view it with Adobe Reader ...
[](https://i.stack.imgur.com/ruiLJ.jpg)
It seems to be a display-problem!?
I want th... | 2016/05/30 | [
"https://graphicdesign.stackexchange.com/questions/71818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/67673/"
] | Short answer: **Never trust a `.pdf` viewer.**
Long answer: `.pdf` viewers are fallible. The PDF standard is very broad and has many applications. It displays files on-screen, and also creates print-ready files. Because of this broad application of the file type, there is no single `.pdf` viewer that can render all ki... | I second that disparagement of PDF viewers and PDF because I have had numerous problems over the years.
* I created a simple graphic in inkscape that rendered differently 4 ways on 4 viewers.
* Badly formed (per Adobe) PDF files can display ok on 3rd party viewers but not in acroread.
* A PDF file can be viewable fine... |
71,818 | I designed a big front-cover for a magazine in Photoshop.
I put the PNG into an ODT-Open-Office-File and then save it as a PDF.
When I view it with Adobe Reader ...
[](https://i.stack.imgur.com/ruiLJ.jpg)
It seems to be a display-problem!?
I want th... | 2016/05/30 | [
"https://graphicdesign.stackexchange.com/questions/71818",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/67673/"
] | This is a bit of a guess, but it's possible that the 140% ratio relates to the difference between 96dpi (which I think is the default DPI of OpenOffice) and 72dpi (the default DPI of Photoshop). Which is a ratio of 1.333.
If you haven't already, try changing the DPI of your original image to 96. Don't resample it, jus... | I second that disparagement of PDF viewers and PDF because I have had numerous problems over the years.
* I created a simple graphic in inkscape that rendered differently 4 ways on 4 viewers.
* Badly formed (per Adobe) PDF files can display ok on 3rd party viewers but not in acroread.
* A PDF file can be viewable fine... |
3,314,597 | >
> Given the matrix
> $$A=\begin{pmatrix} 1 & 1 \\ 2 & 1 \\ 2 & -3 \\ 1 & -3 \end{pmatrix},$$
> compute the range of
> $$T\colon\Bbb R^2\to\Bbb R^4,\quad x\mapsto Ax.$$
>
>
>
I'm not sure how to proceed. Do you take the transpose of $A$ which equals the coordinates given by $(x,y)$ in $R^4$ and then RREF to de... | 2019/08/05 | [
"https://math.stackexchange.com/questions/3314597",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/606888/"
] | It seems this is not built in (at least, not exposed to users), but it is easy enough to achieve:
Given a monomial ordering, dividing a polynomial $f$ by an *ordered* list of polynomials $f\_1,\ldots,f\_s$ means to express $$f = q\_1f\_1 + \ldots + q\_sf\_s + r,$$ where either $r=0$ or none of the monomials in $r$ are... | If you are given f and g two polynomials the remainder is given by f % g.
suppose now you are given with G ideal and G=(g1,g2,...,gn). then the remainder when f is divided by G should be f % G.
Hope this helps. |
47,197 | Wikipedia [says](https://en.wikipedia.org/wiki/Elections_in_the_Netherlands#Timing)
>
> If the House of Representatives is dissolved, due to a severe conflict between the House of Representatives and cabinet, or within the cabinet, a snap election takes place as soon as possible, usually after two months to give part... | 2019/10/28 | [
"https://politics.stackexchange.com/questions/47197",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/18373/"
] | Formally, the House is dissolved by Royal Decision ([Koninklijk Besluit](https://nl.wikipedia.org/wiki/Koninklijk_besluit#Nederland)), which effectively means by cabinet decision. No vote is needed in the House. (Constitution, Art 64)
There are also exceptional grounds; the House is also dissolved as part of a constit... | To elaborate on the other reasons which were already named by MSalters. The two more ways to force an election, as outlined by [nederlandrechtsstaat.nl](https://www.nederlandrechtsstaat.nl/module/nlrs/script/viewer.asp?soort=commentaar&artikel=64) (in Dutch):
>
> Naast het ‘politieke’ ontbindingsrecht in artikel 64, ... |
19,855 | After reading a question and providing an answer on math stack exchange, I often find myself thinking about it from time to time and making more progress on a fuller understanding of the issues/problems/concepts or a better way to explain the answer/calculation. At what point is it considered overboard to continually e... | 2015/03/09 | [
"https://math.meta.stackexchange.com/questions/19855",
"https://math.meta.stackexchange.com",
"https://math.meta.stackexchange.com/users/212426/"
] | There are no official restrictions. But a few comments/observations/pieces of advice:
1. Frequent edits begin to annoy others at some point. Edits "bump" the thread to the front page of active questions, so if you give the impression that you are trying to hog the attention of others, then expect negative reactions. A... | It's not a problem unless your repeated edits begin to annoy people.
When they begin to annoy people, they will tell you to knock it off, using some combination of comments and downvotes. |
87,665 | One of my characters is an assassin and mercenary. He's killed plenty of nobles and participated in a couple wars all across the continent. For the story to work, I need other criminals to know who he is (not what he looks like, just his name). So assuming the continent is more or less like Europe, would he be "famous"... | 2017/08/01 | [
"https://worldbuilding.stackexchange.com/questions/87665",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41069/"
] | Over the hills and far away.
But there would be "I'm Spartacus" effect. If people know his name and not his face (which would require someone to personally know him) then there would be a lot of impostors. Which in turn would create a lot of witnesses that the assassin is tall short bald blonde with both blue eyes a... | If there is a large bounty on his head, then information would spread quickly I think. People really liked money, even in the medival times and I think they would be willing to spread the news in exchange for bounties. A good example of this [The Red Knight](http://www.medievaltimes.com/about-the-show/index.html), call... |
87,665 | One of my characters is an assassin and mercenary. He's killed plenty of nobles and participated in a couple wars all across the continent. For the story to work, I need other criminals to know who he is (not what he looks like, just his name). So assuming the continent is more or less like Europe, would he be "famous"... | 2017/08/01 | [
"https://worldbuilding.stackexchange.com/questions/87665",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41069/"
] | Over the hills and far away.
But there would be "I'm Spartacus" effect. If people know his name and not his face (which would require someone to personally know him) then there would be a lot of impostors. Which in turn would create a lot of witnesses that the assassin is tall short bald blonde with both blue eyes a... | If your world has fairs, he is the stuff of legends. The Middle Ages were boring because people saw most of their lives the same people. So because he is interesting news, someone has made a song about him (easier to remember) and fairs brought people together from all around. Merchants were the main travelers in Medie... |
87,665 | One of my characters is an assassin and mercenary. He's killed plenty of nobles and participated in a couple wars all across the continent. For the story to work, I need other criminals to know who he is (not what he looks like, just his name). So assuming the continent is more or less like Europe, would he be "famous"... | 2017/08/01 | [
"https://worldbuilding.stackexchange.com/questions/87665",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41069/"
] | Without looking, can you name all current members still at large on the FBI's Top 10 most wanted list? No googling.
The reason why the list works is because it brings awareness to the fugitive, who may be hiding out in a small town that wouldn't have thought otherwise about their loner neighbor. You wouldn't believe t... | If there is a large bounty on his head, then information would spread quickly I think. People really liked money, even in the medival times and I think they would be willing to spread the news in exchange for bounties. A good example of this [The Red Knight](http://www.medievaltimes.com/about-the-show/index.html), call... |
87,665 | One of my characters is an assassin and mercenary. He's killed plenty of nobles and participated in a couple wars all across the continent. For the story to work, I need other criminals to know who he is (not what he looks like, just his name). So assuming the continent is more or less like Europe, would he be "famous"... | 2017/08/01 | [
"https://worldbuilding.stackexchange.com/questions/87665",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41069/"
] | Without looking, can you name all current members still at large on the FBI's Top 10 most wanted list? No googling.
The reason why the list works is because it brings awareness to the fugitive, who may be hiding out in a small town that wouldn't have thought otherwise about their loner neighbor. You wouldn't believe t... | If your world has fairs, he is the stuff of legends. The Middle Ages were boring because people saw most of their lives the same people. So because he is interesting news, someone has made a song about him (easier to remember) and fairs brought people together from all around. Merchants were the main travelers in Medie... |
87,665 | One of my characters is an assassin and mercenary. He's killed plenty of nobles and participated in a couple wars all across the continent. For the story to work, I need other criminals to know who he is (not what he looks like, just his name). So assuming the continent is more or less like Europe, would he be "famous"... | 2017/08/01 | [
"https://worldbuilding.stackexchange.com/questions/87665",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/41069/"
] | If your world has fairs, he is the stuff of legends. The Middle Ages were boring because people saw most of their lives the same people. So because he is interesting news, someone has made a song about him (easier to remember) and fairs brought people together from all around. Merchants were the main travelers in Medie... | If there is a large bounty on his head, then information would spread quickly I think. People really liked money, even in the medival times and I think they would be willing to spread the news in exchange for bounties. A good example of this [The Red Knight](http://www.medievaltimes.com/about-the-show/index.html), call... |
9,122,224 | I have a date field in the database table of this format 2012-02-1.i need to write 3 different queries:
a.) I need to retrieve all fields where date is between today and previous 5 days.
b.) I need to retrieve all fields where date is older than 5 days from today's date.
c.) I need to retrieve all fields where d... | 2012/02/03 | [
"https://Stackoverflow.com/questions/9122224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856753/"
] | Linq's DeferredExecution to rescue. Linq query is not executed unless the data is requested from it.
```
var prod = from p in ctxt.products.expand("items\details")
select p;
if (p1 != null)
{
prod = prod.Where(p => p.x == p1);
}
if (p2 != null)
{
prod = prod.Where(p => p.xx == p2);
}
// Execute the ... | You can chain the methods as needed:
```
YourType(string p1, string p2, string p3, string p4)
{
var prod = ctxt.Products.Expand("items\details");
if (!p1.IsNullOrWhiteSpace())
prod = prod.Where(p => p.x == p1);
if (!p2.IsNullOrWhiteSpace())
prod = prod.Where(p => p.xx == p2);
... |
9,122,224 | I have a date field in the database table of this format 2012-02-1.i need to write 3 different queries:
a.) I need to retrieve all fields where date is between today and previous 5 days.
b.) I need to retrieve all fields where date is older than 5 days from today's date.
c.) I need to retrieve all fields where d... | 2012/02/03 | [
"https://Stackoverflow.com/questions/9122224",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856753/"
] | Linq's DeferredExecution to rescue. Linq query is not executed unless the data is requested from it.
```
var prod = from p in ctxt.products.expand("items\details")
select p;
if (p1 != null)
{
prod = prod.Where(p => p.x == p1);
}
if (p2 != null)
{
prod = prod.Where(p => p.xx == p2);
}
// Execute the ... | You could always build the query in pieces and take advantage of delayed query execution:
```
public Constructor(int? p1, int? p2, int? p3, int? p4)
{
var prod = ctxt.products.expand("items\details");
if(p1 != null)
prod = prod.Where(p.x == p1);
if(p2 != null)
prod = prod.Where(p.xx == p2... |
34,309,291 | I am trying to generate a generic Support/Help page for all the applications in the company. Requirement as below:
* Each Application will have an XML page (which will have predefined structure) about application Support/installation/FAQ etc.
* Based on this xml page we need to create html page (though XSLT) and using... | 2015/12/16 | [
"https://Stackoverflow.com/questions/34309291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739418/"
] | You have made a typo. Properties and methods in JavaScript are case-sensetive. The method is `getElementById`, not `getElementByID`.
Assuming the only inline styles that are on the element are the ones you add in the function above, you can use the following to remove the styles and 'reset' the element:
```js
functio... | The best thing you can do in this case is to use 2 css classes and switch those with javascript. on each click you can check if it has a certain class and then switch those
```
.normal{
width:240px;
height:300px;
background-color:darkgrey;
background-position:center;
background-repeat:no-repeat;
... |
34,309,291 | I am trying to generate a generic Support/Help page for all the applications in the company. Requirement as below:
* Each Application will have an XML page (which will have predefined structure) about application Support/installation/FAQ etc.
* Based on this xml page we need to create html page (though XSLT) and using... | 2015/12/16 | [
"https://Stackoverflow.com/questions/34309291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739418/"
] | You have made a typo. Properties and methods in JavaScript are case-sensetive. The method is `getElementById`, not `getElementByID`.
Assuming the only inline styles that are on the element are the ones you add in the function above, you can use the following to remove the styles and 'reset' the element:
```js
functio... | typo error
```
getElementById(id).style.fontSize = '30' +'px';
^
```
Please check it's working
```js
function maxi(id, weight, height)
{
with (document)
{
getElementById(id).style.width = weight + 'px';
getElementById(id).style.height = height + 'px';
getElementById(id).style.fontSize = ... |
34,309,291 | I am trying to generate a generic Support/Help page for all the applications in the company. Requirement as below:
* Each Application will have an XML page (which will have predefined structure) about application Support/installation/FAQ etc.
* Based on this xml page we need to create html page (though XSLT) and using... | 2015/12/16 | [
"https://Stackoverflow.com/questions/34309291",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739418/"
] | The best thing you can do in this case is to use 2 css classes and switch those with javascript. on each click you can check if it has a certain class and then switch those
```
.normal{
width:240px;
height:300px;
background-color:darkgrey;
background-position:center;
background-repeat:no-repeat;
... | typo error
```
getElementById(id).style.fontSize = '30' +'px';
^
```
Please check it's working
```js
function maxi(id, weight, height)
{
with (document)
{
getElementById(id).style.width = weight + 'px';
getElementById(id).style.height = height + 'px';
getElementById(id).style.fontSize = ... |
435,777 | >
> Однако сесть можно и в колоннаде – на воздухе или расположиться в
> холле.
>
>
> | 2017/12/07 | [
"https://rus.stackexchange.com/questions/435777",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | >
> Немного, в некоторой степени, в какой-то степени, фрагментами,
> неполностью, частично.
>
>
> | Площадь Республики – **часть** терм Диоклетиана. Масштабная архитектурная реальность древнего Рима сохранилась здесь в значительной степени (здесь особенно впечатляет), так как руины центрального зала терм были перестроены в современные здания (две церкви и и музей).
<http://hitplaneta.ru/?p=1083> |
435,777 | >
> Однако сесть можно и в колоннаде – на воздухе или расположиться в
> холле.
>
>
> | 2017/12/07 | [
"https://rus.stackexchange.com/questions/435777",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | 1). Площадь Республики – остаток терм Диоклетиана. Масштабная архитектурная реальность древнего Рима здесь частью сохранилась.
2). Площадь Республики – территория античных терм Диоклетиана. Масштабная архитектурная реальность древнего Рима здесь частью сохранилась.
3). Площадь Республики – бывшие термы Диоклетиана. М... | >
> Немного, в некоторой степени, в какой-то степени, фрагментами,
> неполностью, частично.
>
>
> |
435,777 | >
> Однако сесть можно и в колоннаде – на воздухе или расположиться в
> холле.
>
>
> | 2017/12/07 | [
"https://rus.stackexchange.com/questions/435777",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/177616/"
] | 1). Площадь Республики – остаток терм Диоклетиана. Масштабная архитектурная реальность древнего Рима здесь частью сохранилась.
2). Площадь Республики – территория античных терм Диоклетиана. Масштабная архитектурная реальность древнего Рима здесь частью сохранилась.
3). Площадь Республики – бывшие термы Диоклетиана. М... | Площадь Республики – **часть** терм Диоклетиана. Масштабная архитектурная реальность древнего Рима сохранилась здесь в значительной степени (здесь особенно впечатляет), так как руины центрального зала терм были перестроены в современные здания (две церкви и и музей).
<http://hitplaneta.ru/?p=1083> |
44,570,973 | I am trying to create a survival game in pygame, Python 2.7. I am using a class oriented program but I don't know how to use `Surface` to make a tree. Is there a function that can create such an image?
Here is my code:
```
class Tree(pygame.sprite.Sprite):
global green
global brown
def __init__(self):
... | 2017/06/15 | [
"https://Stackoverflow.com/questions/44570973",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6600659/"
] | Surface allows you to draw and represent images on screen:
<https://www.pygame.org/docs/ref/surface.html>
<http://www.cogsci.rpi.edu/~destem/gamedev/pygame.pdf>
I will update the answer once I have more info. What tree do you want to draw?
Can it be as simple as a green circle and a brown rectangle trunk under or you ... | If you want a plain image of a tree, you can use blit:
```
image = pygame.image.load("tree.jpg")
screen = pygame.display.set_mode((500, 500))
screen.blit(image, (x1, y1))
``` |
64,550,503 | I am trying to save the tokenizer in huggingface so that I can load it later from a container where I don't need access to the internet.
```py
BASE_MODEL = "distilbert-base-multilingual-cased"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.save_vocabulary("./models/tokenizer/")
tokenizer2 = AutoTokeni... | 2020/10/27 | [
"https://Stackoverflow.com/questions/64550503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2530674/"
] | `save_vocabulary()`, saves only the vocabulary file of the tokenizer (List of BPE tokens).
To save the entire tokenizer, you should use `save_pretrained()`
Thus, as follows:
```
BASE_MODEL = "distilbert-base-multilingual-cased"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.save_pretrained("./models... | Renaming "tokenizer\_config.json" file -- the one created by save\_pretrained() function -- to "config.json" solved the same issue on my environment. |
64,550,503 | I am trying to save the tokenizer in huggingface so that I can load it later from a container where I don't need access to the internet.
```py
BASE_MODEL = "distilbert-base-multilingual-cased"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.save_vocabulary("./models/tokenizer/")
tokenizer2 = AutoTokeni... | 2020/10/27 | [
"https://Stackoverflow.com/questions/64550503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2530674/"
] | `save_vocabulary()`, saves only the vocabulary file of the tokenizer (List of BPE tokens).
To save the entire tokenizer, you should use `save_pretrained()`
Thus, as follows:
```
BASE_MODEL = "distilbert-base-multilingual-cased"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
tokenizer.save_pretrained("./models... | You need to save both your model and tokenizer in the same directory. HuggingFace is actually looking for the config.json file of your model, so renaming the tokenizer\_config.json would not solve the issue |
65,504,009 | Here's the css of the navbar before it shrinks:
```
.navbar{
display: flex;
justify-content: space-evenly;
align-items: center;
position: fixed;
width: 100%;
height: 15vh;
background-color: transparent;
z-index: 1;
transition: 0.6s ease;
}
```
Here's what I want after it shrinks:
... | 2020/12/30 | [
"https://Stackoverflow.com/questions/65504009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14892500/"
] | Here is the solution you need. And this is a javascript solution.
The `toggle()` method is used here.
Class `adjust` rules are applied immediately on the first scroll.
```js
window.onscroll = function() {
let navbar = document.querySelector('.navbar');
navbar.classList.toggle('adjust', this.scrollY > 0);
};
``... | ```js
var position = $(window).scrollTop();
$(window).on("scroll", function () {
var scroll = $(window).scrollTop();
if (scroll > position)
//scroll down
$(".navbar").addClass("adjust");
if (scroll == 0)
$(".navbar").removeClass("adjust");
position = scroll;
});
//menu st... |
42,117,446 | My problem is similar to [this question](https://stackoverflow.com/questions/33771981/google-compute-engine-lamp-stack-sftp-sql-and-https/33772878#33772878) but since I don't have enough reputation to write a comment AND the answer to that question dindn’t help, I am starting a new question.
I have an GCE VM instance ... | 2017/02/08 | [
"https://Stackoverflow.com/questions/42117446",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4190236/"
] | I just found the solution to my problem,
Special thanks to @Slava for pointing me the way, after all it was iptables.
So, I kept receiving a "MySQL connection refused" message when trying to connect remotely so I searched for a way to see TCP connection logs and I found the `tcpdump` command.
By running `sudo tcpdum... | I had similar problem with a vm instance.
I tested everything and it was solved by creating a new user on mysql.
I used this [post](https://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server) to solve it. |
2,521,582 | i want to generate HMAC-SHA1 of NSString type variable. I see the [post](https://stackoverflow.com/questions/756492/objective-c-sample-code-for-hmac-sha1) but this method give me error in `CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);`
and
`NSString *hash = [HMAC base64Encoding];`
line.
... | 2010/03/26 | [
"https://Stackoverflow.com/questions/2521582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178978/"
] | Have you got this at the top of your source file?
```
#import <CommonCrypto/CommonHMAC.h>
```
Regarding the base64 part of your question, [this question](https://stackoverflow.com/questions/392464/any-base64-library-on-iphone-sdk) will show you where to get a base64 encoding library/protocol. | About the base64Encoding problem:
This is because NSData does not contains this method by default, you need to extend NSData with that. In this link is explained <http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html> good luck! |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | WAF, with lack of time in the day for 3 halacha sedarim. Most will learn a sefer which is in line with their Yeshiva's path (commonly MB nowadays) or the Aruch haShulchan which provides good background and chidushim. However, they would like to know if there are dissenting opinions among the other big Halachic rulers. ... | Another good reason is to help people who are learning for the Semikha exams, both in the Israeli Rabbinate(and quite probably other places as well) where they expect to you know what the major Mahlokets of the previous generations were, and if possible where modern posking fall out on the issue.
If you are not fluent... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | WAF, with lack of time in the day for 3 halacha sedarim. Most will learn a sefer which is in line with their Yeshiva's path (commonly MB nowadays) or the Aruch haShulchan which provides good background and chidushim. However, they would like to know if there are dissenting opinions among the other big Halachic rulers. ... | The motivation behind these footnoting IS LHAGDIL TORAH, make the Torah more expansive to give people more to talk about and more angles to come from on a single idea.
The reason someone just cut out the middle man and print an Aruch Hashulchan with the Chazon Ish is that they sometimes do things like that and it's a ... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | Speaking only of the various printings of the Kitzur Shulchan Aruch, the reason why it is usually printed with footnotes is because those footnotes are intended to tell us about other poskim we usually hold like (in preference to the Kitzur Shulchan Aruch).
The Kitzur Shulchan Aruch is so prevalant because it's a conv... | As far as #2, the Chazon Ish actually quoted and adressed the Mishna Berurah extensively, therefore his hasagos and sometimes other chidushim are printed along with it. He never focused on the Aruch Hashulchan so his chidushim have no place in the Aruch Hashulchan.
Regarding #1 which was answered many times over I wi... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | I always assumed the motivation was to provide information from a diversity of posekim, when they differ on something, so that readers will be aware that there are varying opinions/traditions.
An extreme version of this is an [edition](http://www.mysefer.com/product.asp?P_ID=1389&strPageHistory=related) of [Kitzur Shu... | The motivation behind these footnoting IS LHAGDIL TORAH, make the Torah more expansive to give people more to talk about and more angles to come from on a single idea.
The reason someone just cut out the middle man and print an Aruch Hashulchan with the Chazon Ish is that they sometimes do things like that and it's a ... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | Speaking only of the various printings of the Kitzur Shulchan Aruch, the reason why it is usually printed with footnotes is because those footnotes are intended to tell us about other poskim we usually hold like (in preference to the Kitzur Shulchan Aruch).
The Kitzur Shulchan Aruch is so prevalant because it's a conv... | The motivation behind these footnoting IS LHAGDIL TORAH, make the Torah more expansive to give people more to talk about and more angles to come from on a single idea.
The reason someone just cut out the middle man and print an Aruch Hashulchan with the Chazon Ish is that they sometimes do things like that and it's a ... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | I always assumed the motivation was to provide information from a diversity of posekim, when they differ on something, so that readers will be aware that there are varying opinions/traditions.
An extreme version of this is an [edition](http://www.mysefer.com/product.asp?P_ID=1389&strPageHistory=related) of [Kitzur Shu... | Another good reason is to help people who are learning for the Semikha exams, both in the Israeli Rabbinate(and quite probably other places as well) where they expect to you know what the major Mahlokets of the previous generations were, and if possible where modern posking fall out on the issue.
If you are not fluent... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | WAF, with lack of time in the day for 3 halacha sedarim. Most will learn a sefer which is in line with their Yeshiva's path (commonly MB nowadays) or the Aruch haShulchan which provides good background and chidushim. However, they would like to know if there are dissenting opinions among the other big Halachic rulers. ... | As far as #2, the Chazon Ish actually quoted and adressed the Mishna Berurah extensively, therefore his hasagos and sometimes other chidushim are printed along with it. He never focused on the Aruch Hashulchan so his chidushim have no place in the Aruch Hashulchan.
Regarding #1 which was answered many times over I wi... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | I always assumed the motivation was to provide information from a diversity of posekim, when they differ on something, so that readers will be aware that there are varying opinions/traditions.
An extreme version of this is an [edition](http://www.mysefer.com/product.asp?P_ID=1389&strPageHistory=related) of [Kitzur Shu... | As far as #2, the Chazon Ish actually quoted and adressed the Mishna Berurah extensively, therefore his hasagos and sometimes other chidushim are printed along with it. He never focused on the Aruch Hashulchan so his chidushim have no place in the Aruch Hashulchan.
Regarding #1 which was answered many times over I wi... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | I always assumed the motivation was to provide information from a diversity of posekim, when they differ on something, so that readers will be aware that there are varying opinions/traditions.
An extreme version of this is an [edition](http://www.mysefer.com/product.asp?P_ID=1389&strPageHistory=related) of [Kitzur Shu... | WAF, with lack of time in the day for 3 halacha sedarim. Most will learn a sefer which is in line with their Yeshiva's path (commonly MB nowadays) or the Aruch haShulchan which provides good background and chidushim. However, they would like to know if there are dissenting opinions among the other big Halachic rulers. ... |
5,003 | I have noticed that there are a few popular printings of the *Mishna B'rura* that come with footnote references to the *Chazon Ish* on each *halacha* where the two disagree ([example](https://tablet.otzar.org/he/book/book.php?book=200338)).
I have also noticed a couple popular editions of the *Aruch Hashulchan* in whi... | 2010/12/31 | [
"https://judaism.stackexchange.com/questions/5003",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | I always assumed the motivation was to provide information from a diversity of posekim, when they differ on something, so that readers will be aware that there are varying opinions/traditions.
An extreme version of this is an [edition](http://www.mysefer.com/product.asp?P_ID=1389&strPageHistory=related) of [Kitzur Shu... | Speaking only of the various printings of the Kitzur Shulchan Aruch, the reason why it is usually printed with footnotes is because those footnotes are intended to tell us about other poskim we usually hold like (in preference to the Kitzur Shulchan Aruch).
The Kitzur Shulchan Aruch is so prevalant because it's a conv... |
70,137,726 | I have a local network behind a router, so addresses are like 192.168.1.xxx. I need php to get files from other systems in that network. Looked into php ssh but (1) it's way beyond my skill level and (2) ssh\_connect is not available on my installation. I can do it with command line scp, but not php. Is there something... | 2021/11/27 | [
"https://Stackoverflow.com/questions/70137726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8222957/"
] | First i though that you can use PHP Functions: `shell_exec()`
`shell_exec('/path/to/ssh root@192.162.0.5 /home/yourdirectory/scripts/StartTest.sh');`
<https://www.php.net/manual/de/function.shell-exec.php>
**Update**
You can use this lib: <https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Net/SSH2.php>
<h... | you can try `exec()`/ `shell_exec` to execute shell script
<https://www.php.net/manual/en/function.exec.php>
<https://www.php.net/manual/en/function.shell-exec.php> |
26,362,840 | I created a php code to seek informations on database (mySQL) and "transform" to JSON.
The JSON output seems to be correct, but when use some validator, alway returns error: `Unexpected token`.
If I manually type the JSON output on validator, it works! If I copy and paste, exception occurs.
For verify the JSON: <htt... | 2014/10/14 | [
"https://Stackoverflow.com/questions/26362840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3825655/"
] | You have [Byte Order Marks (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark) at the beginning of your file.
You should save your script without a BOM as this causes your output to be invalid json.
If you look in your developers tools at the exact response, you will see two `` sequences at the start before the j... | Your json starts three bytes that represent the BOM for UTF-8
EF BB BF
<http://en.wikipedia.org/wiki/Byte_order_mark>
Perhaps some parsers don't like those first three bytes |
43,324,376 | i download a .apk file with DownloadManager library, and i have a BroadcastReceiver for download service. here is my code in onRecieve():
```
long id = intent.getExtras().getLong(DownloadManager.EXTRA_DOWNLOAD_ID);
DownloadManager dm = (DownloadManager)context.getSystemService(context.DOWNLOAD_SERVICE);
intent ... | 2017/04/10 | [
"https://Stackoverflow.com/questions/43324376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7135845/"
] | Most likely it's python version and aws cli version mismatch issue. Post aws cli version and python version
```
python -V
aws --version
```
Install awscli with pip only so that it gets proper python version.
```
pip install awscli
```
Ref: github.com/aws/aws-cli/issues/2403 | I have the same issue. The problem is I used the Ubuntu package manager to install the aws package. We should use this command to install the aws command:
```
pip3 install awscli --upgrade --user
```
for more information, see [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest... |
24,776,118 | I would like to use a shell script variable to add it to the xml code, but I can't find the way how to do it.
```
variable="1234"
-X '<delete_target target_id="iwantvariablehere"/>'
``` | 2014/07/16 | [
"https://Stackoverflow.com/questions/24776118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3844127/"
] | Filter methods are chainable, immutable :)
```
def search_user(name=None, number=None):
# Uncomment the following lines to return NO records when no input.
# if not name and not number:
# return UserInfo.objects.none()
qs = UserInfo.objects.all()
if name:
qs = qs.filter(name=name)
... | I would do something like that
```
if name and number:
UserInfo.object.filter(name='John',number='1234')
``` |
24,776,118 | I would like to use a shell script variable to add it to the xml code, but I can't find the way how to do it.
```
variable="1234"
-X '<delete_target target_id="iwantvariablehere"/>'
``` | 2014/07/16 | [
"https://Stackoverflow.com/questions/24776118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3844127/"
] | Q is a powerful feature in Django. see [Q class](https://docs.djangoproject.com/en/dev/ref/models/queries/)
```
from django.db.models import Q
# you cand do a lot of crazy things here
query = Q(name__iexact=name) & Q(number=number)
users = UserInfo.object.filter(query)
``` | I would do something like that
```
if name and number:
UserInfo.object.filter(name='John',number='1234')
``` |
24,776,118 | I would like to use a shell script variable to add it to the xml code, but I can't find the way how to do it.
```
variable="1234"
-X '<delete_target target_id="iwantvariablehere"/>'
``` | 2014/07/16 | [
"https://Stackoverflow.com/questions/24776118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3844127/"
] | Filter methods are chainable, immutable :)
```
def search_user(name=None, number=None):
# Uncomment the following lines to return NO records when no input.
# if not name and not number:
# return UserInfo.objects.none()
qs = UserInfo.objects.all()
if name:
qs = qs.filter(name=name)
... | The solution according to your example is...
```
MatchedUsers = UserInfo.object.filter(name='John',number='1234')
return MatchedUsers
``` |
24,776,118 | I would like to use a shell script variable to add it to the xml code, but I can't find the way how to do it.
```
variable="1234"
-X '<delete_target target_id="iwantvariablehere"/>'
``` | 2014/07/16 | [
"https://Stackoverflow.com/questions/24776118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3844127/"
] | Q is a powerful feature in Django. see [Q class](https://docs.djangoproject.com/en/dev/ref/models/queries/)
```
from django.db.models import Q
# you cand do a lot of crazy things here
query = Q(name__iexact=name) & Q(number=number)
users = UserInfo.object.filter(query)
``` | The solution according to your example is...
```
MatchedUsers = UserInfo.object.filter(name='John',number='1234')
return MatchedUsers
``` |
24,776,118 | I would like to use a shell script variable to add it to the xml code, but I can't find the way how to do it.
```
variable="1234"
-X '<delete_target target_id="iwantvariablehere"/>'
``` | 2014/07/16 | [
"https://Stackoverflow.com/questions/24776118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3844127/"
] | Filter methods are chainable, immutable :)
```
def search_user(name=None, number=None):
# Uncomment the following lines to return NO records when no input.
# if not name and not number:
# return UserInfo.objects.none()
qs = UserInfo.objects.all()
if name:
qs = qs.filter(name=name)
... | Q is a powerful feature in Django. see [Q class](https://docs.djangoproject.com/en/dev/ref/models/queries/)
```
from django.db.models import Q
# you cand do a lot of crazy things here
query = Q(name__iexact=name) & Q(number=number)
users = UserInfo.object.filter(query)
``` |
55,508,483 | I am adding a fragment in the xml file, but I was unable to find the instance of the fragment in the backstack.
Below is my xml code
```
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragOneContainer"
android:layout_width="fill_... | 2019/04/04 | [
"https://Stackoverflow.com/questions/55508483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6113287/"
] | you can try this
```
while line:
line = file_info.readline()
print(line)
department = get_department_entry(departments, line)
if department:
departments.update(department)
``` | In 'get\_department\_entry' method, you've written
```
if len(data) == 3:
```
This will always return false, as number of columns is 2. Hence, it will return None.
That's why you are getting this error.
```
TypeError: 'NoneType' object is not iterable
``` |
23,499,700 | I'm relatively new to Hudson and it's administration. The gentleman who set it up is no longer with the company.
Last night we had to restart the machine that we host Hudson on and now the Hudson service won't restart. When I try to restart the service I get the following message in my Event Viewer.
>
> Windows dete... | 2014/05/06 | [
"https://Stackoverflow.com/questions/23499700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2250803/"
] | I think should always look at the root cause of exception. In your case
```
Caused by: javax.persistence.PersistenceException:
No Persistence provider for EntityManager named k19pu at javax.persistence.Persistence.createEntityManagerFactory
```
Your `persistence.xml` is not valid that's why `EntityManagerFactory` ... | Here's the problem:
>
> 2014-05-06T12:47:53.049-0300|SEVERE: Error Rendering View[/carros.xhtml] javax.el.ELException: /carros.xhtml @24,58 rendered="#{not empty carroBean.carros}": java.lang.NullPointerException
>
>
> ...
>
>
> Caused by: java.lang.NullPointerException at br.com.k19.modelo.CarroRepository.buscaT... |
9,456 | Is there a way to detect when a minor mode is turned on. For `web-mode`, I would like to know when `indent-tabs-mode` is turned on.
Please note that what I need is to detect this when the user has begun to edit the buffer with `indent-tabs-mode` turned off and then decides to turn it on. | 2015/02/21 | [
"https://emacs.stackexchange.com/questions/9456",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/197/"
] | You can test the truth value of the variable `indent-tabs-mode`, which will be `nil` if it's off and non-`nil` if it's on.
For your specific use case, making sure it's turned on as of the first edit, you can add a little function to `first-change-hook`. From the docstring:
>
> Documentation:
> A list of functions t... | From the emacs manual's section on minor modes:
>
> Most minor modes also have a "mode variable", with the same name as
> the mode command. Its value is non-`nil` if the mode is enabled, and
> `nil` if it is disabled.
>
>
>
For example, associated to `abbrev-mode`, the function and minor mode, there is the vari... |
9,456 | Is there a way to detect when a minor mode is turned on. For `web-mode`, I would like to know when `indent-tabs-mode` is turned on.
Please note that what I need is to detect this when the user has begun to edit the buffer with `indent-tabs-mode` turned off and then decides to turn it on. | 2015/02/21 | [
"https://emacs.stackexchange.com/questions/9456",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/197/"
] | If you want to respect the user's indentation choice (as you should), the right way is to just do the right thing when indenting, you don't need to keep track if the variable was changed.
Your two options are:
* Instead of manually removing/inserting whitespace at beginning-of-line, just use either `indent-to` or `in... | From the emacs manual's section on minor modes:
>
> Most minor modes also have a "mode variable", with the same name as
> the mode command. Its value is non-`nil` if the mode is enabled, and
> `nil` if it is disabled.
>
>
>
For example, associated to `abbrev-mode`, the function and minor mode, there is the vari... |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | How can the compiler be sure that you aren't going to recursively call main()? | It's all about the C-standard.
Nothing forbids you from exiting main at some time. You may not do it in your program, but others may do it.
Furthermore you can register cleanup-handlers via the `atexit` runtime function. These functions need a defined register state to execute properly, and the only way to guarantee... |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | Most likely main is just compiled in the same was as a standard function. In C it pretty much needs to be because you might call it from somewhere.
Note that in C++ it's illegal to call main recursively so a c++ compiler might be able to optimize this more. But in C as your question stated it's legal (if a bad idea) t... | It's all about the C-standard.
Nothing forbids you from exiting main at some time. You may not do it in your program, but others may do it.
Furthermore you can register cleanup-handlers via the `atexit` runtime function. These functions need a defined register state to execute properly, and the only way to guarantee... |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | It's all about the C-standard.
Nothing forbids you from exiting main at some time. You may not do it in your program, but others may do it.
Furthermore you can register cleanup-handlers via the `atexit` runtime function. These functions need a defined register state to execute properly, and the only way to guarantee... | >
> How can this state saving be prevented?
>
>
>
The only thing you can do is to write you own C-Startup routine. That means messing with assembler, but you can then JUMP to your main() instead of just CALLing it. |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | It's all about the C-standard.
Nothing forbids you from exiting main at some time. You may not do it in your program, but others may do it.
Furthermore you can register cleanup-handlers via the `atexit` runtime function. These functions need a defined register state to execute properly, and the only way to guarantee... | In my tests with avr-gcc 4.3.5, it only saves registers if not optimizing much. Normal levels (-Os or -O2) cause the push instructions to be optimized away.
One can further specify in a function declaration that it will not return with `__attribute__((noreturn))`. It is also useful to do full program optimization with... |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | How can the compiler be sure that you aren't going to recursively call main()? | >
> How can this state saving be prevented?
>
>
>
The only thing you can do is to write you own C-Startup routine. That means messing with assembler, but you can then JUMP to your main() instead of just CALLing it. |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | How can the compiler be sure that you aren't going to recursively call main()? | In my tests with avr-gcc 4.3.5, it only saves registers if not optimizing much. Normal levels (-Os or -O2) cause the push instructions to be optimized away.
One can further specify in a function declaration that it will not return with `__attribute__((noreturn))`. It is also useful to do full program optimization with... |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | Most likely main is just compiled in the same was as a standard function. In C it pretty much needs to be because you might call it from somewhere.
Note that in C++ it's illegal to call main recursively so a c++ compiler might be able to optimize this more. But in C as your question stated it's legal (if a bad idea) t... | >
> How can this state saving be prevented?
>
>
>
The only thing you can do is to write you own C-Startup routine. That means messing with assembler, but you can then JUMP to your main() instead of just CALLing it. |
3,250,190 | The main() function in an avr-gcc program saves the register state on the stack, but when the runtime calls it I understand on a microcontroller there isn't anything to return to. Is this a waste of RAM? How can this state saving be prevented? | 2010/07/14 | [
"https://Stackoverflow.com/questions/3250190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/36330/"
] | Most likely main is just compiled in the same was as a standard function. In C it pretty much needs to be because you might call it from somewhere.
Note that in C++ it's illegal to call main recursively so a c++ compiler might be able to optimize this more. But in C as your question stated it's legal (if a bad idea) t... | In my tests with avr-gcc 4.3.5, it only saves registers if not optimizing much. Normal levels (-Os or -O2) cause the push instructions to be optimized away.
One can further specify in a function declaration that it will not return with `__attribute__((noreturn))`. It is also useful to do full program optimization with... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.