qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
48,967,030 | I have a custom Navigation Bar that I am setting up for my ViewController. The problem is that the Navigation Bar is too small and I am unable to change the height of it.
```
class AddGameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.lightGre... | 2018/02/24 | [
"https://Stackoverflow.com/questions/48967030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6837907/"
] | ```
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.lightGray
self.setNavigationBar()
}
func setNavigationBar() {
let navBar = UINavigationBar()
navBar.translatesAutoresizingMaskIntoConstrai... | The Navigation Bar has a fixed height. It seems that you placed it on top of the Status Bar. Try pinning the top of the Navigation Bar to the Bottom of the Status Bar with constraints. |
4,999,946 | I am creating a calendar based app.
I have two dates say present date, and future date(due date), now i need to show the difference between these two dates in terms of days, hours, minutes & seconds and i want to show a timer which will continues to decrement second by second as the time increases and ultimately reach... | 2011/02/15 | [
"https://Stackoverflow.com/questions/4999946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/475349/"
] | Maybe It can be helpful to you - <http://blog.webscale.co.in/?p=244> | Basically you want to use `NSTimeInterval` and `NSDate` to calculate the difference in time. For example:
```
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"MM/dd/yyyy"];
NSDate *now = [NSDate date];
NSDate *futureDate = [dateFormat dateFromString:@"07/15/2015"];
// Now we ... |
57,259,941 | I am trying to iterate the subfolders and subfolders of the folders. E.g. Inbox has five subfolders so I am trying to iterate all five. But I am able to iterate only the first subfolder.
```
Outlook.MAPIFolder inboxFolder =
ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Stores stores = ns.Sto... | 2019/07/29 | [
"https://Stackoverflow.com/questions/57259941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11853852/"
] | The code that processes the folder must call itself recursively
```
foreach(Store store in stores)
{
Outlook.MAPIFolder inbox_folder =
store.GetDefaultFolder(outlook.olDefaultFolders.olFolderInbox);
ProcessFolder(inbox_folder);
}
...
private void ProcessFolder(MAPIFolder folder)
... | As Dmitry noted, you need to use recursion to be able to enumerate all folders. Read more about that in the [Enumerate folders](http://Enumerate%20folders) article. For example:
```
private void EnumerateFoldersInDefaultStore()
{
Outlook.Folder root =
Application.Session.
DefaultStore.GetRootFolder... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | this is a little extended, however I thought it might be useful to smb. I have an m3u playlist and need only particular rows filtered, sorted and printed. Credits go to Devil:
```
<?php
//specify that the variable is of type array
$masiv = array();
//read the file
$file = '/home/zlobi/radio/pls/all.m3u';
$f = fop... | Once you are done reading the file into the array by a call to [file](http://php.net/manual/en/function.file.php). You can open the file for writing by using the [fopen](http://php.net/manual/en/function.fopen.php) function, write into the file using the [fwrite](http://php.net/manual/en/function.fwrite.php) and close ... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | Try using fopen and fwrite.
```
$fileWrite = fopen("filePah", "w");
for($i=0; $i<count($file); $i++)
{
fWrite($fileWrite, $file[i]);
}
fClose($fileWrite);
``` | Open the file, write to it, close it (this assumes $file is the variable from your code):
```
$fp = fopen('states.txt', 'w');
for($i=0; $i<count($file); $i++)
fwrite($fp, $file[$i]);
}
fclose($fp);
```
And see <http://php.net/manual/en/function.fwrite.php> |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | Try using fopen and fwrite.
```
$fileWrite = fopen("filePah", "w");
for($i=0; $i<count($file); $i++)
{
fWrite($fileWrite, $file[i]);
}
fClose($fileWrite);
``` | Once you are done reading the file into the array by a call to [file](http://php.net/manual/en/function.file.php). You can open the file for writing by using the [fopen](http://php.net/manual/en/function.fopen.php) function, write into the file using the [fwrite](http://php.net/manual/en/function.fwrite.php) and close ... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | ```
<?php
$file = file("states.txt");
sort($file);
$newContent = "";
for($i=0; $i<count($file); $i++)
{
$states = explode(",", $file[$i]);
$newContent .= $states[0] .', '. $states[1] . PHP_EOL;
}
file_put_contents('states.txt',$newContent);
?>
```
[PHP: file\_put\_contents](http://php.net/manual/en/function.file... | Once you are done reading the file into the array by a call to [file](http://php.net/manual/en/function.file.php). You can open the file for writing by using the [fopen](http://php.net/manual/en/function.fopen.php) function, write into the file using the [fwrite](http://php.net/manual/en/function.fwrite.php) and close ... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | Try something like this:
```
$fo = fopen("filename", "w");
$content = "";
for ($i = 0; $i < count($file); $i++) {
$states = explode(",", $file[$i]);
$content .= $states[0] . "," . $states[1] . "\n";
}
fwrite($fo, $content);
fclose($fo);
``` | Once you are done reading the file into the array by a call to [file](http://php.net/manual/en/function.file.php). You can open the file for writing by using the [fopen](http://php.net/manual/en/function.fopen.php) function, write into the file using the [fwrite](http://php.net/manual/en/function.fwrite.php) and close ... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | this is a little extended, however I thought it might be useful to smb. I have an m3u playlist and need only particular rows filtered, sorted and printed. Credits go to Devil:
```
<?php
//specify that the variable is of type array
$masiv = array();
//read the file
$file = '/home/zlobi/radio/pls/all.m3u';
$f = fop... | This is by far the fastest and most elegant solution that I have found, when I had the same problem.
If you're on Linux (with exec allowed in PHP configuration) you can do the following (provided you want to sort files numerically):
```
exec("sort -n " . $pathToOriginalFile . " > " . $pathToSortedFile);
```
Basicall... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | ```
<?php
$file = file("states.txt");
sort($file);
$newContent = "";
for($i=0; $i<count($file); $i++)
{
$states = explode(",", $file[$i]);
$newContent .= $states[0] .', '. $states[1] . PHP_EOL;
}
file_put_contents('states.txt',$newContent);
?>
```
[PHP: file\_put\_contents](http://php.net/manual/en/function.file... | This is by far the fastest and most elegant solution that I have found, when I had the same problem.
If you're on Linux (with exec allowed in PHP configuration) you can do the following (provided you want to sort files numerically):
```
exec("sort -n " . $pathToOriginalFile . " > " . $pathToSortedFile);
```
Basicall... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | Try something like this:
```
$fo = fopen("filename", "w");
$content = "";
for ($i = 0; $i < count($file); $i++) {
$states = explode(",", $file[$i]);
$content .= $states[0] . "," . $states[1] . "\n";
}
fwrite($fo, $content);
fclose($fo);
``` | This is by far the fastest and most elegant solution that I have found, when I had the same problem.
If you're on Linux (with exec allowed in PHP configuration) you can do the following (provided you want to sort files numerically):
```
exec("sort -n " . $pathToOriginalFile . " > " . $pathToSortedFile);
```
Basicall... |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | The easiest way to write the contents of `$file` back to the file would be using [`file_put_contents`](http://dk2.php.net/manual/en/function.file-put-contents.php) in collaboration with [`implode`](http://dk2.php.net/manual/en/function.implode.php).
```
file_put_contents("states.txt", implode($file));
``` | Try something like this:
```
$fo = fopen("filename", "w");
$content = "";
for ($i = 0; $i < count($file); $i++) {
$states = explode(",", $file[$i]);
$content .= $states[0] . "," . $states[1] . "\n";
}
fwrite($fo, $content);
fclose($fo);
``` |
2,630,380 | I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,
```
Richmond,Virginia
Seattle,Washington
Los Angeles,California
Dallas,Texas
Jacksonville,Florida
```
I wrote a code to sor... | 2010/04/13 | [
"https://Stackoverflow.com/questions/2630380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/315590/"
] | this is a little extended, however I thought it might be useful to smb. I have an m3u playlist and need only particular rows filtered, sorted and printed. Credits go to Devil:
```
<?php
//specify that the variable is of type array
$masiv = array();
//read the file
$file = '/home/zlobi/radio/pls/all.m3u';
$f = fop... | Open the file, write to it, close it (this assumes $file is the variable from your code):
```
$fp = fopen('states.txt', 'w');
for($i=0; $i<count($file); $i++)
fwrite($fp, $file[$i]);
}
fclose($fp);
```
And see <http://php.net/manual/en/function.fwrite.php> |
23,134,292 | I am going to try and explain this the best way I can. I have a table called albumAccess which has the following fields : id, albumID, userID, and permission.
Next I have another table that holds information for each album based off of the albumID.
I want to know how I can use the userID to get all of the album inf... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23134292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3108923/"
] | Its hard without a syntax to work with but i think something like this could work.
```
SELECT
tablea.*,
tableb.*
FROM albumaccess tablea
JOIN albuminfo tableb ON tablea.AlbumId=tableb.AlbumId
WHERE tablea.UserId='theuserid'
```
This will JOIN rows matching on AlbumId. | I think this is what you looking for.
SELECT \* FROM `users` u, `albuminfos` ai, `albumaccesses` aa WHERE aa.user\_id=u.id |
23,134,292 | I am going to try and explain this the best way I can. I have a table called albumAccess which has the following fields : id, albumID, userID, and permission.
Next I have another table that holds information for each album based off of the albumID.
I want to know how I can use the userID to get all of the album inf... | 2014/04/17 | [
"https://Stackoverflow.com/questions/23134292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3108923/"
] | I am taking the another table name as albumDetails that holds information for each album based off of the albumID.
```
select albumAccess.*, albumDetails.* from albumAccess, albumDetails where
albumAccess.albumID=albumDetails.albumID and
albumAccess.userID=YOUR_REQUIRED_USER_ID
``` | I think this is what you looking for.
SELECT \* FROM `users` u, `albuminfos` ai, `albumaccesses` aa WHERE aa.user\_id=u.id |
21,778,327 | I'd like to format numbers into the numbers next to them with k, lacs, crores in jQuery:
1000 to 1K
1500 to 1.5K
100000 to 1Lac
150000 to 1.5Lac
1000000 to 10Lac
10000000 to 1cr and so on !
```
<!DOCTYPE html>
<html>
<head>
<title>Number Differentiation</title>
<script src="http://ajax.googleapis.com/aja... | 2014/02/14 | [
"https://Stackoverflow.com/questions/21778327",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3310021/"
] | This should do it:
```
function numDifferentiation(val) {
if(val >= 10000000) val = (val/10000000).toFixed(2) + ' Cr';
else if(val >= 100000) val = (val/100000).toFixed(2) + ' Lac';
else if(val >= 1000) val = (val/1000).toFixed(2) + ' K';
return val;
}
``` | You can also use the js inbuilt Intl library
```js
const formatter = new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR',
minimumFractionDigits: 0,
maximumFractionDigits: 2,
notation: 'compact',
compactDisplay: 'long',
})
```
and use it like
```js
const value = 200000
formatter.format(va... |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | You need to update calligraphy version and change code according to new version
You need to change repository in dependencies from
```
implementation "uk.co.chrisjenx:calligraphy:$caligraphyVersion"
```
to
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.... | Migrate from [chrisjenx/Calligraphy](https://github.com/chrisjenx/Calligraphy)
to [InflationX/Calligraphy](https://github.com/InflationX/Calligraphy)
and update `Calligraphy` to newest version |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | Update `Calligraphy` to newest version to solve this problem:
Link: <https://github.com/InflationX/Calligraphy/issues/35>
More specifically, both Calligraphy **and** ViewPump need to be updated:
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
```
Mig... | You can change buildTools version and sdk version from 29 to 28
```
targetSdk = 28
compileSdk = 28
buildTools = '28.0.3'
``` |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | if you are using calligraphy so you should migrate to calligraphy3 :
<https://github.com/InflationX/Calligraphy>
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
``` | Update your **calligraphy** import in your **build.gradle(:app)** file with this **below**
implementation 'io.github.inflationx:viewpump:2.0.3'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
and use **ViewPumpContextWrapper** instead of **CalligraphyContextWrapper** |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | Definitively your problem is the Calligraphy library, I've got the same problem and there are 2 ways to solve it:
1. Go back to target version 28, and wait a possible update of the
Calligraphy library. 2
2. Remove the library
**About the exception:**
The exception error in Calligraphy comes from the use of the refle... | Update your **calligraphy** import in your **build.gradle(:app)** file with this **below**
implementation 'io.github.inflationx:viewpump:2.0.3'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
and use **ViewPumpContextWrapper** instead of **CalligraphyContextWrapper** |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | Definitively your problem is the Calligraphy library, I've got the same problem and there are 2 ways to solve it:
1. Go back to target version 28, and wait a possible update of the
Calligraphy library. 2
2. Remove the library
**About the exception:**
The exception error in Calligraphy comes from the use of the refle... | You can change buildTools version and sdk version from 29 to 28
```
targetSdk = 28
compileSdk = 28
buildTools = '28.0.3'
``` |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | Update `Calligraphy` to newest version to solve this problem:
Link: <https://github.com/InflationX/Calligraphy/issues/35>
More specifically, both Calligraphy **and** ViewPump need to be updated:
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
```
Mig... | You need to update calligraphy version and change code according to new version
You need to change repository in dependencies from
```
implementation "uk.co.chrisjenx:calligraphy:$caligraphyVersion"
```
to
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.... |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | ```
Please foloow this below steps.
1> First of all check build.gradle(:app) file
2> If you are using this below library:
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
3> Update this " implementation 'uk.co.chrisjenx:calligraphy:2.3.0' " library with this below library.
implementation 'io.github.inflationx:viewpu... | You can change buildTools version and sdk version from 29 to 28
```
targetSdk = 28
compileSdk = 28
buildTools = '28.0.3'
``` |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | if you are using calligraphy so you should migrate to calligraphy3 :
<https://github.com/InflationX/Calligraphy>
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
``` | Migrate from [chrisjenx/Calligraphy](https://github.com/chrisjenx/Calligraphy)
to [InflationX/Calligraphy](https://github.com/InflationX/Calligraphy)
and update `Calligraphy` to newest version |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | Update `Calligraphy` to newest version to solve this problem:
Link: <https://github.com/InflationX/Calligraphy/issues/35>
More specifically, both Calligraphy **and** ViewPump need to be updated:
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
```
Mig... | ```
Please foloow this below steps.
1> First of all check build.gradle(:app) file
2> If you are using this below library:
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
3> Update this " implementation 'uk.co.chrisjenx:calligraphy:2.3.0' " library with this below library.
implementation 'io.github.inflationx:viewpu... |
56,524,921 | If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.
How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-... | 2019/06/10 | [
"https://Stackoverflow.com/questions/56524921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3252097/"
] | You need to update calligraphy version and change code according to new version
You need to change repository in dependencies from
```
implementation "uk.co.chrisjenx:calligraphy:$caligraphyVersion"
```
to
```
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.... | Update your **calligraphy** import in your **build.gradle(:app)** file with this **below**
implementation 'io.github.inflationx:viewpump:2.0.3'
implementation 'io.github.inflationx:calligraphy3:3.1.1'
and use **ViewPumpContextWrapper** instead of **CalligraphyContextWrapper** |
4,023,794 | prove that if $R\leq S$ and $S\leq N$ then $P(N,S)$ is divisible by $P(N,R)$
Let $s = r +k$ since s is greater than r by some value but we don’t we don’t how much so I used k
$\frac{n!}{(n-(r+k))!}$/$\frac{n}{n-r}!$
$\frac{n!}{(n-r-k))!}$/$\frac{n}{n-r}!$ where you can cancel out n!
I am not getting how to solve fa... | 2021/02/13 | [
"https://math.stackexchange.com/questions/4023794",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/878401/"
] | I believe you are so close to the solution. As you suggested let
$$
s=r+k
\\n=s+m=r+k+m
$$
where $k\ge0$ and $m\ge0$. Then
$$
\frac{P(N,S)}{P(N,R)}=\frac{n!}{(n-s)!}\frac{(n-r)!}{n!}=\frac{(k+m)!}{m!}=(m+1)(m+2)...(m+k)
$$
if $k=0$, then the division becomes 1. | Start by proving that the quotient
$\frac{P(n,s)}{P(n,r)}$
is indeed an integer. |
36,688,889 | I have 3 radio buttons. I want such logic: when I push the radio button
the required action method will be called. I don't know how to do it using
JQuery. Are there any of others varients ?
```
<h3>Gender:</h3>
@Html.RadioButton("Gender", "All", true, new {id = "radioAll"})
@Html.Label("All")
<br/>
@Ht... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36688889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5798463/"
] | There are many ways to do that:
* import json if it is inside of your app: `import * as json from './test'; //will import test.json`
* download file using `Http` and do `map(res=>res.json())`
* for webpack use json-loader plugin: `var json = require('./my.json')`
* for gulp/grunt etc. you could write code generator | I stash my Mock JSON data into a ts file like a variable. i.e
```
export var getMockResponseJSON = { 'key': value };
```
Later when I want to reach this variable, I simply import it like:
```
import {getMockResponseJSON} from "../JSONs";
```
and use it in my class
```
expect(getMockResponseJSON.key).not.toEqual(... |
36,688,889 | I have 3 radio buttons. I want such logic: when I push the radio button
the required action method will be called. I don't know how to do it using
JQuery. Are there any of others varients ?
```
<h3>Gender:</h3>
@Html.RadioButton("Gender", "All", true, new {id = "radioAll"})
@Html.Label("All")
<br/>
@Ht... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36688889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5798463/"
] | I stash my Mock JSON data into a ts file like a variable. i.e
```
export var getMockResponseJSON = { 'key': value };
```
Later when I want to reach this variable, I simply import it like:
```
import {getMockResponseJSON} from "../JSONs";
```
and use it in my class
```
expect(getMockResponseJSON.key).not.toEqual(... | You could leverage the `Http` class of Angular2 within your tests to do that.
Here is a sample within a `beforeAll` function:
```
beforeAll((done) => {
let injector = Injector.resolveAndCreate([ HTTP_PROVIDERS ]);
let http = injector.get(Http);
http.get('app/data.json').subscribe(
(data) => {
this.dat... |
36,688,889 | I have 3 radio buttons. I want such logic: when I push the radio button
the required action method will be called. I don't know how to do it using
JQuery. Are there any of others varients ?
```
<h3>Gender:</h3>
@Html.RadioButton("Gender", "All", true, new {id = "radioAll"})
@Html.Label("All")
<br/>
@Ht... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36688889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5798463/"
] | There are many ways to do that:
* import json if it is inside of your app: `import * as json from './test'; //will import test.json`
* download file using `Http` and do `map(res=>res.json())`
* for webpack use json-loader plugin: `var json = require('./my.json')`
* for gulp/grunt etc. you could write code generator | You could leverage the `Http` class of Angular2 within your tests to do that.
Here is a sample within a `beforeAll` function:
```
beforeAll((done) => {
let injector = Injector.resolveAndCreate([ HTTP_PROVIDERS ]);
let http = injector.get(Http);
http.get('app/data.json').subscribe(
(data) => {
this.dat... |
22,040,878 | ```
1.824999999999999.round(2)
# => 1.82
1.82499999999999999.round(2)
# => 1.83
```
I don't understand why the result in the first case is `1.82` and for the latter `1.83`. My desired result is `1.82` for both cases. | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2779926/"
] | As is well known, a floating number in computer has errors. Notice that both numbers that you have are close to `1.825`. In your first case, the number is small enough to be differentiated from `1.825`.
```
1.824999999999999
# => 1.824999999999999
```
In your second case, having enough `9`s makes the value close eno... | After a certain number of (binary) digits, Ruby cannot represent differences between `Float` literals, even if you've entered the value directly in source code or the console
```
1.82499999999999999 == 1.825
# => true
```
If you *really* need a high level of precision, then you could look at the `BigDecimal` class... |
22,040,878 | ```
1.824999999999999.round(2)
# => 1.82
1.82499999999999999.round(2)
# => 1.83
```
I don't understand why the result in the first case is `1.82` and for the latter `1.83`. My desired result is `1.82` for both cases. | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2779926/"
] | As is well known, a floating number in computer has errors. Notice that both numbers that you have are close to `1.825`. In your first case, the number is small enough to be differentiated from `1.825`.
```
1.824999999999999
# => 1.824999999999999
```
In your second case, having enough `9`s makes the value close eno... | Floats are notoriously imprecise as sawa and Neil have pointed out.
If this is mainly an issue for testing, you can use [assert\_in\_delta](http://apidock.com/ruby/MiniTest/Assertions/assert_in_delta) if you're using minitest, or [be\_within](https://www.relishapp.com/rspec/rspec-expectations/v/2-3/docs/built-in-match... |
22,040,878 | ```
1.824999999999999.round(2)
# => 1.82
1.82499999999999999.round(2)
# => 1.83
```
I don't understand why the result in the first case is `1.82` and for the latter `1.83`. My desired result is `1.82` for both cases. | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2779926/"
] | As is well known, a floating number in computer has errors. Notice that both numbers that you have are close to `1.825`. In your first case, the number is small enough to be differentiated from `1.825`.
```
1.824999999999999
# => 1.824999999999999
```
In your second case, having enough `9`s makes the value close eno... | In addition to the many excellent explanations here, I'd like to give an example using `BigDecimal`
```
o = BigDecimal.new('1.82499999999999999', 17)
2.0.0p247 :011 > o.round(2).to_f
=> 1.82
```
Also notice that `#round` takes various modes for rounding, as per the docs.
Ref:
1. <http://www.ruby-doc.org/stdlib-2.... |
29,922,150 | Is there a way in Openlayers 3 to get the map that is attached to a specific html element?
Something like:
```
var map = new ol.Map({
view: new ol.View({
center: [0, 0],
zoom: 1
}),
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
})
],
target: 'map'
});
//... | 2015/04/28 | [
"https://Stackoverflow.com/questions/29922150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716082/"
] | The map object has a reference to the HTML element but the HTML element does not have a reference to the map object. The HTML element does not know about the map object at all.
If you use jQuery you could possibly store a reference to the map in the jQuery object using the [data method](https://api.jquery.com/data/).... | For clarity, here is another example demonstrating erilem's answer with a map var and map div that are not named 'map'.
```
mapElement = '#mapDiv'
mymap = new ol.Map({
target: mapDiv,
view: new ol.View({
...
})
});
$(mapElement).data('map', mymap);
```
Then you can reference that map with jquery ... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Maybe it's just me, but I *like* when a blog has a tag cloud. It lets me see at a glance what kinds of things the author talks about, and gives me a really easy way to browse the content that I'm interested in. I also like the archive links, if I've just discovered a blog that's been around for a while and I want to go... | If you think of sidebars in the case of blogs, it's a good guess the majority are set up by people who are not strong on UI, UX or usability. Often, they want everything they are linking to visible all the time or they simply do not know how to add context to their sidebar implementation.
With a platform like Wordpres... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Maybe it's just me, but I *like* when a blog has a tag cloud. It lets me see at a glance what kinds of things the author talks about, and gives me a really easy way to browse the content that I'm interested in. I also like the archive links, if I've just discovered a blog that's been around for a while and I want to go... | I'd say that the cleaner the side bar is - the better.
My personal preference is to have there some info about the blog or the blogger, plus maybe a blog roll, which most people expect in the side bar.
I think tag clouds are usually useless and I'll explain:
* The context is too wide (the whole blog). It's much mor... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | I never use the tags cloud. Vote up if you do not use them as well ;-) | Maybe it's just me, but I *like* when a blog has a tag cloud. It lets me see at a glance what kinds of things the author talks about, and gives me a really easy way to browse the content that I'm interested in. I also like the archive links, if I've just discovered a blog that's been around for a while and I want to go... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Be careful about what you put in the sidebar. Most often people just throw stuff in there that they are used to seeing. Drop the archive links (who browses by date?), especially if it's a calendar, drop the tag cloud, etc.
Put things that people are likely to click on, a list of recent posts, if they liked your post, ... | If you think of sidebars in the case of blogs, it's a good guess the majority are set up by people who are not strong on UI, UX or usability. Often, they want everything they are linking to visible all the time or they simply do not know how to add context to their sidebar implementation.
With a platform like Wordpres... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | +1 to the points about making it context sensitive.
+1 to the idea that tag clouds are a bad idea - they just aren't very meaningful.
A further point is to avoid using graphical banners, as many users confuse these with ads and will reflexively avoid them. | If you think of sidebars in the case of blogs, it's a good guess the majority are set up by people who are not strong on UI, UX or usability. Often, they want everything they are linking to visible all the time or they simply do not know how to add context to their sidebar implementation.
With a platform like Wordpres... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Sidebars are great! you just have to use the right widgets.
I use sidebars for sub navigation, or to promote certain pages on a site, or to promote an activity (like register here, or buy now).
Many people use ready made templates and don't know how to setup the sidebar widgets, but those who do get a lot of use out ... | Avoid using chat boxes on the sidebar of your blogs. An example is the Cbox, etc. This will only take away comments on your blog posts and is a magnet for spam messages. |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Sidebars are great! you just have to use the right widgets.
I use sidebars for sub navigation, or to promote certain pages on a site, or to promote an activity (like register here, or buy now).
Many people use ready made templates and don't know how to setup the sidebar widgets, but those who do get a lot of use out ... | +1 to the points about making it context sensitive.
+1 to the idea that tag clouds are a bad idea - they just aren't very meaningful.
A further point is to avoid using graphical banners, as many users confuse these with ads and will reflexively avoid them. |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | I never use the tags cloud. Vote up if you do not use them as well ;-) | I'd say that the cleaner the side bar is - the better.
My personal preference is to have there some info about the blog or the blogger, plus maybe a blog roll, which most people expect in the side bar.
I think tag clouds are usually useless and I'll explain:
* The context is too wide (the whole blog). It's much mor... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | Be careful about what you put in the sidebar. Most often people just throw stuff in there that they are used to seeing. Drop the archive links (who browses by date?), especially if it's a calendar, drop the tag cloud, etc.
Put things that people are likely to click on, a list of recent posts, if they liked your post, ... | I'd say that the cleaner the side bar is - the better.
My personal preference is to have there some info about the blog or the blogger, plus maybe a blog roll, which most people expect in the side bar.
I think tag clouds are usually useless and I'll explain:
* The context is too wide (the whole blog). It's much mor... |
188 | I see a lot of blogs that seem to have really cluttered sidebars, with a ton of additional widgets, navigation, etc, that I never find myself using. What are some tips for things that make good additions to the sidebar, and some things that are unnecessary?
One example that springs to mind are Tag Clouds. I see these... | 2010/08/10 | [
"https://ux.stackexchange.com/questions/188",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/72/"
] | I never use the tags cloud. Vote up if you do not use them as well ;-) | +1 to the points about making it context sensitive.
+1 to the idea that tag clouds are a bad idea - they just aren't very meaningful.
A further point is to avoid using graphical banners, as many users confuse these with ads and will reflexively avoid them. |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | Your proposal *in Kürze* would likely be understood, but is mainly used for an event to happen shortly:
>
> Hier eröffnet in Kürze eine Filiale von xxx. (here opens an outlet of xxx soon.)
>
>
>
My proposal is:
>
> kurz und knapp
>
>
>
I had assumed it is a standing phrase, but Google hits are not so convin... | It is "kurz gesagt". There is a well known YouTube Channel named *Kurzgesagt* or "in a nutshell". Check it out [here](http://youtube.com/kurzgesagt) |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | **In Kurzform.**
This is in my opinion the best translation. Google hits like [*Unsere Forderungen in Kurzform*](https://artenvielfalt-brandenburg.de/wp-content/uploads/2019/04/Infoblatt-2_Forderungen-in-Kurzform.pdf) or Bad Kissingens [*Geschichte in Kurzform*](https://www.badkissingen.de/stadt/geschichtliches/geschi... | The Latin "in nuce" is sometimes used in German, but it's a lot more highbrow than "in a nutshell". |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | Posible translations for »in a nutshell« are:
>
> in (aller) Kürze
>
> zusammengefasst
>
> kurz gefasst
>
> kurz und bündig
>
> (plus a few more)
>
>
>
There is no term containing the German word »Nussschale« that has the meaning of »in a nutshell«.
But there is the German term »**in einer Nusssch... | My first thought was Stephen Hawking's book *The Universe In A Nutshell* and how the title there was translated to German. In German, the book is called: [*Das Universum in der Nussschale*](https://de.wikipedia.org/wiki/Das_Universum_in_der_Nussschale), however, the title has two meanings:
>
> Der englische Titel The... |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | Posible translations for »in a nutshell« are:
>
> in (aller) Kürze
>
> zusammengefasst
>
> kurz gefasst
>
> kurz und bündig
>
> (plus a few more)
>
>
>
There is no term containing the German word »Nussschale« that has the meaning of »in a nutshell«.
But there is the German term »**in einer Nusssch... | It is "kurz gesagt". There is a well known YouTube Channel named *Kurzgesagt* or "in a nutshell". Check it out [here](http://youtube.com/kurzgesagt) |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | Your proposal *in Kürze* would likely be understood, but is mainly used for an event to happen shortly:
>
> Hier eröffnet in Kürze eine Filiale von xxx. (here opens an outlet of xxx soon.)
>
>
>
My proposal is:
>
> kurz und knapp
>
>
>
I had assumed it is a standing phrase, but Google hits are not so convin... | It depends on how you use it.
But I want to add an other option to the already given answers.
>
> kompakt
>
>
>
It is often used for book titels.
**For example:**
>
> Java in a nutshell
>
>
>
**could be translated to:**
>
> Java kompakt
>
>
>
Because it is shorter than the other words, I would assume... |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | **In Kurzform.**
This is in my opinion the best translation. Google hits like [*Unsere Forderungen in Kurzform*](https://artenvielfalt-brandenburg.de/wp-content/uploads/2019/04/Infoblatt-2_Forderungen-in-Kurzform.pdf) or Bad Kissingens [*Geschichte in Kurzform*](https://www.badkissingen.de/stadt/geschichtliches/geschi... | >
> kurzum (in short)
>
>
> bis zu dem Punkt kommen (to come to the point)
>
>
> im Umriss (in outline)
>
>
>
I gave an English translation in the bracket |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | My first thought was Stephen Hawking's book *The Universe In A Nutshell* and how the title there was translated to German. In German, the book is called: [*Das Universum in der Nussschale*](https://de.wikipedia.org/wiki/Das_Universum_in_der_Nussschale), however, the title has two meanings:
>
> Der englische Titel The... | The Latin "in nuce" is sometimes used in German, but it's a lot more highbrow than "in a nutshell". |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | **In Kurzform.**
This is in my opinion the best translation. Google hits like [*Unsere Forderungen in Kurzform*](https://artenvielfalt-brandenburg.de/wp-content/uploads/2019/04/Infoblatt-2_Forderungen-in-Kurzform.pdf) or Bad Kissingens [*Geschichte in Kurzform*](https://www.badkissingen.de/stadt/geschichtliches/geschi... | It is "kurz gesagt". There is a well known YouTube Channel named *Kurzgesagt* or "in a nutshell". Check it out [here](http://youtube.com/kurzgesagt) |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | My first thought was Stephen Hawking's book *The Universe In A Nutshell* and how the title there was translated to German. In German, the book is called: [*Das Universum in der Nussschale*](https://de.wikipedia.org/wiki/Das_Universum_in_der_Nussschale), however, the title has two meanings:
>
> Der englische Titel The... | It depends on how you use it.
But I want to add an other option to the already given answers.
>
> kompakt
>
>
>
It is often used for book titels.
**For example:**
>
> Java in a nutshell
>
>
>
**could be translated to:**
>
> Java kompakt
>
>
>
Because it is shorter than the other words, I would assume... |
27,001 | The closest I was able to find is ***in Kürze***.
Is there a translation that means something similar as it does in English? | 2015/12/07 | [
"https://german.stackexchange.com/questions/27001",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/19134/"
] | It is "kurz gesagt". There is a well known YouTube Channel named *Kurzgesagt* or "in a nutshell". Check it out [here](http://youtube.com/kurzgesagt) | >
> kurzum (in short)
>
>
> bis zu dem Punkt kommen (to come to the point)
>
>
> im Umriss (in outline)
>
>
>
I gave an English translation in the bracket |
7,156,907 | Not sure what's wrong. I've tried removing the space between the < and % but the app wouldn't run.
```
< % if logged_in? %>
Welcome < %= current_user.username %>! Not you?
< %= link_to "Log out", logout_path %>
< % else %>
< %= link_to "Sign up", signup_path %> or
< %= link_to "log in", login_path %>... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7156907",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/899276/"
] | Did you mean :
```
<% if current_user.logged_in? %>
```
Your current piece of code will try to use the logged\_in? helper wich i guess is not what you want. | If you are using the "restful\_authentication", trying adding `include AuthenticatedSystem` like below
```
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
include AuthenticatedSystem
.....
```
`logged_in?` is a prot... |
3,984 | The author of [this answer](https://aviation.stackexchange.com/questions/72101/why-was-the-dispatch-reliability-of-the-a320-low-during-its-first-years/72108#72108) wrote "despatch" instead of "dispatch" several times, which is (being a non-native English speaker myself) an understandable mistake. It was corrected in an... | 2019/12/01 | [
"https://aviation.meta.stackexchange.com/questions/3984",
"https://aviation.meta.stackexchange.com",
"https://aviation.meta.stackexchange.com/users/33692/"
] | When I made the edit I didn't realize (until *now*) that [despatch](https://en.wiktionary.org/wiki/despatch) is an alternative spelling.
So in this case, let it go.
In other cases, where there would be a wrong spelling, I have no idea! I couldn't find an answer on MSE.
---
Side note: [tags are to be in American Eng... | No comment on the right/wrong spelling, but to avoid a continual edit war flag the answer for mod attention with a custom message describing the problem, and if need be, we will lock the answer to stop further edits. |
42,274,151 | I have the following two dataframes in R:
```
df1 = data.frame(c("A", "A", "A", "B", "B"), c(1, 11, 21, 35, 45), c(6, 20, 30, 40, 60), c(1, 2, 3, 4, 5))
colnames(df1) = c("X", "Y", "Z", "score")
df1
X Y Z score
1 A 1 6 1
2 A 11 20 2
3 A 21 30 3
4 B 35 40 4
5 B 45 60 5
df2 = data.frame(c("A... | 2017/02/16 | [
"https://Stackoverflow.com/questions/42274151",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1987607/"
] | ```
library(dplyr)
df1 = data.frame(c("A", "A", "A", "B", "B"), c(1, 11, 21, 35, 45),
c(6, 20, 30, 40, 60), c(1, 2, 3, 4, 5), stringsAsFactors = F)
colnames(df1) = c("X", "Y", "Z", "score")
df2 = data.frame(c("A", "A", "A", "A", "B", "B", "B", "C"), c(1, 6, 21, 50, 20, 31, 50, 10),
... | Here is another options using `sqldf`
```
library(sqldf)
xx=sqldf('select t1.*,t2.out from df1 t1 left join df2 t2 on t1.X=t2.X and ((t2.Y between t1.Y and t1.Z) or (t2.Z between t1.Y and t1.Z))')
aggregate(xx[ncol(xx)], xx[-ncol(xx)], FUN = function(X) paste(unique(X), collapse=", "))
``` |
42,274,151 | I have the following two dataframes in R:
```
df1 = data.frame(c("A", "A", "A", "B", "B"), c(1, 11, 21, 35, 45), c(6, 20, 30, 40, 60), c(1, 2, 3, 4, 5))
colnames(df1) = c("X", "Y", "Z", "score")
df1
X Y Z score
1 A 1 6 1
2 A 11 20 2
3 A 21 30 3
4 B 35 40 4
5 B 45 60 5
df2 = data.frame(c("A... | 2017/02/16 | [
"https://Stackoverflow.com/questions/42274151",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1987607/"
] | Here are two possible ways, a) using the newly implemented *non equi* joins feature, and b) `foverlaps` as you'd specifically mentioned that..
a) non-equi joins
```
dt2[dt1, on=.(X, Z>=Y, Y<=Z),
.(score, out=paste(out, collapse=",")),
by=.EACHI]
```
where `dt1` and `dt2` are data.tables corresponding to... | Here is another options using `sqldf`
```
library(sqldf)
xx=sqldf('select t1.*,t2.out from df1 t1 left join df2 t2 on t1.X=t2.X and ((t2.Y between t1.Y and t1.Z) or (t2.Z between t1.Y and t1.Z))')
aggregate(xx[ncol(xx)], xx[-ncol(xx)], FUN = function(X) paste(unique(X), collapse=", "))
``` |
14,898 | I am a Dutch citizen moving from the United Kingdom to Germany. I have received a conditional employment offer. My next employer has asked me to submit my *Lohnsteuerklasse und Steuer-Identifikationsnummer* (salary tax classification and tax identification number) at least one month prior to my start of employment. I u... | 2018/10/22 | [
"https://expatriates.stackexchange.com/questions/14898",
"https://expatriates.stackexchange.com",
"https://expatriates.stackexchange.com/users/6/"
] | Your employer is making an unreasonable request. Either they have no idea how things are working in their country or they don't care.
The very first thing you need is an *Arbeitsvertrag*. You don't need a German tax registration or *Anmeldung* to get an *Arbeitsvertrag*.
Once you have an *Arbeitsvertrag* you can star... | Since there are, I believe, people living in neighbouring countries and working in Germany, you should probably be able to register with the Finanzamt using your UK address. |
27,727,394 | Consider this.
```
Var1= "Var2"
Var2= 100
```
I need to create a program that could act somewhat like this:
```
Echo $Var1 (result: Var2)
Echo ($Var1) (result: 100)
```
Is it possible in PHP? | 2015/01/01 | [
"https://Stackoverflow.com/questions/27727394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4263870/"
] | ```
<?php
$Var1 = "Var2";
$Var2 = 100;
echo $$Var1;
// result output: "100"
``` | Variable variables:
```
echo $$Var1;
```
You can do some weird stuff in PHP:
```
$one = 'anythingHere321';
$two = 'anything';
$three = 'here';
$anythingHere321 = 'It Works!';
echo $$one, '<br>';
echo ${$one}, '<br>';
echo ${$two . ucfirst($three) . (300 + 21)}, '<br>';
```
Basically, you can put pretty much any... |
456,909 | Running
```
$ mpd
```
I am prompted with
>
> socket: Failed to bind to '127.0.0.1:6600': Address already in use
>
>
>
But if I run:
```
$ sudo service mpd start
```
and check its status, I get
>
> systemd[1]: Started Music Player Daemon.
>
>
>
Note that in what is to come, assume that:
```
$ sudo s... | 2018/07/18 | [
"https://unix.stackexchange.com/questions/456909",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/289377/"
] | It looks like you are using Systemd
As [mentioned in the comments](https://unix.stackexchange.com/questions/456909/socket-already-in-use-but-is-not-listed-mpd#comment830215_456909) you also need to stop the socket
```bsh
sudo systemctl stop mpd.socket
``` | It might be a bit late but I had the same problem and setting bind\_to\_address in mpd.conf file to "0.0.0.0" seemed to fix it.
Also there is a good explanation of why that might be happening [here](https://stackoverflow.com/a/5106755/6321322) |
30,854,500 | I have a small MySQL database for an online booking calendar. Now I wanted to get some stats out of this calendar. I am adding to each entry in the calendar values (full paid, partly paid and a status (paid, unpaid, reserved, etc)).
I have attached an image of the screenshot. As you can see, there are 4 different `cus... | 2015/06/15 | [
"https://Stackoverflow.com/questions/30854500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5012888/"
] | You need a self join so you can have both status and related full price in the same row for each entity. Basically you take a part of the table with only status data and another part of the table with only full price data and join them on the same entity id. On the resulting set you can easily get the sum while using W... | This should be
```
$result = mysql_query('SELECT SUM(attribute_value) AS value_sum
FROM custom_attribute_values
WHERE custom_attribute_id=2 AND entity_id = \'Reserviert\'');
``` |
30,854,500 | I have a small MySQL database for an online booking calendar. Now I wanted to get some stats out of this calendar. I am adding to each entry in the calendar values (full paid, partly paid and a status (paid, unpaid, reserved, etc)).
I have attached an image of the screenshot. As you can see, there are 4 different `cus... | 2015/06/15 | [
"https://Stackoverflow.com/questions/30854500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5012888/"
] | This should be
```
$result = mysql_query('SELECT SUM(attribute_value) AS value_sum
FROM custom_attribute_values
WHERE custom_attribute_id=2 AND entity_id = \'Reserviert\'');
``` | You could use a sub select to get the value like this
```
SELECT entity AS e,
(SELECT SUM(value) FROM custom_attribute_values WHERE entity = e AND attribute = 2) AS s
FROM custom_attribute_values
WHERE value = 'Reserviert'
```
Your table and column names weren't clear so I made some up...
The first SELECT picks a... |
30,854,500 | I have a small MySQL database for an online booking calendar. Now I wanted to get some stats out of this calendar. I am adding to each entry in the calendar values (full paid, partly paid and a status (paid, unpaid, reserved, etc)).
I have attached an image of the screenshot. As you can see, there are 4 different `cus... | 2015/06/15 | [
"https://Stackoverflow.com/questions/30854500",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5012888/"
] | You need a self join so you can have both status and related full price in the same row for each entity. Basically you take a part of the table with only status data and another part of the table with only full price data and join them on the same entity id. On the resulting set you can easily get the sum while using W... | You could use a sub select to get the value like this
```
SELECT entity AS e,
(SELECT SUM(value) FROM custom_attribute_values WHERE entity = e AND attribute = 2) AS s
FROM custom_attribute_values
WHERE value = 'Reserviert'
```
Your table and column names weren't clear so I made some up...
The first SELECT picks a... |
25,092,316 | ```
import java.util.Scanner;
public class TestPerson {
/**
* Creates a new instance of <code>TestPerson</code>.
*/
public TestPerson() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
... | 2014/08/02 | [
"https://Stackoverflow.com/questions/25092316",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3901490/"
] | Try this:
```
Cmember cm=null;
Vipmember vip=null;
if(sel==1){
...
cm = new Cmember(Name,Hpnum,age,CompanyName);
}
else{
...
vip = new Vipmember(Name,Hpnum,age,email);
}
if(sel==1){
r[i]=new RegMember(cm);
}
... | That is because simply compiler can't find the variable that you mention. You have declared variables in blocks. So outside the block they are not exist. You must declare your variables in appropriate places so you can access them. |
2,676,680 | I am given that
$$a \equiv 11 \pmod {19}$$
and $$ c \equiv 13a \pmod {19}$$
and I am asked to solve for a $c$ that is between $0$ and $18$ inclusive.
From looking at problems online, it seems that the easiest way to do this is as follows:
$$ c \equiv 13(11) \pmod {19}$$
$$ c \equiv 143 \pmod {19}$$
$$ 143 = 19(7) + ... | 2018/03/04 | [
"https://math.stackexchange.com/questions/2676680",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/226683/"
] | Why does your book proceed this way? That's because congruences, like equalities, are compatible with addition and multiplication, i.e.
$$a\equiv a',\quad b\equiv b'\pmod n\implies\begin{cases} a+b\equiv a'+b',\\ab\equiv a'b'\pmod n
\end{cases}$$
As to the explicit value of $c$, it is not at all obtaind by trial and er... | Modulo arithmetic is *nothing* more or less than doing arrithmetics on remainders.
And if $a$ and $11$ have the same remainder, then it *must* true that $13a$ will have the same remainder as $13\*11$.
And $143$ must have some remainder when divided by $19$. What is it?
...........
A fundamental aspect of modulo cla... |
2,676,680 | I am given that
$$a \equiv 11 \pmod {19}$$
and $$ c \equiv 13a \pmod {19}$$
and I am asked to solve for a $c$ that is between $0$ and $18$ inclusive.
From looking at problems online, it seems that the easiest way to do this is as follows:
$$ c \equiv 13(11) \pmod {19}$$
$$ c \equiv 143 \pmod {19}$$
$$ 143 = 19(7) + ... | 2018/03/04 | [
"https://math.stackexchange.com/questions/2676680",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/226683/"
] | Why does your book proceed this way? That's because congruences, like equalities, are compatible with addition and multiplication, i.e.
$$a\equiv a',\quad b\equiv b'\pmod n\implies\begin{cases} a+b\equiv a'+b',\\ab\equiv a'b'\pmod n
\end{cases}$$
As to the explicit value of $c$, it is not at all obtaind by trial and er... | $a\equiv 11\pmod{19}$ means that $19\, |\, (a-11)$.
Note that it implies $19\, |\, (a-11)13\, =13a-11\cdot13$, which translates back to $13a\equiv 11\cdot13$.
In addition, $11\cdot13= 147$ gives *remainder* $10$ when dividing by $19$, so we will have $c= 13a\equiv147\equiv10\pmod{19}$.
Also note that sometimes ca... |
2,676,680 | I am given that
$$a \equiv 11 \pmod {19}$$
and $$ c \equiv 13a \pmod {19}$$
and I am asked to solve for a $c$ that is between $0$ and $18$ inclusive.
From looking at problems online, it seems that the easiest way to do this is as follows:
$$ c \equiv 13(11) \pmod {19}$$
$$ c \equiv 143 \pmod {19}$$
$$ 143 = 19(7) + ... | 2018/03/04 | [
"https://math.stackexchange.com/questions/2676680",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/226683/"
] | Modulo arithmetic is *nothing* more or less than doing arrithmetics on remainders.
And if $a$ and $11$ have the same remainder, then it *must* true that $13a$ will have the same remainder as $13\*11$.
And $143$ must have some remainder when divided by $19$. What is it?
...........
A fundamental aspect of modulo cla... | $a\equiv 11\pmod{19}$ means that $19\, |\, (a-11)$.
Note that it implies $19\, |\, (a-11)13\, =13a-11\cdot13$, which translates back to $13a\equiv 11\cdot13$.
In addition, $11\cdot13= 147$ gives *remainder* $10$ when dividing by $19$, so we will have $c= 13a\equiv147\equiv10\pmod{19}$.
Also note that sometimes ca... |
73,258,811 | I'm currently experimenting with Parse Cloud Functions.
The following simple example already worked well:
```js
Parse.Cloud.define("hello", async (request) => {
return "Hi " + request.params.name;
});
```
---
In my apps I login as a user before making any request so I want to restrict access to this function... | 2022/08/06 | [
"https://Stackoverflow.com/questions/73258811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9077356/"
] | Your code is correct but your understanding of list operation is wrong
```
lst = [1,2,3]
print(lst.append(4)) # None as the append method will return None
print(lst) #[1, 2, 3, 4]
```
<https://docs.python.org/3/tutorial/datastructures.html>
```
a = [ [0, 1 ,-1, 2, -2, 3, -3, 4, -4, -5, 5, 8], [0, 6 ,-6, 7, -7, 8,... | You are almost there:
```
for i in a:
i.append(0) #want to add zero at the last of each sublist.
print(a)
```
The append modifies the existing list in the list, so no need to use the b variable |
73,258,811 | I'm currently experimenting with Parse Cloud Functions.
The following simple example already worked well:
```js
Parse.Cloud.define("hello", async (request) => {
return "Hi " + request.params.name;
});
```
---
In my apps I login as a user before making any request so I want to restrict access to this function... | 2022/08/06 | [
"https://Stackoverflow.com/questions/73258811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9077356/"
] | You are almost there:
```
for i in a:
i.append(0) #want to add zero at the last of each sublist.
print(a)
```
The append modifies the existing list in the list, so no need to use the b variable | ```
a = [ [0, 1 ,-1, 2, -2, 3, -3, 4, -4, -5, 5, 8], [0, 6 ,-6, 7, -7, 8, -8, 9, -9, -10, 10, 9] ]
x = list(map(lambda x: x + [0], a))
print(x)
``` |
73,258,811 | I'm currently experimenting with Parse Cloud Functions.
The following simple example already worked well:
```js
Parse.Cloud.define("hello", async (request) => {
return "Hi " + request.params.name;
});
```
---
In my apps I login as a user before making any request so I want to restrict access to this function... | 2022/08/06 | [
"https://Stackoverflow.com/questions/73258811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9077356/"
] | Your code is correct but your understanding of list operation is wrong
```
lst = [1,2,3]
print(lst.append(4)) # None as the append method will return None
print(lst) #[1, 2, 3, 4]
```
<https://docs.python.org/3/tutorial/datastructures.html>
```
a = [ [0, 1 ,-1, 2, -2, 3, -3, 4, -4, -5, 5, 8], [0, 6 ,-6, 7, -7, 8,... | ```
a = [ [0, 1 ,-1, 2, -2, 3, -3, 4, -4, -5, 5, 8], [0, 6 ,-6, 7, -7, 8, -8, 9, -9, -10, 10, 9] ]
x = list(map(lambda x: x + [0], a))
print(x)
``` |
70,697,117 | As the title suggests, I am trying to scrape a table using both Beautifulsoup and Selenium. I'm aware I most likely do not need both libraries, however I wanted to try if using Selenium's xpathselectors would help, which unfortunately they did not.
The website can be found here:
<https://app.capitoltrades.com/politic... | 2022/01/13 | [
"https://Stackoverflow.com/questions/70697117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6431344/"
] | That site has a backend api that can be hit very easily:
```
import requests
import pandas as pd
url = 'https://api.capitoltrades.com/senators/trades/491/false?pageSize=20&pageNumber=1'
resp = requests.get(url).json()
df = pd.DataFrame(resp)
df.to_csv('naughty_nancy_trades.csv',index=False)
print('Saved to naughty_n... | As per your Selenium code: you are missing a wait.
This
```
driver.find_element_by_xpath("//*[@id='pr_id_2']/div/table")
```
command returns you the web element when it is just created i.e already existing, but still not fully rendered.
This should work better:
```py
from selenium.webdriver.common.by import B... |
77,839 | In Revelation 12:12, we have this passage “Therefore rejoice, you heavens and you who dwell in them!” Heavens is the universe, so who dwells in it? Could God create other intelligent beings in our cosmos?
Also in this passage “You have made heaven, the heaven of heavens, with all their host... The host of heaven worsh... | 2022/08/06 | [
"https://hermeneutics.stackexchange.com/questions/77839",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/51354/"
] | There are numerous references to other beings "in the heavens" or outside the earth as we know it such as:
* 1 Kings 22:19 - Micaiah continued, “Therefore hear the word of the LORD: I saw the LORD sitting on His throne, and **all the host of heaven** standing by Him on His right and on His left.
* Neh 9:6 - You alone ... | In order to understand the "who", we need to look at the context to understand the "where".
First, let's look at the word "heaven(s)" in the original languages.
**Hebrew שָׁמַיִם *shamayim* ([Strong's H8064](https://biblehub.com/hebrew/8064.htm))**
Brown-Driver-Briggs defines it as:
* visible heavens, sky, where ... |
77,839 | In Revelation 12:12, we have this passage “Therefore rejoice, you heavens and you who dwell in them!” Heavens is the universe, so who dwells in it? Could God create other intelligent beings in our cosmos?
Also in this passage “You have made heaven, the heaven of heavens, with all their host... The host of heaven worsh... | 2022/08/06 | [
"https://hermeneutics.stackexchange.com/questions/77839",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/51354/"
] | In the OP, two verses are mentioned.
1. Revelation 12:12 - “Therefore rejoice, you heavens and you who dwell
in them!”
2. Nehemiah 9:6 - “You have made heaven, the heaven of heavens, with
all their host... The host of heaven worships You.”
In both of these verses there is a link between heaven and its "inhabitants", ... | In order to understand the "who", we need to look at the context to understand the "where".
First, let's look at the word "heaven(s)" in the original languages.
**Hebrew שָׁמַיִם *shamayim* ([Strong's H8064](https://biblehub.com/hebrew/8064.htm))**
Brown-Driver-Briggs defines it as:
* visible heavens, sky, where ... |
77,839 | In Revelation 12:12, we have this passage “Therefore rejoice, you heavens and you who dwell in them!” Heavens is the universe, so who dwells in it? Could God create other intelligent beings in our cosmos?
Also in this passage “You have made heaven, the heaven of heavens, with all their host... The host of heaven worsh... | 2022/08/06 | [
"https://hermeneutics.stackexchange.com/questions/77839",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/51354/"
] | In the OP, two verses are mentioned.
1. Revelation 12:12 - “Therefore rejoice, you heavens and you who dwell
in them!”
2. Nehemiah 9:6 - “You have made heaven, the heaven of heavens, with
all their host... The host of heaven worships You.”
In both of these verses there is a link between heaven and its "inhabitants", ... | There are numerous references to other beings "in the heavens" or outside the earth as we know it such as:
* 1 Kings 22:19 - Micaiah continued, “Therefore hear the word of the LORD: I saw the LORD sitting on His throne, and **all the host of heaven** standing by Him on His right and on His left.
* Neh 9:6 - You alone ... |
58,976,193 | Im writing an sqlalchemy upsert statement and I wondered if theres a way I could get the Id's back from the db?
Heres my code so far:
```
def handle_events(self, events):
agg = []
agg.extend(self._get_dicts(events))
if not agg:
return
with DB.session(writable=True) as session:
response ... | 2019/11/21 | [
"https://Stackoverflow.com/questions/58976193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5273907/"
] | Eventually Ive used the `.returning(<column>)` inside my upsert statement like the following:
```
def _generate_upsert_stmnt(self, items):
model_class = models.MyModel
table = model_class.__table__
insert_statement = sa.dialects.postgresql.insert(table, items)
upsert_statement = insert_statement.on_con... | You can use `RETURNING` statement to see which id's where affected
Reference: <https://kite.com/python/docs/sqlalchemy.sql.Delete.returning> |
52,667,671 | Windows 10 has a decent little Application that lets you set multiple Alarms, World Clocks, Timers and Stopwatches.
Powershell also has some Stopwatch functionality; for instance like this:
```
$sw = [system.diagnostics.stopwatch]::startNew()
```
But I was disappointed to see that the two things aren't the same thi... | 2018/10/05 | [
"https://Stackoverflow.com/questions/52667671",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184456/"
] | Unless the Alarm & Clock application has an API or startup parameters of some kind, what you're asking for is not possible. You'd have to write your own application.
[This answer](https://superuser.com/a/1320845/75477) from SuperUser says that two registry entries contain JSON files which define what the timers or ala... | For me it works like this:
```
Start-Process -FilePath explorer -ArgumentList shell:Appsfolder\Microsoft.WindowsAlarms_8wekyb3d8bbwe!App
``` |
3,665,344 | I have written a TCP server. Then I am trying to connect to my server used Telnet (telnet localhost 2200).
Problem: telnet write bad text - like this: **? ?????...**
```
static void Main(string[] args)
{
ASCIIEncoding encoding = new ASCIIEncoding();
//UnicodeEncoding encoding = new UnicodeEncoding... | 2010/09/08 | [
"https://Stackoverflow.com/questions/3665344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/348173/"
] | ASCIIEncoding wont work with Russian. Use UTF8Encoding or UTF32Encoding (I'm unsure of which one that works with Russian). | Maybe [netcat](http://netcat.sourceforge.net/) gives better results. It does less interpreting of the returned data than telnet. |
59,729,027 | I want get all dates in mycollection in **MongoDb**
**Database Name** is : mydb
**Collection Name**: mycollection
Document1:
```
"Date":"10-01-2020", "timeslot1":"11-12" ,"timeslot2":null ,"timeslot3":null ,"timeslot4":null
```
Document2:
```
"Date":"11-01-2020", "timeslot1":null ,"timeslot2":null ,"timeslot3"... | 2020/01/14 | [
"https://Stackoverflow.com/questions/59729027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12262446/"
] | <https://jsfiddle.net/w0aqvg5m/>
use checked property to toggle in modal hidden event
`$('#toggle_pump').prop('checked',true)` | It's because you declared 2 ID with same name in that portion.
```
<div class="slider round">
<span class="on" name="add_device_status" id="add_device_status"
value="Active" autocomplete="off">ON</span>
<span class="off" name="add_device_status" id="add_device_status"
value="Inactive" autocomplete="off">OFF</span>
<... |
39,099,354 | I have a system which allows the user to import a spreadsheet, which then gets made into an XML format. This spreadsheet is dynamic.
Each row of the spreadsheet is an element in the XML.
For example this spreadsheet as 3 rows:
```
<DocumentElement>
<Person>
<Title />
<FirstName>Tom</FirstName>
<... | 2016/08/23 | [
"https://Stackoverflow.com/questions/39099354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2183216/"
] | Why are you using `XmlReader` directly at all? `XmlSerializer` looks like the right tool for the job. Declare some classes:
```
[XmlRoot("DocumentElement")]
public class DocumentElement : List<Person>
{
}
public class Person
{
public string Title { get; set; }
public string FirstName { get; set; }
public ... | NextSibling is the Key ;-)
```
XmlDocument doc = new XmlDocument();
doc.Load("persons.xml");
XmlNode currNode = doc.DocumentElement.FirstChild;
Console.WriteLine("First person...");
Console.WriteLine(currNode.OuterXml);
XmlNode nextNode = currNode.NextSibling;
Console.WriteLine("\r\nSecond person...");
Console.Write... |
39,099,354 | I have a system which allows the user to import a spreadsheet, which then gets made into an XML format. This spreadsheet is dynamic.
Each row of the spreadsheet is an element in the XML.
For example this spreadsheet as 3 rows:
```
<DocumentElement>
<Person>
<Title />
<FirstName>Tom</FirstName>
<... | 2016/08/23 | [
"https://Stackoverflow.com/questions/39099354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2183216/"
] | Why are you using `XmlReader` directly at all? `XmlSerializer` looks like the right tool for the job. Declare some classes:
```
[XmlRoot("DocumentElement")]
public class DocumentElement : List<Person>
{
}
public class Person
{
public string Title { get; set; }
public string FirstName { get; set; }
public ... | This isn't really answering your question, but is an alternative method of selecting all of the 'Person' nodes.
```
XmlDocument doc = new XmlDocument();
doc.Load("persons.xml");
XmlNodeList nodes = doc.SelectNodes("//Person");
```
This returns all the nodes anywhere in your document with the name "Person".
You c... |
6,521,012 | What are the reasons or security reasons why a URL would be linked this way
```
http://www.sampledemo.com/redirect?id=17&link=http://www.sampledemo.com/manual.php
```
instead of this way
```
http://www.sampledemo.com/manual.php
```
Thank you | 2011/06/29 | [
"https://Stackoverflow.com/questions/6521012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512095/"
] | Probably it isn't being used for security purposes. It might be used for site metrics and click tracking. It's hard to say what the `id` parameter is for. Could be something like an ID of the page being linked from. | If the URI was properly encoded (it isn't), then the only reasons I can think of are logging the hit and/or displaying a message to the user before they click to continue. |
6,521,012 | What are the reasons or security reasons why a URL would be linked this way
```
http://www.sampledemo.com/redirect?id=17&link=http://www.sampledemo.com/manual.php
```
instead of this way
```
http://www.sampledemo.com/manual.php
```
Thank you | 2011/06/29 | [
"https://Stackoverflow.com/questions/6521012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512095/"
] | If the URI was properly encoded (it isn't), then the only reasons I can think of are logging the hit and/or displaying a message to the user before they click to continue. | There are several reasons, but the most common one is that you want to track where you're being linked *from*. See the `id` argument? That very probably corresponds to the site. |
6,521,012 | What are the reasons or security reasons why a URL would be linked this way
```
http://www.sampledemo.com/redirect?id=17&link=http://www.sampledemo.com/manual.php
```
instead of this way
```
http://www.sampledemo.com/manual.php
```
Thank you | 2011/06/29 | [
"https://Stackoverflow.com/questions/6521012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512095/"
] | If the URI was properly encoded (it isn't), then the only reasons I can think of are logging the hit and/or displaying a message to the user before they click to continue. | There is no security reason. Usually something like this is used to track, where a visitor comes from. `redirect` will evaluate the `id`-parameter, that usually specifies one concrete (registered) referer and then redirect to the target page. |
6,521,012 | What are the reasons or security reasons why a URL would be linked this way
```
http://www.sampledemo.com/redirect?id=17&link=http://www.sampledemo.com/manual.php
```
instead of this way
```
http://www.sampledemo.com/manual.php
```
Thank you | 2011/06/29 | [
"https://Stackoverflow.com/questions/6521012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512095/"
] | Probably it isn't being used for security purposes. It might be used for site metrics and click tracking. It's hard to say what the `id` parameter is for. Could be something like an ID of the page being linked from. | There are several reasons, but the most common one is that you want to track where you're being linked *from*. See the `id` argument? That very probably corresponds to the site. |
6,521,012 | What are the reasons or security reasons why a URL would be linked this way
```
http://www.sampledemo.com/redirect?id=17&link=http://www.sampledemo.com/manual.php
```
instead of this way
```
http://www.sampledemo.com/manual.php
```
Thank you | 2011/06/29 | [
"https://Stackoverflow.com/questions/6521012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512095/"
] | Probably it isn't being used for security purposes. It might be used for site metrics and click tracking. It's hard to say what the `id` parameter is for. Could be something like an ID of the page being linked from. | There is no security reason. Usually something like this is used to track, where a visitor comes from. `redirect` will evaluate the `id`-parameter, that usually specifies one concrete (registered) referer and then redirect to the target page. |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | You can do as following:
```
<script type="text/javascript">
document.getElementById("submit").click();
</script>
``` | >
> Now i understand your question, You want default click in your submit button. Try click event, It will trigger the submit.
>
>
>
```
<script>
$('#submit').trigger('click');
</script>
```
>
> In JavaScript
>
>
>
```
document.getElementById("submit").click();
``` |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | At first, your button is not a button. It's a a hidden field.
In order to make it a button, change `type="hidden"` to `type="button"`. To make it invisible to the user, you could use inline styles like this: `style="display: none;"`.
As a result, your button looks like this:
`<input id="submit" style="display: none"... | >
> Now i understand your question, You want default click in your submit button. Try click event, It will trigger the submit.
>
>
>
```
<script>
$('#submit').trigger('click');
</script>
```
>
> In JavaScript
>
>
>
```
document.getElementById("submit").click();
``` |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | May be you can do the following:
```js
document.getElementById('chkTest').addEventListener('click', function(){
if(this.checked)
document.getElementById('submit').click();
});
document.getElementById('submit').addEventListener('click', function(){
alert('button clicked');
});
```
```html
<input id="sub... | >
> Now i understand your question, You want default click in your submit button. Try click event, It will trigger the submit.
>
>
>
```
<script>
$('#submit').trigger('click');
</script>
```
>
> In JavaScript
>
>
>
```
document.getElementById("submit").click();
``` |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | Trigger click event on the button as soon as document is ready.You have to write the click event as shown below.
```
$(document).ready(function(){
$("#yourButtonId")[0].click();
});
``` | >
> Now i understand your question, You want default click in your submit button. Try click event, It will trigger the submit.
>
>
>
```
<script>
$('#submit').trigger('click');
</script>
```
>
> In JavaScript
>
>
>
```
document.getElementById("submit").click();
``` |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | You can do as following:
```
<script type="text/javascript">
document.getElementById("submit").click();
</script>
``` | At first, your button is not a button. It's a a hidden field.
In order to make it a button, change `type="hidden"` to `type="button"`. To make it invisible to the user, you could use inline styles like this: `style="display: none;"`.
As a result, your button looks like this:
`<input id="submit" style="display: none"... |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | You can do as following:
```
<script type="text/javascript">
document.getElementById("submit").click();
</script>
``` | May be you can do the following:
```js
document.getElementById('chkTest').addEventListener('click', function(){
if(this.checked)
document.getElementById('submit').click();
});
document.getElementById('submit').addEventListener('click', function(){
alert('button clicked');
});
```
```html
<input id="sub... |
50,404,128 | There I have a button that is hidden from the user but want it to be clicked by default like with a check box if you want it to be checked by default you add the checked attribute is there any way you could do the same thing with a button here is my code
```
<input id="submit" type="hidden" value="Reverse Geocode" aut... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50404128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8341253/"
] | You can do as following:
```
<script type="text/javascript">
document.getElementById("submit").click();
</script>
``` | Trigger click event on the button as soon as document is ready.You have to write the click event as shown below.
```
$(document).ready(function(){
$("#yourButtonId")[0].click();
});
``` |
15,786,884 | I want to create a log in page but it will not work. Can anyone see the error. thank you
i have a database where i have 3 rows email - password - custermer\_id.
```
<?
$email = $_POST['email'];
$password= $_POST['password'];
$login = $_POST['login'];
$user_custermers_id = $_GET['id'];
if($login = 'yes')
{
globa... | 2013/04/03 | [
"https://Stackoverflow.com/questions/15786884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2214568/"
] | The problem is that you have have already given a `value` of `Login` to your submit button here
`<input type="submit" name="login" value="Login">` And you are checking if Login is `yes`here
```
$login = $_POST['login'];
$user_custermers_id = $_GET['id'];
if($login = 'yes'){
```
So, You are checking if value ... | Use this code it may work for you.. Because i have changed this to wordpress.pls check this.
```
<?php
session_start();
$email = $_POST['user']; //$_POST['email'];
$password= $_POST['pass']; //$_POST['password'];
$login = $_POST['login'];
$user_custermers_id = $_GET['id'];
if($login == 'Login'... |
15,786,884 | I want to create a log in page but it will not work. Can anyone see the error. thank you
i have a database where i have 3 rows email - password - custermer\_id.
```
<?
$email = $_POST['email'];
$password= $_POST['password'];
$login = $_POST['login'];
$user_custermers_id = $_GET['id'];
if($login = 'yes')
{
globa... | 2013/04/03 | [
"https://Stackoverflow.com/questions/15786884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2214568/"
] | The problem is that you have have already given a `value` of `Login` to your submit button here
`<input type="submit" name="login" value="Login">` And you are checking if Login is `yes`here
```
$login = $_POST['login'];
$user_custermers_id = $_GET['id'];
if($login = 'yes'){
```
So, You are checking if value ... | Okay, several things here, as I've also noted in my comment.
**Firstly,** you're using `mysql_query`, yet obviously using wordpress (`global $wpdb`) (WordPress doesn't use these functions, and they're outdated and deprecated, [**please read this**](http://www.stackoverflow.com/questions/12859942/why-shouldnt-i-use-mys... |
42,199,277 | I have an android application A and android application B.
I want to call application B from application A and get some data from application B and return back to same application A which was opened previously.
Application A
```
Intent app = new Intent(Intent.CATEGORY_LAUNCHER);
app.setComponent(new ComponentName("co... | 2017/02/13 | [
"https://Stackoverflow.com/questions/42199277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549056/"
] | When you set your blog page via Settings -> Reading, WordPress is skipping the template you choose for that page and will load index.php if there isn't a specific category template (see more about template hierarchy: <https://developer.wordpress.org/themes/basics/template-hierarchy/>).
So if you want your index-blog.... | For a template to be used you can set it on a page you have set to be the “post page” in your settings reading. Just leave the settings > reading select box for post page blank. |
18,395,622 | In my project, I have to install some package remotely. If I have to login in debian, I say:
```
$ ssh root@remotehostname
root@remotehostname's password:
```
it logs in successfully.
I have login in **ubuntu** in directly using
```
$ root@remotehostname
root@remotehostname's password:
```
it is throw error... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18395622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1992679/"
] | [Ubuntu documentation](https://help.ubuntu.com/community/RootSudo) says:
>
> **By default, the Root account password is locked in Ubuntu.**
>
>
>
It also says:
>
> **Please keep in mind, a substantial number of Ubuntu users are new to
> Linux.** There is a learning curve associated with any OS and many new
> ... | edit your /etc/sshd\_config doing:
```
sudo /etc/sshd_config
```
search for line having **PermitRootLogin** into *Authentication* Section and uncomment **PermitRootLogin** or set **PermitRootLogin yes**. Or simply add this line to the end of file:
```
PermitRootLogin yes
```
Next you'll gonna restart ssh daemon d... |
18,395,622 | In my project, I have to install some package remotely. If I have to login in debian, I say:
```
$ ssh root@remotehostname
root@remotehostname's password:
```
it logs in successfully.
I have login in **ubuntu** in directly using
```
$ root@remotehostname
root@remotehostname's password:
```
it is throw error... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18395622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1992679/"
] | [Ubuntu documentation](https://help.ubuntu.com/community/RootSudo) says:
>
> **By default, the Root account password is locked in Ubuntu.**
>
>
>
It also says:
>
> **Please keep in mind, a substantial number of Ubuntu users are new to
> Linux.** There is a learning curve associated with any OS and many new
> ... | ```
ssh -l user localhost "sudo whoami"
```
returns:
```
root
```
So long as:
1. The remote host allows the user connecting to be able to sudo without asking for a further password.
2. ssh-copy-id has been run or correct keys copied across to remote host so that the user can connect again without a password via ... |
18,395,622 | In my project, I have to install some package remotely. If I have to login in debian, I say:
```
$ ssh root@remotehostname
root@remotehostname's password:
```
it logs in successfully.
I have login in **ubuntu** in directly using
```
$ root@remotehostname
root@remotehostname's password:
```
it is throw error... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18395622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1992679/"
] | [Ubuntu documentation](https://help.ubuntu.com/community/RootSudo) says:
>
> **By default, the Root account password is locked in Ubuntu.**
>
>
>
It also says:
>
> **Please keep in mind, a substantial number of Ubuntu users are new to
> Linux.** There is a learning curve associated with any OS and many new
> ... | You could set a password for root, but this is not recommended and could open a security risk. But if you have an user account on the target system that has sudo credentials, you could log in as user:
```
ssh user@remotehostname
user@remotehostname's password:
```
and then do what you want using sudo or get a root s... |
18,395,622 | In my project, I have to install some package remotely. If I have to login in debian, I say:
```
$ ssh root@remotehostname
root@remotehostname's password:
```
it logs in successfully.
I have login in **ubuntu** in directly using
```
$ root@remotehostname
root@remotehostname's password:
```
it is throw error... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18395622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1992679/"
] | **Do not enable the root account. Do not set a password for the root account.**
A better way is to allow root login using public key authentication, not with password. [The reasoning is explained in the Debian mailing list archives.](http://lists.debian.org/debian-security/2002/06/msg00418.html)
1. Open `/etc/ssh/ssh... | edit your /etc/sshd\_config doing:
```
sudo /etc/sshd_config
```
search for line having **PermitRootLogin** into *Authentication* Section and uncomment **PermitRootLogin** or set **PermitRootLogin yes**. Or simply add this line to the end of file:
```
PermitRootLogin yes
```
Next you'll gonna restart ssh daemon d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.