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 |
|---|---|---|---|---|---|
73,628,868 | ###### Updated
Let's suppose that you got octal escape sequences in a stream:
```
backslash \134 is escaped as \134134
single quote ' and double quote \042
linefeed `\012` and carriage return `\015`
%s &
etc...
```
**note:** The escaped characters are limited to `0x01-0x1F 0x22 0x5C 0x7F`
How can you revert those ... | 2022/09/07 | [
"https://Stackoverflow.com/questions/73628868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3387716/"
] | UPDATE :: about `gawk`'s `strtonum()` in unicode mode :
```
echo '\666' |
LC_ALL='en_US.UTF-8' gawk -e '
$++NF = "<( "(sprintf("%c", strtonum((_=_<_) substr($++_, ++_))))" )>"'
0000000 909522524 539507744 690009798 2622
\ 6 6 6 < ( ƶ ** ) >... | this separate post is made specifically to showcase how to extend the octal lookup reference tables in `gawk` `unicode`-mode to ***`all 256 bytes`*** without external dependencies or warning messages:
* `ASCII` bytes reside in table `o2bL`
* 8-bit bytes reside in table `o2bH`
.
```
# gawk profile, created Fri Sep... |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the `/etc/init.d/jexec` script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting `*.bin` and using JAVA\_HOME if you are goin... | In general I would suggest that you install the Oracle JDK not the OpenJDK. Otherwise you might risk running into some issues. I always found problems of all sorts and sizes with OpenJDK that I don't even bother trying it any more.
Download the JDK RPM from [here](http://www.oracle.com/technetwork/java/javase/download... |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | In general I would suggest that you install the Oracle JDK not the OpenJDK. Otherwise you might risk running into some issues. I always found problems of all sorts and sizes with OpenJDK that I don't even bother trying it any more.
Download the JDK RPM from [here](http://www.oracle.com/technetwork/java/javase/download... | sudo rpm -i jdk-11.0.9\_linux-x64\_bin.rpm
or whatever package you are trying to install |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the `/etc/init.d/jexec` script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting `*.bin` and using JAVA\_HOME if you are goin... | Check my answer here [Transaction check error when installing Sun JDK 7](https://stackoverflow.com/questions/10270380/transaction-check-error-when-installing-sun-jdk-7/18621115)
Basically you may use rpm --force to install one JDK on top of the other. This scenario is completely valid specially when you have to develo... |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the `/etc/init.d/jexec` script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting `*.bin` and using JAVA\_HOME if you are goin... | Just faced the same issue. I was not comfortable using --force command; did not want to risk messing-up the existing Java that came installed at system setup.
I ended up doing the following and running the app server with a different version of Java under a different user ID.
downloaded the Java tar.gz version and un... |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | The problem here is that you cannot use the Oracle rpm to install JDK 7 when you already have the Oracle JDK 6 as it tries to install the `/etc/init.d/jexec` script which is already installed and required for JDK 6.
I would advise sticking to the tarball or self extracting `*.bin` and using JAVA\_HOME if you are goin... | sudo rpm -i jdk-11.0.9\_linux-x64\_bin.rpm
or whatever package you are trying to install |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | Check my answer here [Transaction check error when installing Sun JDK 7](https://stackoverflow.com/questions/10270380/transaction-check-error-when-installing-sun-jdk-7/18621115)
Basically you may use rpm --force to install one JDK on top of the other. This scenario is completely valid specially when you have to develo... | sudo rpm -i jdk-11.0.9\_linux-x64\_bin.rpm
or whatever package you are trying to install |
16,246,615 | Help! I can't figure out how to install a jdk!
```
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk-devel"
Loaded plugins: langpacks, presto, refresh-packagekit
No package java-1.7.0-openjdk-devel available.
Error: Nothing to do
[/usr/lib/jvm]$ su -c "yum install java-1.7.0-openjdk"
Loaded plugins: langpacks, pr... | 2013/04/26 | [
"https://Stackoverflow.com/questions/16246615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1696153/"
] | Just faced the same issue. I was not comfortable using --force command; did not want to risk messing-up the existing Java that came installed at system setup.
I ended up doing the following and running the app server with a different version of Java under a different user ID.
downloaded the Java tar.gz version and un... | sudo rpm -i jdk-11.0.9\_linux-x64\_bin.rpm
or whatever package you are trying to install |
5,164 | I've built a new Page-Template in Magento. On this template I will show the Category-Image and after that, the product grid (as standard). How can I get the Category-Image for my Template?
From my Template:
```
<div class="col-main grid4-3 grid-col2-main in-col2">
<?php echo $this->getChildHtml('global_messages')... | 2013/06/26 | [
"https://magento.stackexchange.com/questions/5164",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/2503/"
] | If you want to get the thumbnail image of the current category that you are browsing, then use the following code:
```
<?php $categoryImage = Mage::getModel('catalog/layer')->getCurrentCategory()->getThumbnail(); //Get the file name of the Image stored for the category ?>
<img src="<?php echo Mage::getBaseUrl('media'... | Great, and
```
<?php $categoryImage = Mage::getModel('catalog/layer')->getCurrentCategory()->getImage(); //Get the file name of the Image stored for the category ?>
<img src="<?php echo Mage::getBaseUrl('media').'catalog/category/'.$categoryImage ?>" />
```
..is for the category Image. Thanks f... |
5,164 | I've built a new Page-Template in Magento. On this template I will show the Category-Image and after that, the product grid (as standard). How can I get the Category-Image for my Template?
From my Template:
```
<div class="col-main grid4-3 grid-col2-main in-col2">
<?php echo $this->getChildHtml('global_messages')... | 2013/06/26 | [
"https://magento.stackexchange.com/questions/5164",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/2503/"
] | If you want to get the thumbnail image of the current category that you are browsing, then use the following code:
```
<?php $categoryImage = Mage::getModel('catalog/layer')->getCurrentCategory()->getThumbnail(); //Get the file name of the Image stored for the category ?>
<img src="<?php echo Mage::getBaseUrl('media'... | An easier way to grab the full url of the category image (on Magento 1.7, anyway) is to use the function "getImageUrl()". Thus, we can grab more or less the same code from the category view.phtml to create our category image...
```
<?php
$_category = Mage::getModel('catalog/layer')->getCurrentCategory();
$_... |
5,511,737 | I have the following code in R:
```
z <- scale(x) / sqrt(n-1) # standardized matrix x such that z'z=correlation matrix
R <- t(z) %*% z # correlation matrix
I <- diag(py - 1) # identity matrix(py defined before)
df <- rep(0, length(k)) # k=seq(0,5,0.001)
for (i in seq(0,5,0.001)) {
H <- ... | 2011/04/01 | [
"https://Stackoverflow.com/questions/5511737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687362/"
] | Is the application pool running in integrated mode the IIS site running under that application pool?
It's my understanding that if this isn't the case, the MVC site will not run.
Alternatively, have you tried [this?](https://stackoverflow.com/questions/1741439/asp-mvc-in-iis-7-results-in-http-error-403-14-forbidden/5... | +1 Unicorn power HooooooO!!!!! Also I've always when hosting a site published the project to a different folder then setup the site via IIS from that folder hope this helps. |
7,276,440 | I want to loop through a DataGridView that is created on the main form in a BackgroundWorker to export the data to a CSV file. The BackgroundWorker is created on a separate form where the progress of the export will be displayed via a progress bar. Here is the code on the export form that calls the BackgroundWorker:
`... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7276440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/199919/"
] | Jeff in my opinion you are doing at minimum two mistakes in here:
* Exporting data from a UI control instead of doing it from the data source;
* Trying to access a UI control from a background thread;
I just would not try to access a UI control (Grid in your case) in a form which is not even the form where the backgr... | I have ran into this before. Here's how I did this. This is taken straight out of the project I did this in. You should be able to get the idea of how to set up the threading to make this work. I didn't include the methods that actually write the CSV file, I'm assuming your main problem is with the threading. And as Da... |
72,696 | I have been involved in two volunteering groups for the past two years and I'm not sure If I should ever mention it in the SOP/CV.
Should I mention it in one or both my SOP and CV? Also, how detailed should I write on the type of activity/nature of the work/vision/reasoning/accomplishments, etc.
Note: I'm applying fo... | 2016/07/12 | [
"https://academia.stackexchange.com/questions/72696",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/57672/"
] | I would recommend against mentioning unrelated volunteer work in one's statement of purpose---after all, you have said that it is unrelated to the career that you are intending to pursue. If it *were* directly linked, then of course it would be useful to mention it.
Likewise, there is no space for this type of work in... | I see nothing wrong in mentioning that on your resume even if it is unrelated. If you have enough place on your 1-2 page resume, you can put it.
In my eyes, It shows that you are a passionate, social and informed person and not just a (sitting in front of the computer) geek. |
72,696 | I have been involved in two volunteering groups for the past two years and I'm not sure If I should ever mention it in the SOP/CV.
Should I mention it in one or both my SOP and CV? Also, how detailed should I write on the type of activity/nature of the work/vision/reasoning/accomplishments, etc.
Note: I'm applying fo... | 2016/07/12 | [
"https://academia.stackexchange.com/questions/72696",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/57672/"
] | >
> Should I mention it in one or both my SOP and CV?
>
>
>
Yes, in the CV (shows you're well rounded and well enough organized to keep up with a commitment outside of school), but not in the SOP (because it's unrelated) -- unless this particular experience was fundamental in motivating you to want to go to grad ... | I see nothing wrong in mentioning that on your resume even if it is unrelated. If you have enough place on your 1-2 page resume, you can put it.
In my eyes, It shows that you are a passionate, social and informed person and not just a (sitting in front of the computer) geek. |
72,696 | I have been involved in two volunteering groups for the past two years and I'm not sure If I should ever mention it in the SOP/CV.
Should I mention it in one or both my SOP and CV? Also, how detailed should I write on the type of activity/nature of the work/vision/reasoning/accomplishments, etc.
Note: I'm applying fo... | 2016/07/12 | [
"https://academia.stackexchange.com/questions/72696",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/57672/"
] | I would recommend against mentioning unrelated volunteer work in one's statement of purpose---after all, you have said that it is unrelated to the career that you are intending to pursue. If it *were* directly linked, then of course it would be useful to mention it.
Likewise, there is no space for this type of work in... | >
> Should I mention it in one or both my SOP and CV?
>
>
>
Yes, in the CV (shows you're well rounded and well enough organized to keep up with a commitment outside of school), but not in the SOP (because it's unrelated) -- unless this particular experience was fundamental in motivating you to want to go to grad ... |
39,384,482 | I have a query which takes around 2 seconds to load:
```
SELECT OUTPUT_VAL.NEXTVAL VAR1_R_ID,A.R_ID,A.VAR1,A.SEQU,A.OUTPUT,B.VAR1 DATATYPE_VAR1
FROM
(
SELECT A.R_ID,A.VAR1,A.SEQU,A.OUTPUT,B.D_TYPE
FROM
(
select A.R_ID, 2484 VAR1,1 SEQU, A.USER OUTPUT
from R_TB_1 A
WHERE A.R_ID B... | 2016/09/08 | [
"https://Stackoverflow.com/questions/39384482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893394/"
] | So, you have a table `VAR1_TABLE` with at least three columns, `VAR1`, `D_TYPE` and `VAR1_NAME`... you select rows that have a `VAR1` column from another table, then you join with `VAR1_TABLE` on `MEM_VAR1 = VAR1`, and then you join again on `D_TYPE = VAR1_NAME`? Can you explain this part, since it makes no sense to me... | ```
WITH temp AS (
SELECT OUTPUT_VAL.NEXTVAL VAR1_R_ID,A.R_ID,A.VAR1,A.SEQU,A.OUTPUT,B.VAR1 DATATYPE_VAR1 FROM
(
SELECT A.R_ID,A.VAR1,A.SEQU,A.OUTPUT,B.D_TYPE FROM
(
SELECT A.R_ID, 2484 VAR1,1 SEQU, A.USER OUTPUT from R_TB_1 A WHERE A.R_ID BETWEEN 2457854437 AND 2458854437
union ALL
select A.R_ID, A.MEM_VAR1 VAR1,1... |
43,938,023 | Imitating an "increasing" C-styled for loop in Python is very simple:
```
for (int i = A ; i < B ; i += C)
```
can be easily implemented in Python, **Without consuming memory for an array from A to B**, using:
```
for i in range(A, B, C) # (xrange if Python 2.x)
```
But what about decreasing loops?
How can on... | 2017/05/12 | [
"https://Stackoverflow.com/questions/43938023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8002900/"
] | range takes 3 args `range(start,stop,step)`. The step arg can be negative to iterate backwards.
```
arr = range(10) # range generator in python 3
for i in range(len(arr)-1,0,-1):
print(arr[i])
9
8
7
6
5
4
3
2
1
```
Note that the start is `len(arr)-1` because lists are 0-indexed so the max idx is 9 for a list of ... | Just go ahead and call `reversed()` on the result of `range()`. It won't build the whole list because the `range` object has a [`__reversed__`](https://docs.python.org/3/reference/datamodel.html#object.__reversed__) method, which the `reversed()` function detects and uses. Here's how you can see that it has that method... |
73,641,007 | In R, I am trying to calculate the geometric mean (exp(mean(log(x, na.rm=T))) across all columns in a data frame by participant ID. The data frame is in long format. Below is a comparable code that I have so far... it isn't working. I have also tried data.table, but still unsuccessful. Any help appreciated
```
mtcars... | 2022/09/07 | [
"https://Stackoverflow.com/questions/73641007",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17966658/"
] | I think the issue was related to the placement of the `na.rm = TRUE`, which should be a parameter of `mean()` but was placed within the `log()` parentheses.
```
library(dplyr)
mtcars[,1:5] %>%
group_by(cyl) %>%
summarize(across(everything(), ~exp(mean(log(.x), na.rm=TRUE))))
# A tibble: 3 × 5
cyl mpg dis... | You could also use a nested combination of `sapply()` to apply a function to multiple columns and `ave()` to apply that function to groups according to a reference column
```
mtcars_sub <- mtcars[,c(2,3,1)]
sapply(mtcars_sub[,c(2:3)],
FUN = function(x) ave(x,
mtcars_sub[,c("cyl")... |
19,265,202 | I'm trying to make following tutorial: <https://medium.com/on-coding/e8d93c9ce0e2>
When it comes to run:
```
php artisan migrate
```
I get following error:
```
[Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.user... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636426/"
] | In your `CreateUserTable` migration file, instead of `Schema::table` you have to use `Schema::create`.
The `Schema::table` is used to alter an existing table and the `Schema::create` is used to create new table.
Check the documentation:
* <http://laravel.com/docs/schema#creating-and-dropping-tables>
* <http://larave... | The underlying cause of this may be if the syntax used for creating the migration `php artisan migrate ...` is not quite correct. In this case the `--create` will not get picked up properly and you will see the `Schema::table` instead of the expected `Schema::create`. When a migration file is generated like this you mi... |
19,265,202 | I'm trying to make following tutorial: <https://medium.com/on-coding/e8d93c9ce0e2>
When it comes to run:
```
php artisan migrate
```
I get following error:
```
[Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.user... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636426/"
] | In your `CreateUserTable` migration file, instead of `Schema::table` you have to use `Schema::create`.
The `Schema::table` is used to alter an existing table and the `Schema::create` is used to create new table.
Check the documentation:
* <http://laravel.com/docs/schema#creating-and-dropping-tables>
* <http://larave... | Sometimes it is caused by custom artisan commands. Some of these commands might initiate few classes. And because we did a rollback, the table cannot be found. Check you custom artisan commands. You can comment out the lines which are causing the trigger. Run the php artisan migrate command and then uncomment. This is ... |
19,265,202 | I'm trying to make following tutorial: <https://medium.com/on-coding/e8d93c9ce0e2>
When it comes to run:
```
php artisan migrate
```
I get following error:
```
[Exception]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.user... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1636426/"
] | The underlying cause of this may be if the syntax used for creating the migration `php artisan migrate ...` is not quite correct. In this case the `--create` will not get picked up properly and you will see the `Schema::table` instead of the expected `Schema::create`. When a migration file is generated like this you mi... | Sometimes it is caused by custom artisan commands. Some of these commands might initiate few classes. And because we did a rollback, the table cannot be found. Check you custom artisan commands. You can comment out the lines which are causing the trigger. Run the php artisan migrate command and then uncomment. This is ... |
11,600,708 | I'm working on a project that will use a comparison voting logic to sort the highest rated to the top and lowest to the bottom(Similar to a "hot or not" or "Hotstagram"). Basically what I need to do is take 2 random pictures that are directly next to each other in the database and have users vote, adding one point to t... | 2012/07/22 | [
"https://Stackoverflow.com/questions/11600708",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1283726/"
] | You can use the [Order by Rand()](http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand) function to get a random record from the database.
`SELECT * FROM tbl_name ORDER BY RAND();`
You can also limit this to two rows easily enough as such:
`SELECT * FROM tbl_name ORDER BY RAND() limit 2;`... | Here is another way to get two random rows in order:
```
with first as (select id
from table t
where id < (select max(id) from table)
order by rand()
limit 1
)
select id
from table t
order by abs(id - first.id)
limit 2
```
As for structuring t... |
67,824 | Exodus 18:20:
>
> **וְהִזְהַרְתָּ֣ה** אֶתְהֶ֔ם אֶת־הַחֻקִּ֖ים וְאֶת־הַתּוֹרֹ֑ת **וְהוֹדַעְתָּ֣**
> לָהֶ֗ם אֶת־הַדֶּ֙רֶךְ֙ יֵ֣לְכוּ בָ֔הּ וְאֶת־הַֽמַּעֲשֶׂ֖ה אֲשֶׁ֥ר
> יַעֲשֽׂוּן׃
>
>
> My translation - somewhat "exaggerated" to point the nuances, here:
>
>
> You shall **warn** them about the statutes and laws a... | 2016/01/29 | [
"https://judaism.stackexchange.com/questions/67824",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/5275/"
] | The **second** verb-object is the simple amplification and expansion of nuance of the **first** verb-object. That is, both verb-objects are the main idea of their respective clauses. Thus the second verb-object (and what follows) modifies the first verb-object (and what follows).
According to the 19th Century mathemat... | The usage of diffrent verbs in this posuk seems to be a reflection of [Synonymous Parallelism](https://en.wikipedia.org/wiki/Biblical_poetry#Parallelism) found in the Hebrew Bible in which each element of the second part of the verse or strophe are synonyms/explanations of the idea of its first part.
You shall warn t... |
67,824 | Exodus 18:20:
>
> **וְהִזְהַרְתָּ֣ה** אֶתְהֶ֔ם אֶת־הַחֻקִּ֖ים וְאֶת־הַתּוֹרֹ֑ת **וְהוֹדַעְתָּ֣**
> לָהֶ֗ם אֶת־הַדֶּ֙רֶךְ֙ יֵ֣לְכוּ בָ֔הּ וְאֶת־הַֽמַּעֲשֶׂ֖ה אֲשֶׁ֥ר
> יַעֲשֽׂוּן׃
>
>
> My translation - somewhat "exaggerated" to point the nuances, here:
>
>
> You shall **warn** them about the statutes and laws a... | 2016/01/29 | [
"https://judaism.stackexchange.com/questions/67824",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/5275/"
] | The [Malbim](http://www.hebrewbooks.org/pdfpager.aspx?req=40081&st=&pgnum=275) says that this is the usual split of "עשה" and "לא תעשה".
The form of "אזהרה" always comes regarding "לא תעשה" (since you **warn** someone of something that he shouldn't do). These too he splits into "חקים" which are "לא תעשה" for **physic... | The usage of diffrent verbs in this posuk seems to be a reflection of [Synonymous Parallelism](https://en.wikipedia.org/wiki/Biblical_poetry#Parallelism) found in the Hebrew Bible in which each element of the second part of the verse or strophe are synonyms/explanations of the idea of its first part.
You shall warn t... |
131,339 | I just got a new Macbook Pro. I know it's an Intel processor, but is it 32 bits or 64 bits processor? | 2010/04/15 | [
"https://superuser.com/questions/131339",
"https://superuser.com",
"https://superuser.com/users/34224/"
] | 64bit processor | Enter this into Terminal:
```
uname -a
```
If you see
`x86_64`
at the end of the string returned , your OS X kernel suports 64 bit.
Also bear in mind you need to hold down the `6` and `4` keys while booting to startup with the 64 bit kernel ( there are other ways to accomplish this as well )
At least this was... |
42,150,118 | i am trying to generate a new variable as follows:
if value for testA is 1 and value for testB is 1 ==> code testAB as 1
if value for testA is 1 and value for testB is missing or 0 ==> code testAB as 1
if value for testA is missing or 0 and value for testB is 1 ==> code testAB as 1
if value for testA is 0 and value... | 2017/02/10 | [
"https://Stackoverflow.com/questions/42150118",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7418739/"
] | This should get you what you're looking for
```
df1 <- data.frame(testA = c(1, 1, 1, 0, 0, 0, NA, NA, NA),
testB = c(0, 1, NA, 0, 1, NA, 0, 1, NA))
ind <- is.na(df1$testA) + is.na(df1$testB) < 2
df1$testAB[!ind] <- NA
df1$testAB[ind] <- as.numeric(as.logical(rowSums(df1[ind,], na.rm = TRUE)))
> df1... | You need, minimally, n-1 ifelse() statements for n unique outcomes.
To simplify the problem, group your criteria for each outcome with *or* (`|`).
In your case..
`1`:
```
(df$testA == 1 & df$testB == 1) |
(df$testA == 1 & (is.na(df$testB) | df$testB == 0)) |
((is.na(df$testA) | df$testA == 0) & df$testB == 1) ... |
370,135 | Following is my code which I am using to display comments of posts in a loop (Custom Post Types). I would like to display only latest 3 comments. Kindly help me to limit comments.
```
<?php foreach (get_comments() as $comment): ?>
<div><span class="author-name"><?php echo $comment->comment_author; ?> said:</span>... | 2020/07/01 | [
"https://wordpress.stackexchange.com/questions/370135",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/190895/"
] | I don't usually work with comment so my suggestion is untested, but I see that get\_comments() receives an array of args.
Try this:
`$comments = get_comments(array("number" => 3))`
and instead of your foreach loop:
`foreach ($comments as $comment):` | My answer to this is to use something like this:
```
$args = ['number' => 3];
$comments = get_comments( $args );
``` |
20,707,448 | Given a sequence of unordered n integers, S = a1,a2,a3...
Give a formal and recursive definition of the length of the longest non-decreasing subsequence in term of n.
So, my thoughts are that if we're defining it recursively then each integer in the sequence is a sequence of length of 1 and contains a non decreasing ... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20707448",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2565869/"
] | The final keyword prevents you from modifying a class if applied to the class, or a method if applied to a method.
From <http://en.wikipedia.org/wiki/Final_%28Java%29> :
>
> A final method cannot be overridden or hidden by subclasses. This is used to prevent unexpected behavior from a subclass altering a method that... | Refresh dependencies solved my issue. |
53,397,939 | I have code that looks like this.
```
public static Dictionary<int, Action> functionsMap;
void Function()
{
if (!isDictionaryInitialized)
{
functionsMap = new Dictionary<int, Action>();
functionsMap.Add(1, () => StartCoroutine(Function1()));
functionsMap.Add(1, () => StartCoroutine(Fun... | 2018/11/20 | [
"https://Stackoverflow.com/questions/53397939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10576580/"
] | The problem might be caused by changing scenes because simply loading another scene would destroy all gameobject in the current scene.
According to [Object.DontDestroyOnLoad](https://docs.unity3d.com/ScriptReference/Object.DontDestroyOnLoad.html).
>
> The load of a new Scene destroys all current Scene objects.
>
> ... | First you are adding two `Action`s to your Dictionary but both with the same `key`.
```
functionsMap.Add(1, () => StartCoroutine(Function1()));
functionsMap.Add(1, () => StartCoroutine(Function2()));
```
wouldn't this overwrite the first entry?
---
Than your general problem is:
While `functionsMap` is `static` th... |
1,060,718 | $$\ln(\tan(x) + \sec(x))=\frac{\ln (1+\sin x )-\ln(1-\sin x )}{2}$$
Is this true or false? I thought the right side looked like a sum of an even and an odd function but I ended up with $$\ln(\tan(x) + \sec(x))=\ln(\tan(x) + \sec(x))$$ which is true, but it's not what I was trying to prove. | 2014/12/10 | [
"https://math.stackexchange.com/questions/1060718",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/183782/"
] | We'll start from RHS
$$\begin{align}
\frac12\Big[\ln(1+\sin x )-\ln(1-\sin x)\Big]
&=\frac12\left[\ln\left(\frac{1+\sin x}{1-\sin x} \right)\right]\\
&=\frac12\left[\ln\left(\frac{(1+\sin x)^2}{1-\sin^2 x} \right)\right]\\
&=\frac12\left[\ln\left(\frac{(1+\sin x)^2}{\cos^2 x} \right)\right]\\
&=\ln\left(\frac{ 1+\sin x... | Let $s = \sin x, c = \cos x$.
The LHS is $\displaystyle \ln (\frac{s}{c} + \frac{1}{c}) = \ln (\frac{s+1}{c}) = \ln(\frac{1+s}{\sqrt{1-s^2}}) = \ln (\frac{1+s}{\sqrt{(1+s)(1-s)}}) \\ =\ln(\frac{\sqrt{1+s}}{\sqrt{1-s}}) = \ln(\sqrt{1+s}) - \ln(\sqrt{1-s}) = \frac{1}{2} [\ln(1+s) - \ln(1-s)]$ |
1,060,718 | $$\ln(\tan(x) + \sec(x))=\frac{\ln (1+\sin x )-\ln(1-\sin x )}{2}$$
Is this true or false? I thought the right side looked like a sum of an even and an odd function but I ended up with $$\ln(\tan(x) + \sec(x))=\ln(\tan(x) + \sec(x))$$ which is true, but it's not what I was trying to prove. | 2014/12/10 | [
"https://math.stackexchange.com/questions/1060718",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/183782/"
] | We'll start from RHS
$$\begin{align}
\frac12\Big[\ln(1+\sin x )-\ln(1-\sin x)\Big]
&=\frac12\left[\ln\left(\frac{1+\sin x}{1-\sin x} \right)\right]\\
&=\frac12\left[\ln\left(\frac{(1+\sin x)^2}{1-\sin^2 x} \right)\right]\\
&=\frac12\left[\ln\left(\frac{(1+\sin x)^2}{\cos^2 x} \right)\right]\\
&=\ln\left(\frac{ 1+\sin x... | $2\ln (\tan x+\sec x)=\ln \left(\dfrac{(1+\sin x)^2}{\cos^2 x}\right)=\ln \left(\dfrac{(1+\sin x)^2}{1-\sin^2 x}\right)=\ln \left(\dfrac{1+\sin x}{1-\sin x}\right)$ |
1,060,718 | $$\ln(\tan(x) + \sec(x))=\frac{\ln (1+\sin x )-\ln(1-\sin x )}{2}$$
Is this true or false? I thought the right side looked like a sum of an even and an odd function but I ended up with $$\ln(\tan(x) + \sec(x))=\ln(\tan(x) + \sec(x))$$ which is true, but it's not what I was trying to prove. | 2014/12/10 | [
"https://math.stackexchange.com/questions/1060718",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/183782/"
] | $2\ln (\tan x+\sec x)=\ln \left(\dfrac{(1+\sin x)^2}{\cos^2 x}\right)=\ln \left(\dfrac{(1+\sin x)^2}{1-\sin^2 x}\right)=\ln \left(\dfrac{1+\sin x}{1-\sin x}\right)$ | Let $s = \sin x, c = \cos x$.
The LHS is $\displaystyle \ln (\frac{s}{c} + \frac{1}{c}) = \ln (\frac{s+1}{c}) = \ln(\frac{1+s}{\sqrt{1-s^2}}) = \ln (\frac{1+s}{\sqrt{(1+s)(1-s)}}) \\ =\ln(\frac{\sqrt{1+s}}{\sqrt{1-s}}) = \ln(\sqrt{1+s}) - \ln(\sqrt{1-s}) = \frac{1}{2} [\ln(1+s) - \ln(1-s)]$ |
903 | Lets say a batsman hits a shot and in midway it hits a bird in the air and then as soon as it hits the bird, the ball starts falling down and is caught by a fielder, will the batsman be given out?
I searched a lot all over but could find nothing about a rule which clarifies this, any help will be appreciated. | 2012/06/04 | [
"https://sports.stackexchange.com/questions/903",
"https://sports.stackexchange.com",
"https://sports.stackexchange.com/users/521/"
] | This is one of the reason why what we commonly think of as 'rules' of a sport are usually actually called 'laws'. See the [Laws of Cricket](http://www.lords.org/laws-and-spirit/laws-of-cricket/)
They are called Laws because you cannot possibly define to the very last possible detail every single possibility that might... | The rule for all indoor stadiums having roofs are that if the roof is closed and the ball hits the roof, then it is considered a dead ball.
Hussey [hits the roof](http://www.youtube.com/watch?v=OkcP5M2n-F0) with a monstrous shot. |
903 | Lets say a batsman hits a shot and in midway it hits a bird in the air and then as soon as it hits the bird, the ball starts falling down and is caught by a fielder, will the batsman be given out?
I searched a lot all over but could find nothing about a rule which clarifies this, any help will be appreciated. | 2012/06/04 | [
"https://sports.stackexchange.com/questions/903",
"https://sports.stackexchange.com",
"https://sports.stackexchange.com/users/521/"
] | This is one of the reason why what we commonly think of as 'rules' of a sport are usually actually called 'laws'. See the [Laws of Cricket](http://www.lords.org/laws-and-spirit/laws-of-cricket/)
They are called Laws because you cannot possibly define to the very last possible detail every single possibility that might... | I believe the first answer is incorrect.
If the ball hit a flying bird it would probably be called a *dead ball*, as I believe it has to go directly to a human fielder without touching *anything else* to be considered out caught.
In the same way that if the ball hit a helmet on the ground, bounced up and someone cau... |
903 | Lets say a batsman hits a shot and in midway it hits a bird in the air and then as soon as it hits the bird, the ball starts falling down and is caught by a fielder, will the batsman be given out?
I searched a lot all over but could find nothing about a rule which clarifies this, any help will be appreciated. | 2012/06/04 | [
"https://sports.stackexchange.com/questions/903",
"https://sports.stackexchange.com",
"https://sports.stackexchange.com/users/521/"
] | The rule for all indoor stadiums having roofs are that if the roof is closed and the ball hits the roof, then it is considered a dead ball.
Hussey [hits the roof](http://www.youtube.com/watch?v=OkcP5M2n-F0) with a monstrous shot. | I believe the first answer is incorrect.
If the ball hit a flying bird it would probably be called a *dead ball*, as I believe it has to go directly to a human fielder without touching *anything else* to be considered out caught.
In the same way that if the ball hit a helmet on the ground, bounced up and someone cau... |
60,416,583 | I have an array(lets call it X) and X contains arrays. I want to push an element(a string) into an array that is inside of X.
I've tried searching for quite a while and all i find are people trying to push arrays inside of other arrays.
I've tried the following code:
```
push(@X[0],$element);
```
Which gives me t... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60416583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954322/"
] | In Perl, arrays cannot contain other arrays. To make a multi-dimensional data structure, you need references.
Consider this example.
```
use strict; use warnings;
use Data::Dumper;
my @inner = qw(a b c);
my @outer = (
\@inner, # reference to existing array
[100, 200, 300], # new anonymous array refer... | I think that this does what you want:
```
push @{ $X[0] }, $element;
``` |
60,416,583 | I have an array(lets call it X) and X contains arrays. I want to push an element(a string) into an array that is inside of X.
I've tried searching for quite a while and all i find are people trying to push arrays inside of other arrays.
I've tried the following code:
```
push(@X[0],$element);
```
Which gives me t... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60416583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954322/"
] | I think that this does what you want:
```
push @{ $X[0] }, $element;
``` | Like everybody mentioned already, `push @{ $X[0] }, $element;`.
Since you say you are using v5.26, you can also use postfix dereferencing:
`push $X[0]->@*, $element;` |
60,416,583 | I have an array(lets call it X) and X contains arrays. I want to push an element(a string) into an array that is inside of X.
I've tried searching for quite a while and all i find are people trying to push arrays inside of other arrays.
I've tried the following code:
```
push(@X[0],$element);
```
Which gives me t... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60416583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954322/"
] | In Perl, arrays cannot contain other arrays. To make a multi-dimensional data structure, you need references.
Consider this example.
```
use strict; use warnings;
use Data::Dumper;
my @inner = qw(a b c);
my @outer = (
\@inner, # reference to existing array
[100, 200, 300], # new anonymous array refer... | The syntax for `push` is
```
push ARRAY, LIST
```
For example,
```
push @a, $element;
```
Whereever a variable name appear, you may replace the name with a block that evaluate to an reference.
```
push @{ $X[0] }, $element;
```
And that's what you need. |
60,416,583 | I have an array(lets call it X) and X contains arrays. I want to push an element(a string) into an array that is inside of X.
I've tried searching for quite a while and all i find are people trying to push arrays inside of other arrays.
I've tried the following code:
```
push(@X[0],$element);
```
Which gives me t... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60416583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954322/"
] | In Perl, arrays cannot contain other arrays. To make a multi-dimensional data structure, you need references.
Consider this example.
```
use strict; use warnings;
use Data::Dumper;
my @inner = qw(a b c);
my @outer = (
\@inner, # reference to existing array
[100, 200, 300], # new anonymous array refer... | Like everybody mentioned already, `push @{ $X[0] }, $element;`.
Since you say you are using v5.26, you can also use postfix dereferencing:
`push $X[0]->@*, $element;` |
60,416,583 | I have an array(lets call it X) and X contains arrays. I want to push an element(a string) into an array that is inside of X.
I've tried searching for quite a while and all i find are people trying to push arrays inside of other arrays.
I've tried the following code:
```
push(@X[0],$element);
```
Which gives me t... | 2020/02/26 | [
"https://Stackoverflow.com/questions/60416583",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10954322/"
] | The syntax for `push` is
```
push ARRAY, LIST
```
For example,
```
push @a, $element;
```
Whereever a variable name appear, you may replace the name with a block that evaluate to an reference.
```
push @{ $X[0] }, $element;
```
And that's what you need. | Like everybody mentioned already, `push @{ $X[0] }, $element;`.
Since you say you are using v5.26, you can also use postfix dereferencing:
`push $X[0]->@*, $element;` |
42,489,497 | I have a procedure where users enter "student id" to search and see the details of that individual. I know this inst correct and I have far more syntax to write but so far this is what I have:-
Please note I have declared all variables and my table columns name and types are correct. I haven't ran the code yet becaus... | 2017/02/27 | [
"https://Stackoverflow.com/questions/42489497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7426389/"
] | There are several ways to go about this. The standard method, and it is lightening fast, is to just select the data and have a no\_data\_found exception. I hope you haven't prefaced all of your column names with the table name, that is not good practice IMHO.
```
DECLARE
l_student_no saturn.unsus.student_no... | Just need a check whether the set exists.
```
SELECT COUNT(UNSUS_STUDENT_NO) INTO studentCount FROM SATURN.UNSUS
WHERE UNSUS_SUSPEND_NO = ('000123456');
IF studentCount > 0 THEN
-- Insert all logic here.
END IF;
``` |
20,270,871 | I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:
`builtins.ValueError: need more than 1 value to unpack`
```
questions_list = []
answers_list = []
questions_file=open('qanda.txt','r')
for line in questions_file:... | 2013/11/28 | [
"https://Stackoverflow.com/questions/20270871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3046660/"
] | This is probably because when you're doing the splitting, there is no `:`, so the function just returns one argument, and not 2. This is probably caused by the last line, meaning that you're last line has nothing but empty spaces. Like so:
```
>>> a = ' '
>>> a = a.strip()
>>> a
''
>>> a.split(':')
['']
```
As you... | `line.split(':')` apparently returns a list with one element, not two.
Hence that's why it can't unpack the result into `questions` and `answers`. Example:
```
>>> line = 'this-line-does-not-contain-a-colon'
>>> question, answers = line.split(':')
Traceback (most recent call last):
File "<stdin>", line 1, in <modul... |
20,270,871 | I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:
`builtins.ValueError: need more than 1 value to unpack`
```
questions_list = []
answers_list = []
questions_file=open('qanda.txt','r')
for line in questions_file:... | 2013/11/28 | [
"https://Stackoverflow.com/questions/20270871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3046660/"
] | `line.split(':')` apparently returns a list with one element, not two.
Hence that's why it can't unpack the result into `questions` and `answers`. Example:
```
>>> line = 'this-line-does-not-contain-a-colon'
>>> question, answers = line.split(':')
Traceback (most recent call last):
File "<stdin>", line 1, in <modul... | The reason why this happens could be a few, as already covered in the other answers. Empty line, or maybe a line only have a question and no colon. If you want to parse the lines even if they don't have the colon (for example if some lines only have the question), you can change your split to the following:
```
questi... |
20,270,871 | I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:
`builtins.ValueError: need more than 1 value to unpack`
```
questions_list = []
answers_list = []
questions_file=open('qanda.txt','r')
for line in questions_file:... | 2013/11/28 | [
"https://Stackoverflow.com/questions/20270871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3046660/"
] | This is probably because when you're doing the splitting, there is no `:`, so the function just returns one argument, and not 2. This is probably caused by the last line, meaning that you're last line has nothing but empty spaces. Like so:
```
>>> a = ' '
>>> a = a.strip()
>>> a
''
>>> a.split(':')
['']
```
As you... | Try:
```
question, answers = line.split(':', maxsplit=1)
question, __, answers = line.partition(':')
```
Also in Python 3 you can do something else:
```
question, *many_answers = line.split(':')
```
which looks like:
```
temp = line.split(':')
question = temp[0]
many_answers = tuple(temp[1:])
``` |
20,270,871 | I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:
`builtins.ValueError: need more than 1 value to unpack`
```
questions_list = []
answers_list = []
questions_file=open('qanda.txt','r')
for line in questions_file:... | 2013/11/28 | [
"https://Stackoverflow.com/questions/20270871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3046660/"
] | This is probably because when you're doing the splitting, there is no `:`, so the function just returns one argument, and not 2. This is probably caused by the last line, meaning that you're last line has nothing but empty spaces. Like so:
```
>>> a = ' '
>>> a = a.strip()
>>> a
''
>>> a.split(':')
['']
```
As you... | The reason why this happens could be a few, as already covered in the other answers. Empty line, or maybe a line only have a question and no colon. If you want to parse the lines even if they don't have the colon (for example if some lines only have the question), you can change your split to the following:
```
questi... |
20,270,871 | I have a file with questions and answers on the same line, I want to seperate them and append them to their own empty list but keep getting this error:
`builtins.ValueError: need more than 1 value to unpack`
```
questions_list = []
answers_list = []
questions_file=open('qanda.txt','r')
for line in questions_file:... | 2013/11/28 | [
"https://Stackoverflow.com/questions/20270871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3046660/"
] | Try:
```
question, answers = line.split(':', maxsplit=1)
question, __, answers = line.partition(':')
```
Also in Python 3 you can do something else:
```
question, *many_answers = line.split(':')
```
which looks like:
```
temp = line.split(':')
question = temp[0]
many_answers = tuple(temp[1:])
``` | The reason why this happens could be a few, as already covered in the other answers. Empty line, or maybe a line only have a question and no colon. If you want to parse the lines even if they don't have the colon (for example if some lines only have the question), you can change your split to the following:
```
questi... |
9,641,631 | I tried to simplify my question to a basic example I wrote down below, the actual problem is much more complex so the below queries might not make much sense but the basic concepts are the same (data from one query as argument to another).
**Query 1:**
```
SELECT Ping.ID as PingID, Base.ID as BaseID FROM
(SELECT... | 2012/03/09 | [
"https://Stackoverflow.com/questions/9641631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | The simplest way of dealing with this is temporary tables, described [here](http://dev.mysql.com/doc/refman/5.0/en/create-table.html) and [here](http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html). If you create an empty table to store your results (let's call it `tbl_temp1`) you can to this:
```
... | If this were a more flattened query, then there would a straightforward answer.
It is certainly possible to use a derived table as the input to outer queries. A simple example would be:
```
select
data1,
(select data3 from howdy1 where howdy1.data1 = greetings.data1) data3_derived
from
(select data1 from hel... |
9,641,631 | I tried to simplify my question to a basic example I wrote down below, the actual problem is much more complex so the below queries might not make much sense but the basic concepts are the same (data from one query as argument to another).
**Query 1:**
```
SELECT Ping.ID as PingID, Base.ID as BaseID FROM
(SELECT... | 2012/03/09 | [
"https://Stackoverflow.com/questions/9641631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | The simplest way of dealing with this is temporary tables, described [here](http://dev.mysql.com/doc/refman/5.0/en/create-table.html) and [here](http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.html). If you create an empty table to store your results (let's call it `tbl_temp1`) you can to this:
```
... | If you cannot modify query 2 then there is nothing we can suggest. Here is a combination of your two queries with a reduced level of nesting. I suspect this would be slow with a large dataset -
```
SELECT tmp1.PingID, tmp1.BaseID, IF(slb.Data, 1, 0) AS third_col
FROM (
SELECT lp.ID AS PingID, MAX(lb.ID) AS BaseID
... |
9,641,631 | I tried to simplify my question to a basic example I wrote down below, the actual problem is much more complex so the below queries might not make much sense but the basic concepts are the same (data from one query as argument to another).
**Query 1:**
```
SELECT Ping.ID as PingID, Base.ID as BaseID FROM
(SELECT... | 2012/03/09 | [
"https://Stackoverflow.com/questions/9641631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/391986/"
] | If this were a more flattened query, then there would a straightforward answer.
It is certainly possible to use a derived table as the input to outer queries. A simple example would be:
```
select
data1,
(select data3 from howdy1 where howdy1.data1 = greetings.data1) data3_derived
from
(select data1 from hel... | If you cannot modify query 2 then there is nothing we can suggest. Here is a combination of your two queries with a reduced level of nesting. I suspect this would be slow with a large dataset -
```
SELECT tmp1.PingID, tmp1.BaseID, IF(slb.Data, 1, 0) AS third_col
FROM (
SELECT lp.ID AS PingID, MAX(lb.ID) AS BaseID
... |
46,582,362 | ```
// RecursiveBinarySearch.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#define N 9
int RecursiveBinarySearch(int A, int low, int high, int x);
int main()
{
int A[N];
int index = 0;
//Put
A[0] = 2;
A[1] = 6;
A[2] = 13;
A[3] = 21;
A[4] = 36;
... | 2017/10/05 | [
"https://Stackoverflow.com/questions/46582362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8724654/"
] | Better remove all assignements `A[0] = ..., A[1] = ...` alltogether and write:
```
int A[] = {2,6,13,21,36,47,63,81,97}
```
And replace
```
while (index <= 8)
```
by:
```
while (index < sizeof(A)/sizeof(A[0]))
```
`sizeof(A) / sizeof(A[0])` is the number of elements if the array `A`. `sizeof(A)` is the size in... | Start taking compiler warnings seriously:
```
helpPointer.c: In function ‘main’:
helpPointer.c:30:40: warning: passing argument 1 of ‘RecursiveBinarySearch’ makes integer from pointer without a cast [-Wint-conversion]
printf("%d", RecursiveBinarySearch(A, 0, 8, 63));
^
help... |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | Try adding a `height` property to `body` or parent container. | In addition to setting the height property of the map div to 100% you might need to implement [this](https://stackoverflow.com/questions/10762984/leaflet-map-not-displayed-properly-inside-tabbed-panel) to ensure that the map fills the div on a resize. |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | Try adding a `height` property to `body` or parent container. | ```
body {
padding: 0;
margin: 0;
}
html, body, #map, .row-fluid{
height: 100%;
}
#map {
width: 100%;
}
.height-css
{
height: 100%;
}
```
your html will be
```
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 height-css">
<div id="map"></div>
</div>... |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | Try adding a `height` property to `body` or parent container. | With CSS from project [Bootleaf](https://github.com/bmcbride/bootleaf) on Github:
```
html,body, #map{
height:100%;
width: 100%;
overflow: hidden;
}
body {
padding-top: 50px;
``` |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | **CCS**
```
#map
{
width: 100px;
height:100px;
min-height: 100%;
min-width: 100%;
display: block;
}
html, body
{
height: 100%;
}
.fill
{
min-height: 100%;
height: 100%;
width: 100%;
min-width: 100%;
}
```
**html**
```
<div class="container fill">
<div id="map">
<... | In addition to setting the height property of the map div to 100% you might need to implement [this](https://stackoverflow.com/questions/10762984/leaflet-map-not-displayed-properly-inside-tabbed-panel) to ensure that the map fills the div on a resize. |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | With CSS from project [Bootleaf](https://github.com/bmcbride/bootleaf) on Github:
```
html,body, #map{
height:100%;
width: 100%;
overflow: hidden;
}
body {
padding-top: 50px;
``` | In addition to setting the height property of the map div to 100% you might need to implement [this](https://stackoverflow.com/questions/10762984/leaflet-map-not-displayed-properly-inside-tabbed-panel) to ensure that the map fills the div on a resize. |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | **CCS**
```
#map
{
width: 100px;
height:100px;
min-height: 100%;
min-width: 100%;
display: block;
}
html, body
{
height: 100%;
}
.fill
{
min-height: 100%;
height: 100%;
width: 100%;
min-width: 100%;
}
```
**html**
```
<div class="container fill">
<div id="map">
<... | ```
body {
padding: 0;
margin: 0;
}
html, body, #map, .row-fluid{
height: 100%;
}
#map {
width: 100%;
}
.height-css
{
height: 100%;
}
```
your html will be
```
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 height-css">
<div id="map"></div>
</div>... |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | **CCS**
```
#map
{
width: 100px;
height:100px;
min-height: 100%;
min-width: 100%;
display: block;
}
html, body
{
height: 100%;
}
.fill
{
min-height: 100%;
height: 100%;
width: 100%;
min-width: 100%;
}
```
**html**
```
<div class="container fill">
<div id="map">
<... | With CSS from project [Bootleaf](https://github.com/bmcbride/bootleaf) on Github:
```
html,body, #map{
height:100%;
width: 100%;
overflow: hidden;
}
body {
padding-top: 50px;
``` |
16,885,729 | I just wanted to know if there is an option to do a JButton inside here:
```
if(RandomNrJeden <= 50)
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed to be green.");
JButton dialogOdp = new JButton();
}
else
{
JOptionPane.showMessageDialog(frameKontrastGame, "Eggs are not supposed ... | 2013/06/02 | [
"https://Stackoverflow.com/questions/16885729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2445239/"
] | With CSS from project [Bootleaf](https://github.com/bmcbride/bootleaf) on Github:
```
html,body, #map{
height:100%;
width: 100%;
overflow: hidden;
}
body {
padding-top: 50px;
``` | ```
body {
padding: 0;
margin: 0;
}
html, body, #map, .row-fluid{
height: 100%;
}
#map {
width: 100%;
}
.height-css
{
height: 100%;
}
```
your html will be
```
<div class="container-fluid">
<div class="row-fluid">
<div class="span12 height-css">
<div id="map"></div>
</div>... |
21,241,326 | I'm trying to create a query to return the file with the max version, independent of the value of the server. How could I do that?
actual table data:
```
server filename v4 date
local code1.zip 41 0000-00-00
remote code1.zip 39 0000-00-00
local code1.zip 28 0000-00-00
remote code... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21241326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1323826/"
] | If you just want the row with largest v4 you can use this
```
SELECT
server,
filename,
v4,
date
FROM
`table`
WHERE
date ='0000-00-00'
ORDER BY v4 DESC
LIMIT 1
```
to get max V4 for each filename, first you get max(v4) group by filename then INNER JOIN back with `table` like below
```
SELECT ... | You could use this query:
```
Select Top 1 *
From table
Where v4 = (
SELECT
max(v4) as v4,
FROM
table
WHERE
date ='0000-00-00'
GROUP BY
v4
)
``` |
21,241,326 | I'm trying to create a query to return the file with the max version, independent of the value of the server. How could I do that?
actual table data:
```
server filename v4 date
local code1.zip 41 0000-00-00
remote code1.zip 39 0000-00-00
local code1.zip 28 0000-00-00
remote code... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21241326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1323826/"
] | To get the the max version you only have to do:
```
SELECT MAX(version) FROM table
```
If you also want the filename (if you have another column `id`):
```
SELECT t2.filename, t2.maxver
FROM table t1 INNER JOIN
(SELECT id, MAX(version) maxver
FROM table
GROUP BY id) t2 ON t1.id=t2.id
ORDER BY t2.maxver DESC
LIMI... | You could use this query:
```
Select Top 1 *
From table
Where v4 = (
SELECT
max(v4) as v4,
FROM
table
WHERE
date ='0000-00-00'
GROUP BY
v4
)
``` |
21,241,326 | I'm trying to create a query to return the file with the max version, independent of the value of the server. How could I do that?
actual table data:
```
server filename v4 date
local code1.zip 41 0000-00-00
remote code1.zip 39 0000-00-00
local code1.zip 28 0000-00-00
remote code... | 2014/01/20 | [
"https://Stackoverflow.com/questions/21241326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1323826/"
] | If you just want the row with largest v4 you can use this
```
SELECT
server,
filename,
v4,
date
FROM
`table`
WHERE
date ='0000-00-00'
ORDER BY v4 DESC
LIMIT 1
```
to get max V4 for each filename, first you get max(v4) group by filename then INNER JOIN back with `table` like below
```
SELECT ... | To get the the max version you only have to do:
```
SELECT MAX(version) FROM table
```
If you also want the filename (if you have another column `id`):
```
SELECT t2.filename, t2.maxver
FROM table t1 INNER JOIN
(SELECT id, MAX(version) maxver
FROM table
GROUP BY id) t2 ON t1.id=t2.id
ORDER BY t2.maxver DESC
LIMI... |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | You could try to open a remote-session with `Enter-PSSession` and then use the cmdlet `Start-Process` without `Invoke-Command`
You could also run the program like this `& "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl` (within the remote-session)
Finally you should exit the session with `Ex... | In the Start-Process call try using the -Wait parameter. |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | The solution suggested by Tom works for me. Here are the commands I used:
```
New-PSSession -computername TestMachine
Start-Process yourservice.exe
Exit-PSSession
```
Make sure to use `Exit-PSSession` and not `Remove-PSSession` so that the process `yourservice.exe` remains active after exiting the session. | In the Start-Process call try using the -Wait parameter. |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | This WMI solution worked best for me:
<https://social.technet.microsoft.com/Forums/scriptcenter/en-US/ead19612-5e7b-4012-8466-0d650232c7a5/invokecommand-and-startprocess?forum=ITCG> – Adam Driscoll (pointed to the same link)
Use:
```
([WMICLASS]"\\localhost\ROOT\CIMV2:win32_process").Create("something.exe argument1He... | In the Start-Process call try using the -Wait parameter. |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | You could try to open a remote-session with `Enter-PSSession` and then use the cmdlet `Start-Process` without `Invoke-Command`
You could also run the program like this `& "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl` (within the remote-session)
Finally you should exit the session with `Ex... | The solution suggested by Tom works for me. Here are the commands I used:
```
New-PSSession -computername TestMachine
Start-Process yourservice.exe
Exit-PSSession
```
Make sure to use `Exit-PSSession` and not `Remove-PSSession` so that the process `yourservice.exe` remains active after exiting the session. |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | You could try to open a remote-session with `Enter-PSSession` and then use the cmdlet `Start-Process` without `Invoke-Command`
You could also run the program like this `& "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl` (within the remote-session)
Finally you should exit the session with `Ex... | I had the exact same issue. Got it to work cleanly, with a combination of `[WMICLASS] 's create()` and `Start-Process`.
Check my answer [here](https://stackoverflow.com/a/35052591/1866983) |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | You could try to open a remote-session with `Enter-PSSession` and then use the cmdlet `Start-Process` without `Invoke-Command`
You could also run the program like this `& "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl` (within the remote-session)
Finally you should exit the session with `Ex... | This WMI solution worked best for me:
<https://social.technet.microsoft.com/Forums/scriptcenter/en-US/ead19612-5e7b-4012-8466-0d650232c7a5/invokecommand-and-startprocess?forum=ITCG> – Adam Driscoll (pointed to the same link)
Use:
```
([WMICLASS]"\\localhost\ROOT\CIMV2:win32_process").Create("something.exe argument1He... |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | The solution suggested by Tom works for me. Here are the commands I used:
```
New-PSSession -computername TestMachine
Start-Process yourservice.exe
Exit-PSSession
```
Make sure to use `Exit-PSSession` and not `Remove-PSSession` so that the process `yourservice.exe` remains active after exiting the session. | I had the exact same issue. Got it to work cleanly, with a combination of `[WMICLASS] 's create()` and `Start-Process`.
Check my answer [here](https://stackoverflow.com/a/35052591/1866983) |
9,236,949 | I am working on a script to remotely kill two processes, delete some folders, and launch a service as an application. Eventually this will be deployed to run against multiple servers, but I'm currently testing it against a single server. Everything works great except for the final step which is to launch the remote ser... | 2012/02/11 | [
"https://Stackoverflow.com/questions/9236949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1203211/"
] | This WMI solution worked best for me:
<https://social.technet.microsoft.com/Forums/scriptcenter/en-US/ead19612-5e7b-4012-8466-0d650232c7a5/invokecommand-and-startprocess?forum=ITCG> – Adam Driscoll (pointed to the same link)
Use:
```
([WMICLASS]"\\localhost\ROOT\CIMV2:win32_process").Create("something.exe argument1He... | I had the exact same issue. Got it to work cleanly, with a combination of `[WMICLASS] 's create()` and `Start-Process`.
Check my answer [here](https://stackoverflow.com/a/35052591/1866983) |
49,017,321 | I am running the following powershell command in a build step using TFS 2018.
```
Start-Job -ScriptBlock {
Invoke-Command -FilePath \\MyServer\run.ps1 -ComputerName MyServer -ArgumentList arg1, arg2
}
```
Since I don't want the script to affect the build step it should simply fire and forget the script. Hence I ... | 2018/02/27 | [
"https://Stackoverflow.com/questions/49017321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/621210/"
] | To simply *fire and forget*, invoke the script with `Invoke-Command -AsJob`:
```
Invoke-Command -AsJob -FilePath \\MyServer\run.ps1 -ComputerName MyServer -Args arg1, arg2
Start-Sleep 1 # !! Seemingly, this is necessary, as @doorman has discovered.
```
* This should kick off the script *remotely, asynchronously*, wi... | When do you want the script to *stop* running? You could use a [do-while](https://blogs.technet.microsoft.com/heyscriptingguy/2014/05/05/powershell-looping-understanding-and-using-do-while/) loop and come up with a `<condition>` that meets your needs.
```
Start-Job -ScriptBlock {
do{
Invoke-Command -FilePa... |
49,017,321 | I am running the following powershell command in a build step using TFS 2018.
```
Start-Job -ScriptBlock {
Invoke-Command -FilePath \\MyServer\run.ps1 -ComputerName MyServer -ArgumentList arg1, arg2
}
```
Since I don't want the script to affect the build step it should simply fire and forget the script. Hence I ... | 2018/02/27 | [
"https://Stackoverflow.com/questions/49017321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/621210/"
] | To simply *fire and forget*, invoke the script with `Invoke-Command -AsJob`:
```
Invoke-Command -AsJob -FilePath \\MyServer\run.ps1 -ComputerName MyServer -Args arg1, arg2
Start-Sleep 1 # !! Seemingly, this is necessary, as @doorman has discovered.
```
* This should kick off the script *remotely, asynchronously*, wi... | Why not something like this:
```
Invoke-Command -Filepath \\MyServer\Run.ps1 -Computername MyServer -Argumentlist Arg1,Arg2 -AsJob
$JobCount = (get-job).Count
Do
{
Start-Sleep -Seconds 1
$totalJobCompleted = (get-job | Where-Object {$_.state -eq "Completed"} | Where-Object {$_.Command -like "NAMEOFCOMMAND*"}).... |
49,017,321 | I am running the following powershell command in a build step using TFS 2018.
```
Start-Job -ScriptBlock {
Invoke-Command -FilePath \\MyServer\run.ps1 -ComputerName MyServer -ArgumentList arg1, arg2
}
```
Since I don't want the script to affect the build step it should simply fire and forget the script. Hence I ... | 2018/02/27 | [
"https://Stackoverflow.com/questions/49017321",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/621210/"
] | To simply *fire and forget*, invoke the script with `Invoke-Command -AsJob`:
```
Invoke-Command -AsJob -FilePath \\MyServer\run.ps1 -ComputerName MyServer -Args arg1, arg2
Start-Sleep 1 # !! Seemingly, this is necessary, as @doorman has discovered.
```
* This should kick off the script *remotely, asynchronously*, wi... | @doorman -
PowerShell is natively a single threaded application. In almost all cases, this is a huge benefit. Even forcing multiple threads, you can see the child threads are always dependent on the main thread. If this wasn't the case, it would be very easy to create memory leaks. This is almost always a good thing a... |
18,081,332 | Why would I ever run Html controls on the server? As in, why would I want to do this?
```
<p runat = "server">This is a paragraph.</p>
``` | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/303685/"
] | One reason you might want to use the HTML controls versus the server controls is to force the rendered HTML to be of a certain element.
For example, a `GridView` by default will render as an HTML table, but you may want it to render as DIVs for a table-less layout.
HTML controls give your more flexibility in the HT... | If you wanted to reference it in the code-behind. Like this:
```
<p id="myParagraph", runat="server"> ...
```
and then in the code-behind:
```
this.myParagraph.Visible = false;
```
I'm not saying you'd set the `Visible` property, I just used it as an example.
Now, the way you have the `<p>` marked up now, you wo... |
18,081,332 | Why would I ever run Html controls on the server? As in, why would I want to do this?
```
<p runat = "server">This is a paragraph.</p>
``` | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/303685/"
] | If you wanted to reference it in the code-behind. Like this:
```
<p id="myParagraph", runat="server"> ...
```
and then in the code-behind:
```
this.myParagraph.Visible = false;
```
I'm not saying you'd set the `Visible` property, I just used it as an example.
Now, the way you have the `<p>` marked up now, you wo... | This allows you to set the value and control all attributes server-side
```
<p id="p" runat="server">Value<p>
```
Code Behind:
```
p.Visible = true;
p.text = "NewValue";
p.attributes.add("style", "width:90px");
```
[This link has more info](http://msdn.microsoft.com/en-us/library/7a9d6h4f%28v=vs.100%29.aspx) |
18,081,332 | Why would I ever run Html controls on the server? As in, why would I want to do this?
```
<p runat = "server">This is a paragraph.</p>
``` | 2013/08/06 | [
"https://Stackoverflow.com/questions/18081332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/303685/"
] | One reason you might want to use the HTML controls versus the server controls is to force the rendered HTML to be of a certain element.
For example, a `GridView` by default will render as an HTML table, but you may want it to render as DIVs for a table-less layout.
HTML controls give your more flexibility in the HT... | This allows you to set the value and control all attributes server-side
```
<p id="p" runat="server">Value<p>
```
Code Behind:
```
p.Visible = true;
p.text = "NewValue";
p.attributes.add("style", "width:90px");
```
[This link has more info](http://msdn.microsoft.com/en-us/library/7a9d6h4f%28v=vs.100%29.aspx) |
42,948,979 | I would like to create routes that support query string.
When i say support i mean, passing it to the next route some how.
For example:
given this route: `domain/home?lang=eng`
and when moving to route `domain/about` i want it to keep the Query String and display `domain/about?lang=eng`.
I was sure there... | 2017/03/22 | [
"https://Stackoverflow.com/questions/42948979",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3148807/"
] | For react-router 4.x, try
`const { history }
history.push('/about' + history.location.search)`
To access `this.props.history`, make sure you have wrapped the component with `withRouter` HOC
`import { withRouter } from 'react-router-dom'
...
export default withRouter(component)`
refer <https://github.com/ReactTraini... | You will have to "forward" query param on each page transition - bothering and you can easily forgot to...
Instead, I would do this.
* read stored/persisted `lang` preference. `localStorage` is good candidate here. Fallback to default language, when no preference is found
* share `lang` via context, so that each and ... |
55,647,767 | I have very big Stream of versioned documents ordered by document id and version.
E.g. Av1, Av2, Bv1, Cv1, Cv2
I have to convert this into another Stream whose records are aggregated by document id.
A[v1, v2], B[v1], C[v1, V2]
Can this be done without using `Collectors.groupBy()`? I don't want to use `groupBy()` be... | 2019/04/12 | [
"https://Stackoverflow.com/questions/55647767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/322276/"
] | Here's a solution I came up with:
```
Stream<Document> stream = Stream.of(
new Document("A", "v1"),
new Document("A", "v2"),
new Document("B", "v1"),
new Document("C", "v1"),
new Document("C", "v2")
);
Iterator<Document> iterator = stream.iterato... | Would a `Map<String, Stream<String>>` help you with what you need ?
>
> A - v1, v2
>
> B - v1
>
> C - v1, v2
>
>
>
>
```
String[] docs = { "Av1", "Av2", "Bv1", "Cv1", "Cv2"};
Map<String, Stream<String>> map = Stream.<String>of(docs).
map(s ->s.substring(0, 1)).distinct(). ... |
55,647,767 | I have very big Stream of versioned documents ordered by document id and version.
E.g. Av1, Av2, Bv1, Cv1, Cv2
I have to convert this into another Stream whose records are aggregated by document id.
A[v1, v2], B[v1], C[v1, V2]
Can this be done without using `Collectors.groupBy()`? I don't want to use `groupBy()` be... | 2019/04/12 | [
"https://Stackoverflow.com/questions/55647767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/322276/"
] | You can use [`groupRuns`](http://amaembo.github.io/streamex/javadoc/one/util/streamex/StreamEx.html#groupRuns-java.util.function.BiPredicate-) in the [StreamEx library](https://github.com/amaembo/streamex) for this:
```
class Document {
public String id;
public int version;
public Document(String id, int v... | Would a `Map<String, Stream<String>>` help you with what you need ?
>
> A - v1, v2
>
> B - v1
>
> C - v1, v2
>
>
>
>
```
String[] docs = { "Av1", "Av2", "Bv1", "Cv1", "Cv2"};
Map<String, Stream<String>> map = Stream.<String>of(docs).
map(s ->s.substring(0, 1)).distinct(). ... |
26,348,468 | I'm trying to set up Minecraft Forge SDK. I need to set up the JAVA\_HOME variable:
```
kiwi@kiwi-gigabyte:~/Desktop/forge-1.7.10-10.13.0.1180-src$ export $JAVA_HOME '/usr/lib/jvm/java-7-openjdk-i386/bin'
bash: export: `/usr/lib/jvm/java-7-openjdk-i386': invalid identifier
bash: export: `/usr/lib/jvm/java-7-openjdk-i3... | 2014/10/13 | [
"https://Stackoverflow.com/questions/26348468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3908500/"
] | The syntax is this:
```
export VAR='value'
```
So use
```
export JAVA_HOME='/usr/lib/jvm/java-7-openjdk-i386/bin'
``` | If you've got Bash:
```
export JAVA_HOME='/usr/lib/jvm/java-7-openjdk-i386/bin'
```
See how that works. No dollar sign and use equals, only difference. |
43,934,799 | When I tried to install fresh Wordpress package in the local system(Window 10), I got this error:
>
> Fatal error: require(): Failed opening required
>
> 'C:\xampp\htdocs\wordpress/wp-blog-header.php'
> (include\_path='.;C:\xampp\php\PEAR')
> in C:\xampp\htdocs\wordpress\index.php on line 17
>
>
>
For Loca... | 2017/05/12 | [
"https://Stackoverflow.com/questions/43934799",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8002137/"
] | It may be occurred due to some files are missing..
Download a fresh copy of the WordPress .zip file to your computer, unzip it, and use that to copy up all files and folders EXCEPT the wp-config.php file and the /wp-content/directory. You may need to delete the old wp-admin and wp-include folders.
Note- Please backup... | I faced the same error.
The solution is to simply extract the WordPress zip folder content into `htdocs` ( if you are using xampp ) or into `www` (if you are using wampp ).
Just do not extract it somewhere else and then into htdocs, or else it won't work. |
34,846,276 | I am trying to make a navbar `scrollToggle` after the window is scrolled `200px`.
My code is as follows:
```
$(document).ready(function(){
$(window).scroll(function(){
if($(this).scrollTop() > 200){
$('.upper-header').slideToggle('slow');
}
});
});
```
Ideally the navbar would di... | 2016/01/18 | [
"https://Stackoverflow.com/questions/34846276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5803196/"
] | Basically all what you need to do is to have a flag or a control `toggleIt` to only make the `toggleSlide()` plays once as long as the flag is `true` if the scroll position is more than `200px`.
Same thing for toggling the slide animation when the scroll position is less than or equal to `200px`, `slideToggle()` will ... | This might provide a good start.
I made it scroll after 300px, for effect -- watch the orange window.
`[**jsFiddle Demo**](https://jsfiddle.net/wmd41Lac/)`
**JS:**
```
var st, slid=false;
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments... |
60,279,958 | How can I show the next div with class `form_section` by clicking `.btn_next`?
```js
$(".form_section").hide();
$(document).on("click", ".btn_next", function(e) {
$(this).next(".form_section").show();
});
```
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div... | 2020/02/18 | [
"https://Stackoverflow.com/questions/60279958",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10949054/"
] | first you need to hide current "`.form_section`" section (to the button which was clicked), then get the next `.form_section` to show.
```
<script>
//$(".form_section").hide();
$(document).on("click", ".btn_next", function(e){
$(this).parents('.form_section').hide();
$(this).pa... | To achieve this you need to traverse the DOM to retrieve the nearest parent `.form_section` to the button which was clicked, hide it, then get the next `.form_section` to show.
To do that you can use a combination of `closest()`, `hide()`, `next()` and `show()`. Try this:
```js
$(document).on("click", ".btn_next", fu... |
9,032 | I am trying to implement an adjustment to the default .phtml files that are shipped with magento. I am a little confused as to how the .phtml files are altered without adjusting them directly, consequently I am failing to get this to work. The example I will use is the account dashboard heading (found on `storeName.loc... | 2013/10/07 | [
"https://magento.stackexchange.com/questions/9032",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/2732/"
] | As far as I know the heading is located in the file `customer/account/dashboard.phtml`. To overwrite this from your custom extensions layout XML, or the `local.xml` please add the following
```
<customer_account_index>
<reference name="customer_account_dashboard">
<action method="setTemplate"><template>[modul... | I may have confused you earlier with my [overly long post](https://magento.stackexchange.com/a/8957/3408).
Start by creating a new theme. Note the base theme is a folder called `app/design/frontend/default/base/`. Let's pretend your theme is "tony" and create a folder called `app/design/frontend/default/tony/`. Now go... |
59,409,376 | I would like to check every so often if exists a new version of my app, and if it´s, show a message to user. I use Firebase, connecting and comparing version from remote config with current version of app. This isn´t the problem, my problem is how to show the dialog at any time, in any activity.
I have a BaseActivity... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9686461/"
] | You can get this result with a `JOIN`, by self-joining on the `color` field, where the name in the second table is `jose`:
```
SELECT a1.name, a1.color
FROM tableA a1
JOIN tableA a2 ON a2.color = a1.color AND a2.name = 'jose'
```
Output
```
name color
jose red
Rap red
```
[SQL Server demo on SQLFIddle](... | If names have only one color, then you would seem to want:
```
select a.*
from tableA a
where a.color = (select a2.color from tableA a2 where a2.name = 'jose');
```
You might want to add another condition that `a.name <> 'jose'` if you don't want to return that row. |
59,409,376 | I would like to check every so often if exists a new version of my app, and if it´s, show a message to user. I use Firebase, connecting and comparing version from remote config with current version of app. This isn´t the problem, my problem is how to show the dialog at any time, in any activity.
I have a BaseActivity... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9686461/"
] | You can get this result with a `JOIN`, by self-joining on the `color` field, where the name in the second table is `jose`:
```
SELECT a1.name, a1.color
FROM tableA a1
JOIN tableA a2 ON a2.color = a1.color AND a2.name = 'jose'
```
Output
```
name color
jose red
Rap red
```
[SQL Server demo on SQLFIddle](... | I think the best way is "CTE" :
```
with
cte1 as (
select 1 as RowToJoin,
name,
color
from tableA
),
cte2 as (
select 1 as RowToJoin,
color
name
from tableA
where name='jose'
... |
44,688,322 | I'm trying to create a UITableViewCell which contains 3 subviews - a button, and two labels. The table view cell should look like this:
```
Button --Label 1-----------
--Label 1 continued--
--Label 2-----------------
--Label 2 continued ------
```
Currently, I have button one, with leading, top, width, a... | 2017/06/22 | [
"https://Stackoverflow.com/questions/44688322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7587035/"
] | **tl;dr** no particular difference, but if I were to choose, I'd use `bin/rails`
There's little to no difference. Let us see.
`DISABLE_SPRING=1 bin/rails --version`:
`bin/rails`: [`require_relative '../config/boot'`](https://github.com/rails/rails/blob/v5.2.1/railties/lib/rails/generators/rails/app/templates/bin/rai... | Bundle exec is a Bundler command.
You should use bundle exec in all the cases as it
>
> bundle-exec - Execute a command in the context of the bundle
>
>
>
More info can be found here: <http://bundler.io/v1.15/bundle_exec.html>
bin/rails might work but only if all the required gems/executables are present on you... |
44,688,322 | I'm trying to create a UITableViewCell which contains 3 subviews - a button, and two labels. The table view cell should look like this:
```
Button --Label 1-----------
--Label 1 continued--
--Label 2-----------------
--Label 2 continued ------
```
Currently, I have button one, with leading, top, width, a... | 2017/06/22 | [
"https://Stackoverflow.com/questions/44688322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7587035/"
] | `bundle exec` just ensures that all gems in Gemfile are installed (globally or on userspace or in `vendor/bundle` directory of the project) when running the command. It's explained in more detail in <https://bundler.io/man/bundle-exec.1.html> (especifically <https://bundler.io/man/bundle-exec.1.html#BUNDLE-INSTALL-BINS... | Bundle exec is a Bundler command.
You should use bundle exec in all the cases as it
>
> bundle-exec - Execute a command in the context of the bundle
>
>
>
More info can be found here: <http://bundler.io/v1.15/bundle_exec.html>
bin/rails might work but only if all the required gems/executables are present on you... |
44,688,322 | I'm trying to create a UITableViewCell which contains 3 subviews - a button, and two labels. The table view cell should look like this:
```
Button --Label 1-----------
--Label 1 continued--
--Label 2-----------------
--Label 2 continued ------
```
Currently, I have button one, with leading, top, width, a... | 2017/06/22 | [
"https://Stackoverflow.com/questions/44688322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7587035/"
] | **tl;dr** no particular difference, but if I were to choose, I'd use `bin/rails`
There's little to no difference. Let us see.
`DISABLE_SPRING=1 bin/rails --version`:
`bin/rails`: [`require_relative '../config/boot'`](https://github.com/rails/rails/blob/v5.2.1/railties/lib/rails/generators/rails/app/templates/bin/rai... | `bundle exec` just ensures that all gems in Gemfile are installed (globally or on userspace or in `vendor/bundle` directory of the project) when running the command. It's explained in more detail in <https://bundler.io/man/bundle-exec.1.html> (especifically <https://bundler.io/man/bundle-exec.1.html#BUNDLE-INSTALL-BINS... |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | The GIMP - Gnu Image Manipulation Program. Yet another fine example of why you don't let the devs name the product.
All three platforms supported, lots of powerful tools, both Free and free.
<https://www.gimp.org/downloads/> | Take a look at these programs:
* darktable
* RAWtherapee
* Corel Aftershot Pro
* affinity photo
* Portrait Pro
* Corel Paint Shop Pro
* Gimp |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | You might look at darktable: <https://www.darktable.org>. | I use GIMP as well for advanced editing, but for simpler things I sometimes will reach for something more lightweight (both free):
* [Paint.NET](https://www.getpaint.net/) - basic layering, color filters, etc
* [Inkscape](https://inkscape.org/) - vector/path editing, handles wide variety of formats |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | You might look at darktable: <https://www.darktable.org>. | You probably want [<https://www.photopea.com>](https://www.photopea.com "example") online editor. Very similar to photoshop. |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | The GIMP - Gnu Image Manipulation Program. Yet another fine example of why you don't let the devs name the product.
All three platforms supported, lots of powerful tools, both Free and free.
<https://www.gimp.org/downloads/> | If you have iOS you can buy the [ProCreate App](https://procreate.art/) for ~ 15 Euros (paid once, no subscription). It works best with the Apple Pencil.
On Android there is, for instance [AutoDesk SketchBook](https://play.google.com/store/apps/details?id=com.adsk.sketchbook).
Many, many other apps are available for... |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | You might look at darktable: <https://www.darktable.org>. | If you have iOS you can buy the [ProCreate App](https://procreate.art/) for ~ 15 Euros (paid once, no subscription). It works best with the Apple Pencil.
On Android there is, for instance [AutoDesk SketchBook](https://play.google.com/store/apps/details?id=com.adsk.sketchbook).
Many, many other apps are available for... |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | I use GIMP as well for advanced editing, but for simpler things I sometimes will reach for something more lightweight (both free):
* [Paint.NET](https://www.getpaint.net/) - basic layering, color filters, etc
* [Inkscape](https://inkscape.org/) - vector/path editing, handles wide variety of formats | Take a look at these programs:
* darktable
* RAWtherapee
* Corel Aftershot Pro
* affinity photo
* Portrait Pro
* Corel Paint Shop Pro
* Gimp |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | If you have iOS you can buy the [ProCreate App](https://procreate.art/) for ~ 15 Euros (paid once, no subscription). It works best with the Apple Pencil.
On Android there is, for instance [AutoDesk SketchBook](https://play.google.com/store/apps/details?id=com.adsk.sketchbook).
Many, many other apps are available for... | You probably want [<https://www.photopea.com>](https://www.photopea.com "example") online editor. Very similar to photoshop. |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | I use GIMP as well for advanced editing, but for simpler things I sometimes will reach for something more lightweight (both free):
* [Paint.NET](https://www.getpaint.net/) - basic layering, color filters, etc
* [Inkscape](https://inkscape.org/) - vector/path editing, handles wide variety of formats | If you have iOS you can buy the [ProCreate App](https://procreate.art/) for ~ 15 Euros (paid once, no subscription). It works best with the Apple Pencil.
On Android there is, for instance [AutoDesk SketchBook](https://play.google.com/store/apps/details?id=com.adsk.sketchbook).
Many, many other apps are available for... |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | I use GIMP as well for advanced editing, but for simpler things I sometimes will reach for something more lightweight (both free):
* [Paint.NET](https://www.getpaint.net/) - basic layering, color filters, etc
* [Inkscape](https://inkscape.org/) - vector/path editing, handles wide variety of formats | You probably want [<https://www.photopea.com>](https://www.photopea.com "example") online editor. Very similar to photoshop. |
58,667 | This is, essentially, a Dock replacer on steroids - dating back to before the Dock even existed.
I've been using [DragThing](https://www.dragthing.com/english/about.html) since v1.0 in the mid 1990's so it's fair to say I'm rather used to it & will be sad to see it finally die after macOS 10.15. The author has announc... | 2019/04/22 | [
"https://softwarerecs.stackexchange.com/questions/58667",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/22850/"
] | The GIMP - Gnu Image Manipulation Program. Yet another fine example of why you don't let the devs name the product.
All three platforms supported, lots of powerful tools, both Free and free.
<https://www.gimp.org/downloads/> | You might look at darktable: <https://www.darktable.org>. |
35,296,213 | in Windows 10 app I try to read string from .txt file and set the text to RichEditBox:
Code variant 1:
```
var read = await FileIO.ReadTextAsync(file, Windows.Storage.Streams.UnicodeEncoding.Utf8);
txt.Document.SetText(Windows.UI.Text.TextSetOptions.None, read);
```
Code variant 2:
```
var stream = await file.Open... | 2016/02/09 | [
"https://Stackoverflow.com/questions/35296213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5235485/"
] | Challenge here is the encoding and it depends how much accuracy you need for your application.
If you need something fast and simple you can adapt this [answer](https://stackoverflow.com/questions/3825390/effective-way-to-find-any-files-encoding)
```
public static Encoding GetEncoding(byte[4] bom)
{
/... | Solution:
1) I made a port of Mozilla Universal Charset Detector to UWP (added to [Nuget](https://www.nuget.org/packages/UDE.CSharp.UWP/))
```
ICharsetDetector cdet = new CharsetDetector();
cdet.Feed(fileContent, 0, fileContent.Length);
cdet.DataEnd();
```
2) Nuget library [Portable.Text.Encoding](https://www.nuget... |
35,296,213 | in Windows 10 app I try to read string from .txt file and set the text to RichEditBox:
Code variant 1:
```
var read = await FileIO.ReadTextAsync(file, Windows.Storage.Streams.UnicodeEncoding.Utf8);
txt.Document.SetText(Windows.UI.Text.TextSetOptions.None, read);
```
Code variant 2:
```
var stream = await file.Open... | 2016/02/09 | [
"https://Stackoverflow.com/questions/35296213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5235485/"
] | Challenge here is the encoding and it depends how much accuracy you need for your application.
If you need something fast and simple you can adapt this [answer](https://stackoverflow.com/questions/3825390/effective-way-to-find-any-files-encoding)
```
public static Encoding GetEncoding(byte[4] bom)
{
/... | ```
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/FontFiles/" + fileName));
using (var inputStream = await file.OpenReadAsync())
using (var classicStream = inputStream.AsStreamForRead())
using (var streamReader = new StreamReader(classicSt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.