qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
65,851,068
Let's consider a dataset: | name | age | | --- | --- | | Max | 33 | | Adam | 32 | | Zim | 41 | | Muller | 62 | Now, if we run this query on dataset `x`: ``` x.as("a").join(x.as("b")).where( $"b.age" - $"a.age" <= 10 and $"a.age" > $"b.age").show() ``` | name | age | name | age | | --- | --- | -...
2021/01/22
[ "https://Stackoverflow.com/questions/65851068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5019169/" ]
Using `gnu-awk` it can be simplified to: ```sh awk -F, '$3 > 100 {++c} ENDFILE {print c, FILENAME; c=0}' f1 f2 1 f1 3 f2 ```
With GNU awk for ENDFILE: ``` $ awk -F, '(NF==3) && ($3>100){c++} ENDFILE{print c+0, FILENAME; c=0}' f1 f2 1 f1 3 f2 ```
48,324,107
I used `beautifulsoup` library to get data from a webpage <http://open.dataforcities.org/details?4[]=2016> ``` import urllib2 from bs4 import BeautifulSoup soup = BeautifulSoup(urllib2.urlopen('http://open.dataforcities.org/details?4[]=2016').read()) ``` Now `soup` looks like the following (I show just a part of it...
2018/01/18
[ "https://Stackoverflow.com/questions/48324107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3590067/" ]
Since you're using an array, change this: ``` {{ $args->name }} {{ $args->email }} ``` To: ``` {{ $args['name'] }} {{ $args['email'] }} ```
You are trying to access an object value, but you are sending an array to your view. ``` $payments = Payments::getPaymentByClient($id); $args = array([ 'name' => 'Robin', 'email' => 'asdasd@asdasd.net', 'activity' => $payments, // Expecting a collection ]); return view('clients.show', [ "args" => (object) $a...
48,324,107
I used `beautifulsoup` library to get data from a webpage <http://open.dataforcities.org/details?4[]=2016> ``` import urllib2 from bs4 import BeautifulSoup soup = BeautifulSoup(urllib2.urlopen('http://open.dataforcities.org/details?4[]=2016').read()) ``` Now `soup` looks like the following (I show just a part of it...
2018/01/18
[ "https://Stackoverflow.com/questions/48324107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3590067/" ]
Since you're using an array, change this: ``` {{ $args->name }} {{ $args->email }} ``` To: ``` {{ $args['name'] }} {{ $args['email'] }} ```
Got it. A silly mistake, but I'm just learning Laravel. I was including $args in the View rather than just $name, $email and $activity which worked perfectly. Thanks anyway.
57,686,881
I have a little problem becouse I read values of labels and after that i want to set img src dependent on value label Here some code and i see that is img attr don't add getState generate divs with content At the end is ajax call function where i get values from database and write them to the dynamically generated...
2019/08/28
[ "https://Stackoverflow.com/questions/57686881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11977278/" ]
first of all, **welcome to StackOverflow :)** 2 things in your code to avoid in the future: * DRY: Don't Repeat Yourself - every time you're writing the same thing over and over, you're doing it wrong :) * To be precise, always use `===` instead of `==` the later will give `true` for `1 == "1"` and it's better to avo...
remove **closet()** and put **find()** ```js function ChangeImage() { let labels = $('label[data-id]'); $.each(labels, function (i, x) { var states = $(x).text(); switch(states) { case "Active": $(this).find('img').attr("src",...
57,686,881
I have a little problem becouse I read values of labels and after that i want to set img src dependent on value label Here some code and i see that is img attr don't add getState generate divs with content At the end is ajax call function where i get values from database and write them to the dynamically generated...
2019/08/28
[ "https://Stackoverflow.com/questions/57686881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11977278/" ]
first of all, **welcome to StackOverflow :)** 2 things in your code to avoid in the future: * DRY: Don't Repeat Yourself - every time you're writing the same thing over and over, you're doing it wrong :) * To be precise, always use `===` instead of `==` the later will give `true` for `1 == "1"` and it's better to avo...
**SOLUTION:** If you are using HTML as in the following code snippet, you can use siblings([selector]) to read the matching sibling element and to change the src of the image. ```html <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> </head> <b...
57,686,881
I have a little problem becouse I read values of labels and after that i want to set img src dependent on value label Here some code and i see that is img attr don't add getState generate divs with content At the end is ajax call function where i get values from database and write them to the dynamically generated...
2019/08/28
[ "https://Stackoverflow.com/questions/57686881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11977278/" ]
remove **closet()** and put **find()** ```js function ChangeImage() { let labels = $('label[data-id]'); $.each(labels, function (i, x) { var states = $(x).text(); switch(states) { case "Active": $(this).find('img').attr("src",...
**SOLUTION:** If you are using HTML as in the following code snippet, you can use siblings([selector]) to read the matching sibling element and to change the src of the image. ```html <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> </head> <b...
46,951,527
I want to scrapy the table of this page, but the scrapped data is only in one column, and in some case the data doesn't appear. Also I use the shell to see if the Xpath is correct (I use the Xpath helper to identify these xpath) ``` import scrapy class ToScrapeSpiderXPath(scrapy.Spider): name = 'scrape-xpath' ...
2017/10/26
[ "https://Stackoverflow.com/questions/46951527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8833211/" ]
The problem was deal with fact that I run my frontend from NetBeans. The NetBeans' console is pretty good, but chrome's one give me idea about CORS-conflict. I have no idea why didn't CORS-conflict display in django's output, but when I installed 'django-cors-headers' according to oficial [docs](https://github.com/otto...
In django rest framework request, GET parameters are not present in the `request.data`. They are query parameters rather than data. So they are placed under `request.query_params`. Access data from request.query\_params in get request [see the doc](http://www.django-rest-framework.org/api-guide/filtering/#filtering-ag...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
It looks like you are just counting the total number of matches. ie you will be matching 3 twice (counter = 3 now) and z once for a total of 4. When I run this code with the array I get counter = 4; I think the following code will return the number of distinct duplicates (number with a duplicate, no matter how many t...
According to your logic, if you have more than 2 duplicates,the function will return false, maybe you should use "counter>1" for judge, and the counter definition should be placed in the outer iteration. And I think the algorithm is not clever enough.
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
In your existing code you are counting the number of pairs rather than finding duplicates. You should check counter separately for each 'i'. ``` public static boolean twoDuplicates(int[] values) { boolean twoDuplicate = false; for(int i = 0; i < values.length; i++){ int counter = 0; for(int z = i + 1; z <= values.le...
According to your logic, if you have more than 2 duplicates,the function will return false, maybe you should use "counter>1" for judge, and the counter definition should be placed in the outer iteration. And I think the algorithm is not clever enough.
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
It looks like you are just counting the total number of matches. ie you will be matching 3 twice (counter = 3 now) and z once for a total of 4. When I run this code with the array I get counter = 4; I think the following code will return the number of distinct duplicates (number with a duplicate, no matter how many t...
Situation is like that: First loop reads first 3. Second loop reads second and third 3s. Counter becomes 2. First loop reads second 3. Second loop reads third 3. Counter becomes 3. First loop reads third 3. Second loop cannot find anything. Counter is 3. First loop reads first 6. Second loop reads second 6. Counter is...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
It looks like you are just counting the total number of matches. ie you will be matching 3 twice (counter = 3 now) and z once for a total of 4. When I run this code with the array I get counter = 4; I think the following code will return the number of distinct duplicates (number with a duplicate, no matter how many t...
1 . You need to remember the value of the first duplicate pair found. Otherwise, in a row 3,3,3 - you will find 3 two times. So store the first duplication value and compare this is not it. ``` int firstDuplicate; if(i != z && values[i] == values[z]) { if (counter == 0) { counter++; firstD...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
It looks like you are just counting the total number of matches. ie you will be matching 3 twice (counter = 3 now) and z once for a total of 4. When I run this code with the array I get counter = 4; I think the following code will return the number of distinct duplicates (number with a duplicate, no matter how many t...
this is how I would do it with just one loop ``` public static boolean twoDuplicates(int[] values) { HashSet<Integer> map = new HashSet<Integer>(); int cont = 0; for (int i = 0; i < values.length; i++) { if (map.contains(values[i])){ cont++; if (cont == 2) ...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
In your existing code you are counting the number of pairs rather than finding duplicates. You should check counter separately for each 'i'. ``` public static boolean twoDuplicates(int[] values) { boolean twoDuplicate = false; for(int i = 0; i < values.length; i++){ int counter = 0; for(int z = i + 1; z <= values.le...
Situation is like that: First loop reads first 3. Second loop reads second and third 3s. Counter becomes 2. First loop reads second 3. Second loop reads third 3. Counter becomes 3. First loop reads third 3. Second loop cannot find anything. Counter is 3. First loop reads first 6. Second loop reads second 6. Counter is...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
In your existing code you are counting the number of pairs rather than finding duplicates. You should check counter separately for each 'i'. ``` public static boolean twoDuplicates(int[] values) { boolean twoDuplicate = false; for(int i = 0; i < values.length; i++){ int counter = 0; for(int z = i + 1; z <= values.le...
1 . You need to remember the value of the first duplicate pair found. Otherwise, in a row 3,3,3 - you will find 3 two times. So store the first duplication value and compare this is not it. ``` int firstDuplicate; if(i != z && values[i] == values[z]) { if (counter == 0) { counter++; firstD...
16,006,911
In this creation of an object,unexpected string error appears. Is this declaration incorrect? ``` var all_coupons = { "merchant" : hostName , "coupons" : [ 0 : { "coupon_code" : coupon_file.coupon[0].coupon , "coupon_valid" : false , "coupon_status" : fal...
2013/04/15
[ "https://Stackoverflow.com/questions/16006911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2279446/" ]
In your existing code you are counting the number of pairs rather than finding duplicates. You should check counter separately for each 'i'. ``` public static boolean twoDuplicates(int[] values) { boolean twoDuplicate = false; for(int i = 0; i < values.length; i++){ int counter = 0; for(int z = i + 1; z <= values.le...
this is how I would do it with just one loop ``` public static boolean twoDuplicates(int[] values) { HashSet<Integer> map = new HashSet<Integer>(); int cont = 0; for (int i = 0; i < values.length; i++) { if (map.contains(values[i])){ cont++; if (cont == 2) ...
15,077,423
I am trying to match a song (in BBone world) through Rails to the DB. I continually am getting a `POST http://localhost:3000/songs 401 (Unauthorized)` when trying to save in the BBone View. The rails console error is below. It appears that the parameter sent to Rails is duplicated in fields (data removed is below the R...
2013/02/25
[ "https://Stackoverflow.com/questions/15077423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234721/" ]
I attached the CSRF param and token to the model to send to the database. ``` //To pass the variable safely in from BBone to Rails 3.2, you have to include the csrf param and token toBeSavedSong.set($("meta[name=csrf-param]").attr('content'), $("meta[name=csrf-token]").attr('content')); ```
The CSRF token should be included in the ajax request to have this successful. Solutions for you: Make sure your page has CSRF token in the "" section. If not, it could be because you miss a tag in your application.html.erb layout file. There should be "<%= csrf\_meta\_tags %>" in the layout ``` <!DOCTYPE html> <htm...
62,065,340
I am trying to filter a file name down for example, what i want to do is filter to the underscore and leave the rest. Info10\_ComputerHostName so i run ``` $FileName="Info10_ComputerHostName" $FinalFileName = $FileName -split("*._") ``` When i output the variable what i get " ComputerHostName" What I want "Computer...
2020/05/28
[ "https://Stackoverflow.com/questions/62065340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13634586/" ]
`null` is a valid element of an array, so you have to be prepared to handle these. For example: ``` int counter = stream.filter(c -> c != null && c.contains("something")).count(); ```
You have to filter for `null` values first. Do it either the way @pafauk. answered or by filtering sepraretly. That requires the `null` filter to be applied **before** the one you already use: ``` public static void main(String[] args) { List<String> chainedChars = new ArrayList<>(); chainedChars.add("somethin...
62,065,340
I am trying to filter a file name down for example, what i want to do is filter to the underscore and leave the rest. Info10\_ComputerHostName so i run ``` $FileName="Info10_ComputerHostName" $FinalFileName = $FileName -split("*._") ``` When i output the variable what i get " ComputerHostName" What I want "Computer...
2020/05/28
[ "https://Stackoverflow.com/questions/62065340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13634586/" ]
`null` is a valid element of an array, so you have to be prepared to handle these. For example: ``` int counter = stream.filter(c -> c != null && c.contains("something")).count(); ```
> > The problem that i get is that most of the time i get an error of > NullPointerException and i think is because of .count() And i came to > this conclusion cause if i run it with out .count() > it won't throw an Exception. > > > The reason being you cannot replicate the `NullPointerException` without calli...
62,065,340
I am trying to filter a file name down for example, what i want to do is filter to the underscore and leave the rest. Info10\_ComputerHostName so i run ``` $FileName="Info10_ComputerHostName" $FinalFileName = $FileName -split("*._") ``` When i output the variable what i get " ComputerHostName" What I want "Computer...
2020/05/28
[ "https://Stackoverflow.com/questions/62065340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13634586/" ]
> > The problem that i get is that most of the time i get an error of > NullPointerException and i think is because of .count() And i came to > this conclusion cause if i run it with out .count() > it won't throw an Exception. > > > The reason being you cannot replicate the `NullPointerException` without calli...
You have to filter for `null` values first. Do it either the way @pafauk. answered or by filtering sepraretly. That requires the `null` filter to be applied **before** the one you already use: ``` public static void main(String[] args) { List<String> chainedChars = new ArrayList<>(); chainedChars.add("somethin...
16,033,768
I have a few questions about MySQL table `lock`. I appreciate if anyone answers :) 1. Does MySQL lock tables automatically in the following cases: * `SELECT id FROM members;` * `UPDATE members SET name = 'john' WHERE id = 7;` 2. What is the difference between these two: * `LOCK TABLE items READ ; SELECT * FROM 'i...
2013/04/16
[ "https://Stackoverflow.com/questions/16033768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2285815/" ]
1.a) no lock required 1.b) locks the table (myisam engine) or you have row level locking if your using innodb engine 2.a) locks the table for read operations (until this lock is released no writing operations occur) 2.b) no lock required As Lithu T.V suggested please read the [DOCS](http://dev.mysql.com/doc/re...
1. As far as I know, in mysql the table is not automatically locked. But it depends on what you use. For example with a SqlTransaction, the affected tables will be locked until you commit or rollback. 2. a. you lock the table first, this will make sure that while you read the table, noone else could lock it to write an...
52,761,089
Can someone explain why c is equal to 25 and not 30? I keep getting 30 by multiplying a\*(b//a) and then adding b to it after. ``` a=10 b=3*(a-5) c=b+(b//a)*a ```
2018/10/11
[ "https://Stackoverflow.com/questions/52761089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10410152/" ]
There are several ways to to add header to request. For a single request: ``` let config = { headers: { Authorization: value, } } axios.get(URL, config).then(...) ``` you need to call `data().AuthStr` to get your token there is a typo. Your created function will be ``` created () { axios.get(`url`, {...
It should be: `axios.get(`url`, { 'headers': { 'Authorization': this.AuthStr } })`
52,761,089
Can someone explain why c is equal to 25 and not 30? I keep getting 30 by multiplying a\*(b//a) and then adding b to it after. ``` a=10 b=3*(a-5) c=b+(b//a)*a ```
2018/10/11
[ "https://Stackoverflow.com/questions/52761089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10410152/" ]
There are several ways to to add header to request. For a single request: ``` let config = { headers: { Authorization: value, } } axios.get(URL, config).then(...) ``` you need to call `data().AuthStr` to get your token there is a typo. Your created function will be ``` created () { axios.get(`url`, {...
You are using `JSON.parse` when getting the value for `AuthStr`. `JSON.parse` returns an object. Try removing it and if you are using the correct Auth token, it should work.
36,711,710
I have an application on the play store and for first time i have updated it. How to alert the users that there is a new Updation available in google play store through the app when they open it,just like a notification or alert and redirect to that linked apk page. startActivity(new Intent( Intent.ACTION\_VIEW, Uri.p...
2016/04/19
[ "https://Stackoverflow.com/questions/36711710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217537/" ]
You probably want something like this (extended regex syntax): ``` $ sed -r 's/(^.*?\tgene$)/\n\1/' example A1 title body.1 gene A1 head head.1 head A1 trunk trunk.1 trunk A1 tail tail.1 tail A2 title body.2 gene A2 head head.2 head A2 trunk trunk.2 trunk A2 tail tail.2 tail A3 ti...
Using backreferences ``` sed 's/\(^.*gene\)/\n\1/g' file.txt ```
36,711,710
I have an application on the play store and for first time i have updated it. How to alert the users that there is a new Updation available in google play store through the app when they open it,just like a notification or alert and redirect to that linked apk page. startActivity(new Intent( Intent.ACTION\_VIEW, Uri.p...
2016/04/19
[ "https://Stackoverflow.com/questions/36711710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217537/" ]
Using backreferences ``` sed 's/\(^.*gene\)/\n\1/g' file.txt ```
with sed you can use the insert command i: ``` sed '2,${/[\t ]gene$/i\ ;}' file ``` the `2,$` condition is used to prevent to add a leading newline at the beginning.
36,711,710
I have an application on the play store and for first time i have updated it. How to alert the users that there is a new Updation available in google play store through the app when they open it,just like a notification or alert and redirect to that linked apk page. startActivity(new Intent( Intent.ACTION\_VIEW, Uri.p...
2016/04/19
[ "https://Stackoverflow.com/questions/36711710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217537/" ]
You probably want something like this (extended regex syntax): ``` $ sed -r 's/(^.*?\tgene$)/\n\1/' example A1 title body.1 gene A1 head head.1 head A1 trunk trunk.1 trunk A1 tail tail.1 tail A2 title body.2 gene A2 head head.2 head A2 trunk trunk.2 trunk A2 tail tail.2 tail A3 ti...
Just check if the last field is `gene`. If so, print an empty line: ``` awk '$NF=="gene" {print ""}1' file ``` this returns: ``` $ awk '$NF=="gene" {print ""}1' file A1 title body.1 gene A1 head head.1 head A1 trunk trunk.1 trunk A1 tail tail.1 tail A2 title body.2 gene A2 head head.2 head A2 trunk trunk.2 trunk...
36,711,710
I have an application on the play store and for first time i have updated it. How to alert the users that there is a new Updation available in google play store through the app when they open it,just like a notification or alert and redirect to that linked apk page. startActivity(new Intent( Intent.ACTION\_VIEW, Uri.p...
2016/04/19
[ "https://Stackoverflow.com/questions/36711710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217537/" ]
Just check if the last field is `gene`. If so, print an empty line: ``` awk '$NF=="gene" {print ""}1' file ``` this returns: ``` $ awk '$NF=="gene" {print ""}1' file A1 title body.1 gene A1 head head.1 head A1 trunk trunk.1 trunk A1 tail tail.1 tail A2 title body.2 gene A2 head head.2 head A2 trunk trunk.2 trunk...
with sed you can use the insert command i: ``` sed '2,${/[\t ]gene$/i\ ;}' file ``` the `2,$` condition is used to prevent to add a leading newline at the beginning.
36,711,710
I have an application on the play store and for first time i have updated it. How to alert the users that there is a new Updation available in google play store through the app when they open it,just like a notification or alert and redirect to that linked apk page. startActivity(new Intent( Intent.ACTION\_VIEW, Uri.p...
2016/04/19
[ "https://Stackoverflow.com/questions/36711710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5217537/" ]
You probably want something like this (extended regex syntax): ``` $ sed -r 's/(^.*?\tgene$)/\n\1/' example A1 title body.1 gene A1 head head.1 head A1 trunk trunk.1 trunk A1 tail tail.1 tail A2 title body.2 gene A2 head head.2 head A2 trunk trunk.2 trunk A2 tail tail.2 tail A3 ti...
with sed you can use the insert command i: ``` sed '2,${/[\t ]gene$/i\ ;}' file ``` the `2,$` condition is used to prevent to add a leading newline at the beginning.
3,683,718
Update ====== OK, after some investigation, and thanks in big part to the helpful answers provided by Jon and Hans, this is what I was able to put together. So far I think it seems to work well. I wouldn't bet my life on its total correctness, of course. ``` public static int GetSignificantDigitCount(this decimal val...
2010/09/10
[ "https://Stackoverflow.com/questions/3683718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105570/" ]
You can use [`Decimal.GetBits`](http://msdn.microsoft.com/en-us/library/system.decimal.getbits.aspx) to get the raw data, and work it out from that. Unfortunately I don't have time to write sample code at the moment - and you'll probably want to use [`BigInteger`](http://msdn.microsoft.com/en-us/library/system.numeric...
Yes, unlike floating point types, System.Decimal keeps track of the number of digits in the literal. This is a feature of decimal.Parse(), whether executed by your code yourself or by the compiler when it parses a literal in your program. You can recover this information, check out the code in my answer in [this thread...
3,683,718
Update ====== OK, after some investigation, and thanks in big part to the helpful answers provided by Jon and Hans, this is what I was able to put together. So far I think it seems to work well. I wouldn't bet my life on its total correctness, of course. ``` public static int GetSignificantDigitCount(this decimal val...
2010/09/10
[ "https://Stackoverflow.com/questions/3683718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105570/" ]
You can use [`Decimal.GetBits`](http://msdn.microsoft.com/en-us/library/system.decimal.getbits.aspx) to get the raw data, and work it out from that. Unfortunately I don't have time to write sample code at the moment - and you'll probably want to use [`BigInteger`](http://msdn.microsoft.com/en-us/library/system.numeric...
The solution above falls out of bed quickly with values like 1200 where the number of significant digits is 2 but the function returns 4. Perhaps there is a consistent manner to deal with such a situation i.e. check to make sure return value does not include trailing zeros in the whole number portion without a fraction...
3,683,718
Update ====== OK, after some investigation, and thanks in big part to the helpful answers provided by Jon and Hans, this is what I was able to put together. So far I think it seems to work well. I wouldn't bet my life on its total correctness, of course. ``` public static int GetSignificantDigitCount(this decimal val...
2010/09/10
[ "https://Stackoverflow.com/questions/3683718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105570/" ]
Yes, unlike floating point types, System.Decimal keeps track of the number of digits in the literal. This is a feature of decimal.Parse(), whether executed by your code yourself or by the compiler when it parses a literal in your program. You can recover this information, check out the code in my answer in [this thread...
The solution above falls out of bed quickly with values like 1200 where the number of significant digits is 2 but the function returns 4. Perhaps there is a consistent manner to deal with such a situation i.e. check to make sure return value does not include trailing zeros in the whole number portion without a fraction...
21,365,919
I am trying to create a simple background for a game I am making and require new instances of my function each time my loop runs. Previously I have tried calling my function as so: ``` Sprite(); Sprite(); Sprite(); Sprite(); Sprite(); Sprite(); Sprite(); ``` this worked and created several instances of that functi...
2014/01/26
[ "https://Stackoverflow.com/questions/21365919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803514/" ]
If I understood you correctly, this is what you are trying to achieve: [***Demonstration***](http://jsfiddle.net/GKDev/CThv4/1/) ``` (function () { "use strict"; function Sprite() { var ele = null; this.s = Math.random().toFixed(2) * 5000; this.r = Math.random().toFixed(2) * 30; ...
This is because `setTimeout()` does not stop the codes execution, the code keeps going and there a multiple over-written calls. I recommend doing a `setInterval()` after the for loop or simply print it out on the console. For example using a property for clarity: ``` function Sprite(name){ this.name = name; console.l...
31,232,952
I am new here. I am trying to change the following **tuple into multi-dimensional array in javascript**. tuple string: str: `"(4,7,1),(8,9,6),(3,5,7)"`. I can think of doing it with for loop. I am looking for sufficient way to do this. One way to do is to use RegEx in javascript. I am not good in Regular expression. Co...
2015/07/05
[ "https://Stackoverflow.com/questions/31232952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5069973/" ]
You can just parse it yourself. Here's one way in a working snippet: ```js function parseTuple(t) { var items = t.replace(/^\(|\)$/g, "").split("),("); items.forEach(function(val, index, array) { array[index] = val.split(",").map(Number); }); return items; } var data = "(4,7,1),(8,9,6),(...
You can use eval. Here, this is your prototype function `tuple`. ``` String.prototype.tuple = function(){ return eval("[" + this.replace(/\(/g,"[").replace(/\)/g,"]") + "]") } ``` And this is your example usage of this prototype function. ``` var s = "(4,7,1),(8,9,6),(3,5,7)"; console.log(s.tuple()) ``` As yo...
34,864
I understand that that in the *ancient Levant*, two main writing system patterns were used by the different peoples of the region: *Phoenician* and *Ancient North Arabian*. I further understand that both these writing system patterns came out of the [Proto-Canaanite (Canaanitic)](https://en.wikipedia.org/wiki/Proto-Ca...
2020/01/14
[ "https://linguistics.stackexchange.com/questions/34864", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/-1/" ]
I suppose you mean Ugarit (not Ugrait). The main divide is between Alphabetic writing and Cuneiform writing. On the whole, it is now admitted that the Alphabet comes from a simplification of the Egyptian Hieroglyphs, modified for writing Semitic languages instead of Egyptian. Alphabets are more or less rich according t...
I don't know quite how to answer your question of "how similar". "Epigraphic Semitic Scripts" by M. O'Connor (in *The World's Writing Systems*, Bright & Daniels, Oxford 1996) discusses these briefly, and gives tables of the many scripts. It does say > > From early in the first millennium BCE (perhaps ca. 900) ther...
44,670
In setting up a new Drupal 7 site, I went to try out the password reset option, and while I received the password reset email just fine, clicking it takes me to a page with an error "You have tried to use a one-time login link that has either been used or is no longer valid". I've tried sending the reset email a few t...
2012/09/24
[ "https://drupal.stackexchange.com/questions/44670", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/8581/" ]
It's not documented nicely anywhere I can find, but it seems that you can't use the password reset option via email for a user who's an Administrator of the site. Instead you have to use some alternate method to change the database directly, like [this](http://randyfay.com/comment/1990).
That's not the case - you should be able to get admin password reset by using the link /user/password . The problem I found was its not set to my domain, instead it set to gmail.com . After i changed to my domain, I started getting emails for Password Reset from my D7 installation.
67,681,243
I have 2 tables: **sales:** | id | invoice | valid | | --- | --- | --- | | 100 | IV001 | Y | **payment:** | id | master | amount | test | | --- | --- | --- | --- | | 110 | 100 | 200 | 100 | | 111 | 100 | 300 | 100 | | 112 | 101 | 400 | 101 | Then I made a query: `select master, sum(amount) amount from payment gro...
2021/05/25
[ "https://Stackoverflow.com/questions/67681243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16021792/" ]
Here is a working implementation. It is derived from R3FL3CT's answer; I tried to just post this as an edit to his answer so he could get credit, but was told to post separately. The solution works by getting the text form of the element in question (#content in this case), and then using the first range's startContai...
I think I found a solution for you. It works fine for me, so try it out. ```js $(document).ready(function() { var content = $("#content").text().replace(/\s/g, ''); $("#add").click(function() { var firstRange = window.getSelection().getRangeAt(0).toString().replace(/\s/g, ''); let index = content.indexOf...
12,529,165
I have a class which I have written all my methods there. then I have my firstpage of web application which I have some codes there. I face this * $exception {"Fill: SelectCommand.Connection property has not been initialized."} System.Exception {System.InvalidOperationException} in the line : ``` sda.Fill(dsUsers....
2012/09/21
[ "https://Stackoverflow.com/questions/12529165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1644262/" ]
Look at your constructor: ``` SqlConnection scn = new SqlConnection(...); ``` That's declaring a *separate* `scn` local variable, so the `scn` *instance* variable is staying as null. If you just change it to: ``` scn = new SqlConnection(...); ``` that may well fix the immediate problem. It's not a nice design in ...
I got also this problem. after search the problem found that the object of connection that i have provide SqlDataAdapter is not Initialize so the connection passed as null
12,529,165
I have a class which I have written all my methods there. then I have my firstpage of web application which I have some codes there. I face this * $exception {"Fill: SelectCommand.Connection property has not been initialized."} System.Exception {System.InvalidOperationException} in the line : ``` sda.Fill(dsUsers....
2012/09/21
[ "https://Stackoverflow.com/questions/12529165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1644262/" ]
Look at your constructor: ``` SqlConnection scn = new SqlConnection(...); ``` That's declaring a *separate* `scn` local variable, so the `scn` *instance* variable is staying as null. If you just change it to: ``` scn = new SqlConnection(...); ``` that may well fix the immediate problem. It's not a nice design in ...
``` //Try To Fetch The Value Like this... protected void Search_Emp_Click(object sender, EventArgs e) { SqlCommand cmd; SqlConnection con; SqlDataAdapter ad; con = new SqlConnection(); //making instance of SqlConnection con.ConnectionString = ConfigurationManager.ConnectionStrings["cn"].ConnectionS...
12,529,165
I have a class which I have written all my methods there. then I have my firstpage of web application which I have some codes there. I face this * $exception {"Fill: SelectCommand.Connection property has not been initialized."} System.Exception {System.InvalidOperationException} in the line : ``` sda.Fill(dsUsers....
2012/09/21
[ "https://Stackoverflow.com/questions/12529165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1644262/" ]
Look at your constructor: ``` SqlConnection scn = new SqlConnection(...); ``` That's declaring a *separate* `scn` local variable, so the `scn` *instance* variable is staying as null. If you just change it to: ``` scn = new SqlConnection(...); ``` that may well fix the immediate problem. It's not a nice design in ...
Vishal Sir, If You are Getting that Problem then Be sure whether you are passing the 'cmd' to the SQL DATA ADAPTER. for eg: ``` ad = new SqlDataAdapter(cmd); ```
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
you can combine them using LINQ: ``` list = list1.Concat(list2).Concat(list3).ToList(); ``` the more traditional approach of using `List.AddRange()` might be more efficient though.
To merge or Combine to Lists into a One list. * There is one thing that must be true: the type of both list will be equal. * **For Example**: if we have list of `string` so we can add add another list to the existing list which have list of type string otherwise we can't. **Example**: ``` class Program { static v...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
[List.AddRange](http://msdn.microsoft.com/en-us/library/z883w3dc.aspx) will change (mutate) an existing list by adding additional elements: ``` list1.AddRange(list2); // list1 now also has list2's items appended to it. ``` Alternatively, in modern immutable style, you can project out a new list without changing the ...
To merge or Combine to Lists into a One list. * There is one thing that must be true: the type of both list will be equal. * **For Example**: if we have list of `string` so we can add add another list to the existing list which have list of type string otherwise we can't. **Example**: ``` class Program { static v...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
you can combine them using LINQ: ``` list = list1.Concat(list2).Concat(list3).ToList(); ``` the more traditional approach of using `List.AddRange()` might be more efficient though.
I've already commented it but I still think is a valid option, just test if in your environment is better one solution or the other. In my particular case, using `source.ForEach(p => dest.Add(p))` performs better than the classic `AddRange` but I've not investigated why at the low level. You can see an example code he...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
You can use the LINQ [`Concat`](http://msdn.microsoft.com/en-us/library/bb302894.aspx) and [`ToList`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) methods: ``` var allProducts = productCollection1.Concat(productCollection2) .Concat(productCollection3) ...
You could use the [Concat](http://msdn.microsoft.com/en-us/library/bb302894.aspx) extension method: ``` var result = productCollection1 .Concat(productCollection2) .Concat(productCollection3) .ToList(); ```
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
``` list4 = list1.Concat(list2).Concat(list3).ToList(); ```
I've already commented it but I still think is a valid option, just test if in your environment is better one solution or the other. In my particular case, using `source.ForEach(p => dest.Add(p))` performs better than the classic `AddRange` but I've not investigated why at the low level. You can see an example code he...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
You could use the [Concat](http://msdn.microsoft.com/en-us/library/bb302894.aspx) extension method: ``` var result = productCollection1 .Concat(productCollection2) .Concat(productCollection3) .ToList(); ```
I've already commented it but I still think is a valid option, just test if in your environment is better one solution or the other. In my particular case, using `source.ForEach(p => dest.Add(p))` performs better than the classic `AddRange` but I've not investigated why at the low level. You can see an example code he...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
``` list4 = list1.Concat(list2).Concat(list3).ToList(); ```
``` // I would make it a little bit more simple var products = new List<List<product>> {item1, item2, item3 }.SelectMany(id => id).ToList(); ``` This way it is a multi dimensional List and the .SelectMany() will flatten it into a IEnumerable of product then I use the .ToList() method after.
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
You can use the LINQ [`Concat`](http://msdn.microsoft.com/en-us/library/bb302894.aspx) and [`ToList`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) methods: ``` var allProducts = productCollection1.Concat(productCollection2) .Concat(productCollection3) ...
you can combine them using LINQ: ``` list = list1.Concat(list2).Concat(list3).ToList(); ``` the more traditional approach of using `List.AddRange()` might be more efficient though.
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
You could use the [Concat](http://msdn.microsoft.com/en-us/library/bb302894.aspx) extension method: ``` var result = productCollection1 .Concat(productCollection2) .Concat(productCollection3) .ToList(); ```
To merge or Combine to Lists into a One list. * There is one thing that must be true: the type of both list will be equal. * **For Example**: if we have list of `string` so we can add add another list to the existing list which have list of type string otherwise we can't. **Example**: ``` class Program { static v...
4,488,054
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 = GetAllProducts(CategoryId1); var productCollection2 = GetAllProducts(CategoryId2); var productCollection3 = GetAllProd...
2010/12/20
[ "https://Stackoverflow.com/questions/4488054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236021/" ]
You can use the LINQ [`Concat`](http://msdn.microsoft.com/en-us/library/bb302894.aspx) and [`ToList`](http://msdn.microsoft.com/en-us/library/bb342261.aspx) methods: ``` var allProducts = productCollection1.Concat(productCollection2) .Concat(productCollection3) ...
``` list4 = list1.Concat(list2).Concat(list3).ToList(); ```
75,152
I am using SQL Server 2012 and I would like to keep my pre-existing data but to cause the ID (identity) column to skip by 2000 rows. Why is this happening? I have a scenario where I may have transactions happening on a standby server which I will need to copy to current server. I want the IDs to match. Therefore I do ...
2014/08/27
[ "https://dba.stackexchange.com/questions/75152", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/3160/" ]
You could do this by running something like ``` declare @newid int; select @newid = IDENT_CURRENT('YourTable') + 2000; dbcc checkident('YourTable', reseed, @newid); ``` This would reseed your table identity to be 2000 higher than it currently is and seems like it should resolve what you are looking to do.
One thing to remember is that an `ID` does not have to be generated by the `IDENTITY` property. Using `IDENTITY` has challenges, since as soon as rows are moved from the standby server to the current server (using `IDENTITY_INSERT` of course) with an `ID` value higher than the current identity value it becomes the **...
26,724,431
I have written some code to check if the user has entered a number between 1 and 5, and now I would also like my code to allow the user to enter the letters A, S, D or M. Is there a way to combine the code where I can have it identify whether the user has entered 1-5 or A, S, D, M? How do I edit the code below so the...
2014/11/03
[ "https://Stackoverflow.com/questions/26724431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209160/" ]
I suggest instead of using an `int` input, just use a `String` input and convert it to an integer when you need to. You can use `Integer.parseInt(String)` to convert a `String` to an `int`. So when you check if the input is valid, you need to check if the input is equal to `"A"`, `"S"`, `"M"` or `"D"`, or any values f...
If your input can be both characters and letters, why not change to looking for a char or String? Then, you can look for "1" or "A" without any trouble.
26,724,431
I have written some code to check if the user has entered a number between 1 and 5, and now I would also like my code to allow the user to enter the letters A, S, D or M. Is there a way to combine the code where I can have it identify whether the user has entered 1-5 or A, S, D, M? How do I edit the code below so the...
2014/11/03
[ "https://Stackoverflow.com/questions/26724431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209160/" ]
As @MarsAtomic mentioned, first thing you should change your input to `String` instead of an `int` so you can easily handle both characters and digits. Change: ``` int inputInt; ``` To: ``` String input; ``` Then change: ``` inputInt = readInput.nextInt(); ``` To: ``` input = readInput.next(); ``` To accom...
If your input can be both characters and letters, why not change to looking for a char or String? Then, you can look for "1" or "A" without any trouble.
6,612,814
I have a query that updates a boolean value for a given record, then inserts that record into another table (depending on the action performed) using a select subquery. The select subquery is working fine, but how can I add an additional variable on to the end of the query to be inserted ? The reason why I need to do t...
2011/07/07
[ "https://Stackoverflow.com/questions/6612814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571783/" ]
You can always select a constant, and the `reason` value is just that from the SQL viewpoint, so you can write the insert as: ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT fname, lname, student_id, email, type, :reason FROM waiting WHERE id = :id ``` Just bind the params then and ...
Bbasically you can add an arbitary value to your select by simply hard coding the value in the query. To make it eaier to read you can alias it to the columnanme with `'YOUR VALUE' as reason` ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT fname, lname, student_id, email, type, '$reaso...
6,612,814
I have a query that updates a boolean value for a given record, then inserts that record into another table (depending on the action performed) using a select subquery. The select subquery is working fine, but how can I add an additional variable on to the end of the query to be inserted ? The reason why I need to do t...
2011/07/07
[ "https://Stackoverflow.com/questions/6612814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571783/" ]
You can always select a constant, and the `reason` value is just that from the SQL viewpoint, so you can write the insert as: ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT fname, lname, student_id, email, type, :reason FROM waiting WHERE id = :id ``` Just bind the params then and ...
If there is a limited number of "reasons", you could have a separate `reasons` table and join in your `SELECT` ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT w.fname, w.lname, w.student_id, w.email, w.type, r.reason FROM waiting w, reasons r WHERE w.id = :id and r.id = :rea...
6,612,814
I have a query that updates a boolean value for a given record, then inserts that record into another table (depending on the action performed) using a select subquery. The select subquery is working fine, but how can I add an additional variable on to the end of the query to be inserted ? The reason why I need to do t...
2011/07/07
[ "https://Stackoverflow.com/questions/6612814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571783/" ]
Bbasically you can add an arbitary value to your select by simply hard coding the value in the query. To make it eaier to read you can alias it to the columnanme with `'YOUR VALUE' as reason` ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT fname, lname, student_id, email, type, '$reaso...
If there is a limited number of "reasons", you could have a separate `reasons` table and join in your `SELECT` ``` INSERT INTO approved (fname, lname, student_id, email, type, reason) SELECT w.fname, w.lname, w.student_id, w.email, w.type, r.reason FROM waiting w, reasons r WHERE w.id = :id and r.id = :rea...
250,292
What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t...
2008/10/30
[ "https://Stackoverflow.com/questions/250292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
Have a look at the [HTMLAgility](http://www.codeplex.com/htmlagilitypack) pack. It's very compatible with the .NET XmlDocument class, but it much more forgiving about HTML that's not clean/valid XHTML.
I've used an [SGMLReader](http://wiki.developer.mindtouch.com/SgmlReader) to produce a valid Xml document from HTML and then parse what is required using XPath or to another format using XSLT. .
250,292
What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t...
2008/10/30
[ "https://Stackoverflow.com/questions/250292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
Have a look at the [HTMLAgility](http://www.codeplex.com/htmlagilitypack) pack. It's very compatible with the .NET XmlDocument class, but it much more forgiving about HTML that's not clean/valid XHTML.
You can also look into [HTML Tidy](http://tidy.sourceforge.net/) for HTML parsing/cleanup. I don't think they have specific .NET libraries, but you might be able to run the binary via command-line, or IKVM the java libraries.
250,292
What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t...
2008/10/30
[ "https://Stackoverflow.com/questions/250292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
If the HTML is XHTML compliant, you can use the built in System.Xml namespace.
I've used an [SGMLReader](http://wiki.developer.mindtouch.com/SgmlReader) to produce a valid Xml document from HTML and then parse what is required using XPath or to another format using XSLT. .
250,292
What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t...
2008/10/30
[ "https://Stackoverflow.com/questions/250292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
I've used an [SGMLReader](http://wiki.developer.mindtouch.com/SgmlReader) to produce a valid Xml document from HTML and then parse what is required using XPath or to another format using XSLT. .
You can also look into [HTML Tidy](http://tidy.sourceforge.net/) for HTML parsing/cleanup. I don't think they have specific .NET libraries, but you might be able to run the binary via command-line, or IKVM the java libraries.
250,292
What's the best way to parse fragments of HTML in C#? For context, I've inherited an application that uses a great deal of composite controls, which is fine, but a good deal of the controls are rendered using a long sequence of literal controls, which is fairly terrifying. I'm trying to get the application into unit t...
2008/10/30
[ "https://Stackoverflow.com/questions/250292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
If the HTML is XHTML compliant, you can use the built in System.Xml namespace.
You can also look into [HTML Tidy](http://tidy.sourceforge.net/) for HTML parsing/cleanup. I don't think they have specific .NET libraries, but you might be able to run the binary via command-line, or IKVM the java libraries.
43,546,050
I made an interpreter for a script language containing a loop for, using javacc I have defined the grammar but I can't have a way to back up to line to repeat the execution of the block "for". how back up the token manager so that loop-bodies can be re-parsed, and thus reevaluated, over and over again ?. ``` void For...
2017/04/21
[ "https://Stackoverflow.com/questions/43546050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7892334/" ]
The log message you are seeing is from FirebaseAnalytics (the "FA" in the log tag), and makes sense since analytics is not enabled in this sample (unless you added code to enable it). Notice this is also a debug message (the "D" in the log tag) and not an error/warning. This should not be affecting the Doorbell sample...
It turns out that configuration is not appropriate. It uses the new SDK path which doesn't install google play service. Once I switch to the default SDK path of system which installed google play service. The logs looks different event though that message "Unable to get advertising id:" is still there. It seems (from F...
16,650,552
I have this code i am using to read uploaded file, but i need to get size of image instead but not sure what code can i use ``` HttpFileCollection collection = _context.Request.Files; for (int i = 0; i < collection.Count; i++) { HttpPostedFile postedFile = collection[i]; ...
2013/05/20
[ "https://Stackoverflow.com/questions/16650552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1668069/" ]
First you have to write the image: ``` System.Drawing.Image image = System.Drawing.Image.FromStream (new System.IO.MemoryStream(byteArrayHere)); ``` and afterwards you have the : ``` image.Height.ToString(); ``` and the ``` image.Width.ToString(); ``` note: you might want to add a check to be sure it's an ...
``` HttpPostedFile file = null; file = Request.Files[0] if (file != null && file.ContentLength > 0) { System.IO.Stream fileStream = file.InputStream; fileStream.Position = 0; byte[] fileContents = new byte[file.ContentLength]; fileStream.Read(fileContents, 0, file.ContentLength); System.Drawing.I...
16,650,552
I have this code i am using to read uploaded file, but i need to get size of image instead but not sure what code can i use ``` HttpFileCollection collection = _context.Request.Files; for (int i = 0; i < collection.Count; i++) { HttpPostedFile postedFile = collection[i]; ...
2013/05/20
[ "https://Stackoverflow.com/questions/16650552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1668069/" ]
First you have to write the image: ``` System.Drawing.Image image = System.Drawing.Image.FromStream (new System.IO.MemoryStream(byteArrayHere)); ``` and afterwards you have the : ``` image.Height.ToString(); ``` and the ``` image.Width.ToString(); ``` note: you might want to add a check to be sure it's an ...
Read the image into a buffer (you either have a Stream to read from or the byte[], because if you had the Image you'd have the dimensions anyway). ``` public Size GetSize(byte[] bytes) { using (var stream = new MemoryStream(bytes)) { var image = System.Drawing.Image.FromStream(stream); return image....
16,579,413
I'm trying to make a recursive method that receives an array and traverse it like with a loop, but without a loop. Couldn't find a way to make an index, and increase each time I call the method.
2013/05/16
[ "https://Stackoverflow.com/questions/16579413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2350319/" ]
If you have a function f(array,index) make it do something with array[index] and return function(array,index+1). Finally, to start it off call function(array,0). If there are any variables or state you are building up over the course of the recursive function, also pass it via the arguments.
A shot in the dark, but ``` public void printMyArray (String[] test, int index) { // verify the index isn't too large // Grab a value and do something with it. } ``` Edit: As stated above, you basically just need to run through each value in the array. The easiest is really carrying over an index value (...
22,376,509
im trying to call a function from another class called square function area to cuboid class. ``` abstract class Shapes { protected $name; protected $colour; function __construct($n, $c) { $this->name = $n; $this->colour = $c; } ``` thankyou!
2014/03/13
[ "https://Stackoverflow.com/questions/22376509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3320800/" ]
There is no reason for funky `eval(parse())` business: ``` ggplot(DT, aes_string(x="Date", y="Value", colour=var.col)) + geom_line() ```
You can simply add a name to your color scale: ``` ggplot(DT, aes(x=Date, y=Value, colour=eval(parse(text=var.col)))) + geom_line() + scale_color_discrete(name=var.col) ```
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I would say it holds its tail quivering in a vertical position when it is happy. Cats can * quiver * twitch * thump * wag * flick * swish * fluff their tails. All of which means something As mentioned in another post, the position also means something According to [catster.com](https://www.catster.com/cat-behavio...
Cat body language is more complex than simply wagging. Most people might think swishing is the feline equivalent of wagging. But according to Common Cat Behaviors ([Best-Cat-Tips.com](http://www.best-cat-tips.com/common_cat_behaviors.htm)), swishing its tail from side to side "may indicate real or mock annoyance." Th...
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I would say it holds its tail quivering in a vertical position when it is happy. Cats can * quiver * twitch * thump * wag * flick * swish * fluff their tails. All of which means something As mentioned in another post, the position also means something According to [catster.com](https://www.catster.com/cat-behavio...
One of the most important uses for a cat's tail is orienting itself in mid-air, so as to land on it's feet, or to capture prey that is leaping to escape. As for happiness, there's no word specifically applied to this case with a cat. One might say the *cat's tail evidenced its approval* or something similar.
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
It appears there are no specific terms for the ways [a cat moves its tail](http://www.sheppardsoftware.com/content/animals/animals/breeds/catopics/cat_behavior.htm), despite the many and different signals it may send. **The tail says it all**: Watching a cat's tail is an excellent way to determine how they are feelin...
Cat body language is more complex than simply wagging. Most people might think swishing is the feline equivalent of wagging. But according to Common Cat Behaviors ([Best-Cat-Tips.com](http://www.best-cat-tips.com/common_cat_behaviors.htm)), swishing its tail from side to side "may indicate real or mock annoyance." Th...
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
It appears there are no specific terms for the ways [a cat moves its tail](http://www.sheppardsoftware.com/content/animals/animals/breeds/catopics/cat_behavior.htm), despite the many and different signals it may send. **The tail says it all**: Watching a cat's tail is an excellent way to determine how they are feelin...
One of the most important uses for a cat's tail is orienting itself in mid-air, so as to land on it's feet, or to capture prey that is leaping to escape. As for happiness, there's no word specifically applied to this case with a cat. One might say the *cat's tail evidenced its approval* or something similar.
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I would say it holds its tail quivering in a vertical position when it is happy. Cats can * quiver * twitch * thump * wag * flick * swish * fluff their tails. All of which means something As mentioned in another post, the position also means something According to [catster.com](https://www.catster.com/cat-behavio...
A cat ***raises*** its tail (up) when happy or friendly. [In general, because not all cats do that and not every time they are happy.] > > A happy cat **raises its tail straight up**. A cat may still be happy if their tail is up the in air with the tip curled. It just means that they feel a bit unsure. > > > <https...
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
It appears there are no specific terms for the ways [a cat moves its tail](http://www.sheppardsoftware.com/content/animals/animals/breeds/catopics/cat_behavior.htm), despite the many and different signals it may send. **The tail says it all**: Watching a cat's tail is an excellent way to determine how they are feelin...
In English, the word 'wag' is not used for the movement of a cat's tail. The action of the movement and its intent are different enough that it feels very wrong to use for cats. However, the answer for the word for the movement of a cat's tail is not so obvious. The only movement of a cat's tail that is close to that ...
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
In English, the word 'wag' is not used for the movement of a cat's tail. The action of the movement and its intent are different enough that it feels very wrong to use for cats. However, the answer for the word for the movement of a cat's tail is not so obvious. The only movement of a cat's tail that is close to that ...
One of the most important uses for a cat's tail is orienting itself in mid-air, so as to land on it's feet, or to capture prey that is leaping to escape. As for happiness, there's no word specifically applied to this case with a cat. One might say the *cat's tail evidenced its approval* or something similar.
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
I would say it holds its tail quivering in a vertical position when it is happy. Cats can * quiver * twitch * thump * wag * flick * swish * fluff their tails. All of which means something As mentioned in another post, the position also means something According to [catster.com](https://www.catster.com/cat-behavio...
In English, the word 'wag' is not used for the movement of a cat's tail. The action of the movement and its intent are different enough that it feels very wrong to use for cats. However, the answer for the word for the movement of a cat's tail is not so obvious. The only movement of a cat's tail that is close to that ...
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
A cat ***raises*** its tail (up) when happy or friendly. [In general, because not all cats do that and not every time they are happy.] > > A happy cat **raises its tail straight up**. A cat may still be happy if their tail is up the in air with the tip curled. It just means that they feel a bit unsure. > > > <https...
One of the most important uses for a cat's tail is orienting itself in mid-air, so as to land on it's feet, or to capture prey that is leaping to escape. As for happiness, there's no word specifically applied to this case with a cat. One might say the *cat's tail evidenced its approval* or something similar.
206,596
A friendly dog will *[wag](http://www.thefreedictionary.com/wag)* its tail, especially when it's happy to see his owner. Cats can communicate their approval and appreciation too, but I don't remember ever hearing a cat *wagging* its tail for joy. So, what does a cat's tail do when it's happy?
2014/11/06
[ "https://english.stackexchange.com/questions/206596", "https://english.stackexchange.com", "https://english.stackexchange.com/users/44619/" ]
Cat body language is more complex than simply wagging. Most people might think swishing is the feline equivalent of wagging. But according to Common Cat Behaviors ([Best-Cat-Tips.com](http://www.best-cat-tips.com/common_cat_behaviors.htm)), swishing its tail from side to side "may indicate real or mock annoyance." Th...
One of the most important uses for a cat's tail is orienting itself in mid-air, so as to land on it's feet, or to capture prey that is leaping to escape. As for happiness, there's no word specifically applied to this case with a cat. One might say the *cat's tail evidenced its approval* or something similar.
40,152
Sometimes when I get frozen fish, it comes with several pieces frozen together (specifically, Trader Joe's does this with all of their frozen fish). Is there any good way of separating them without fully thawing? This could also apply to other frozen things, but I'm mainly interested in fish.
2013/12/11
[ "https://cooking.stackexchange.com/questions/40152", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/725/" ]
If the pieces are only frozen together in a few places, you might want to try heating a butter knife up under hot water and then using that to pry them apart. This is similar to heating up an ice cream scoop. It won't work if they are really packed in together tightly though.
Pretty much no matter what you do, you will be damaging the product (either physically or otherwise) to some degree. The balance is, how much are you willing to damage the product vs. how much time and effort do you want to expend? (Non)Individually Quick Frozen foods are a pain if you only intend to use one of the fi...
40,152
Sometimes when I get frozen fish, it comes with several pieces frozen together (specifically, Trader Joe's does this with all of their frozen fish). Is there any good way of separating them without fully thawing? This could also apply to other frozen things, but I'm mainly interested in fish.
2013/12/11
[ "https://cooking.stackexchange.com/questions/40152", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/725/" ]
If the pieces are only frozen together in a few places, you might want to try heating a butter knife up under hot water and then using that to pry them apart. This is similar to heating up an ice cream scoop. It won't work if they are really packed in together tightly though.
through them hard down on a concrete surface and they should shatter apart. Select the ones you want and put theh other back re-wrapped into the freezer. Aussie solutions are best.
40,152
Sometimes when I get frozen fish, it comes with several pieces frozen together (specifically, Trader Joe's does this with all of their frozen fish). Is there any good way of separating them without fully thawing? This could also apply to other frozen things, but I'm mainly interested in fish.
2013/12/11
[ "https://cooking.stackexchange.com/questions/40152", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/725/" ]
Pretty much no matter what you do, you will be damaging the product (either physically or otherwise) to some degree. The balance is, how much are you willing to damage the product vs. how much time and effort do you want to expend? (Non)Individually Quick Frozen foods are a pain if you only intend to use one of the fi...
through them hard down on a concrete surface and they should shatter apart. Select the ones you want and put theh other back re-wrapped into the freezer. Aussie solutions are best.
62,631,694
This is my code ```html <div class="parent"> <div> <h3> <a> Text </a> </h3> </div> <div> <ul> <li> <a class="clickme"> click me </a> </li> </ul> </div> </div> ``` What i want to do is onclick of class "clickme" i want to print Text.I also don't want to add any more cl...
2020/06/29
[ "https://Stackoverflow.com/questions/62631694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732257/" ]
as [@Iain Shelvington](https://stackoverflow.com/users/548562/iain-shelvington) said, ***do not define `urlpatterns` like this, they are meant to be used for paths that serve your application views*** it must be, ``` urlpatterns += [ path(**""**, include("site.urls")), **^^^^ see, empty name** ] ``` Then...
I still can't comment on posts, but the others are correct. If you want to serve a subdomain or different domain entirely, you don't want to use the URLConf. In fact, the only reason you need one is because *you're trying to serve Django views*, **which you aren't**. The other website is. Instead, if you REALlY don't ...
62,631,694
This is my code ```html <div class="parent"> <div> <h3> <a> Text </a> </h3> </div> <div> <ul> <li> <a class="clickme"> click me </a> </li> </ul> </div> </div> ``` What i want to do is onclick of class "clickme" i want to print Text.I also don't want to add any more cl...
2020/06/29
[ "https://Stackoverflow.com/questions/62631694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732257/" ]
as [@Iain Shelvington](https://stackoverflow.com/users/548562/iain-shelvington) said, ***do not define `urlpatterns` like this, they are meant to be used for paths that serve your application views*** it must be, ``` urlpatterns += [ path(**""**, include("site.urls")), **^^^^ see, empty name** ] ``` Then...
You need to provide your `other domain` to context, so all templates could use it. create file context\_processors.py ``` def new_domain_context_processor(request): return { 'other_domain': 'YOUR_DOMAIN_URL', } ``` in setting.py ``` TEMPLATES = [ { ... 'OPTIONS': { ... 'conte...
62,631,694
This is my code ```html <div class="parent"> <div> <h3> <a> Text </a> </h3> </div> <div> <ul> <li> <a class="clickme"> click me </a> </li> </ul> </div> </div> ``` What i want to do is onclick of class "clickme" i want to print Text.I also don't want to add any more cl...
2020/06/29
[ "https://Stackoverflow.com/questions/62631694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732257/" ]
as [@Iain Shelvington](https://stackoverflow.com/users/548562/iain-shelvington) said, ***do not define `urlpatterns` like this, they are meant to be used for paths that serve your application views*** it must be, ``` urlpatterns += [ path(**""**, include("site.urls")), **^^^^ see, empty name** ] ``` Then...
Let's turn this into a more concrete case. Let's say we use an account app for account management, but on a centralized subdomain "auth.example.com". We have taken all steps to ensure that session and CSRF cookies are readable on our main site "www.example.com", by setting appropriate values in settings.py. Additionall...
62,631,694
This is my code ```html <div class="parent"> <div> <h3> <a> Text </a> </h3> </div> <div> <ul> <li> <a class="clickme"> click me </a> </li> </ul> </div> </div> ``` What i want to do is onclick of class "clickme" i want to print Text.I also don't want to add any more cl...
2020/06/29
[ "https://Stackoverflow.com/questions/62631694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732257/" ]
as [@Iain Shelvington](https://stackoverflow.com/users/548562/iain-shelvington) said, ***do not define `urlpatterns` like this, they are meant to be used for paths that serve your application views*** it must be, ``` urlpatterns += [ path(**""**, include("site.urls")), **^^^^ see, empty name** ] ``` Then...
It is preferrably to use Django's [the "sites" framework](https://docs.djangoproject.com/en/3.0/ref/contrib/sites/) for that instead. To track which domain is requested. Simply by using `Site.objects.get_current()` in your views. And also here [django-subdomains](https://django-subdomains.readthedocs.io/en/latest/) "b...
62,631,694
This is my code ```html <div class="parent"> <div> <h3> <a> Text </a> </h3> </div> <div> <ul> <li> <a class="clickme"> click me </a> </li> </ul> </div> </div> ``` What i want to do is onclick of class "clickme" i want to print Text.I also don't want to add any more cl...
2020/06/29
[ "https://Stackoverflow.com/questions/62631694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13732257/" ]
as [@Iain Shelvington](https://stackoverflow.com/users/548562/iain-shelvington) said, ***do not define `urlpatterns` like this, they are meant to be used for paths that serve your application views*** it must be, ``` urlpatterns += [ path(**""**, include("site.urls")), **^^^^ see, empty name** ] ``` Then...
> > Please note: as I clarified in the post I am using urlpatterns to serve application views. The exact same application is used for two different domains and I want to send people in certain cases to the other domain. > > > Why don't you use reverse proxy services to redirect as Nginx? And in general it would be...
129,971
I am converting to Judaism and wish to adopt Teimani minhagim. Unfortunately, I cannot fully read Hebrew so I am looking for a Yemenite (Teimani) Siddur in English. Please send me PDF or a link to where I can purchase one.
2022/07/06
[ "https://judaism.stackexchange.com/questions/129971", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/29002/" ]
I spoke to an American I know who converted to Judaism and moved to Israel and adopted Yemenite customs. He confirmed that there is currently no such siddur on the market. He says what he did was to use a transliterated Ashkenazi siddur and "pray in English what he had to pray in English and not worry about it" until ...
As others before me have said, there currently is no such siddur. I am actually in the process of having such a siddur made with the pirush (commentary) of Maharitz (one of the greatest yemenite rabbis who wrote the most extensive commentary on the tiklal). It does take a lot of funding, so if this is something you're ...
35,765,909
The splash screen appear normal (fit) at first and then after 2 seconds or so it resized / stretched onto right side off the screen I'm developing iOS app using phonegap only (no xCode) the iPhone 6 I use for testing is using iOS 9.2.1 here's config.xml : ``` <widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="...
2016/03/03
[ "https://Stackoverflow.com/questions/35765909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5442290/" ]
This should work just fine: `header('Location: example.php?id='.$id);`. Make sure there is no output, not even a space, before you call the `header();`
You can use the header function like this. ``` header("location:example.php?id=".$id); ```
35,765,909
The splash screen appear normal (fit) at first and then after 2 seconds or so it resized / stretched onto right side off the screen I'm developing iOS app using phonegap only (no xCode) the iPhone 6 I use for testing is using iOS 9.2.1 here's config.xml : ``` <widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="...
2016/03/03
[ "https://Stackoverflow.com/questions/35765909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5442290/" ]
You can use [php header](http://php.net/manual/en/function.header.php) function ``` <?php header('Location: example.php?id='.$id); exit(); ?> ```
You can use the header function like this. ``` header("location:example.php?id=".$id); ```
14,600,506
I have a checkbox which will toggle some other check boxes on a html form: ``` <input type="checkbox" name="selector" onclick="toggle_all(this);"/> <script language="javascript"> function toggle_all(source) { var checkboxes = $(":input[name^='form[r']"); if($(source).is(':checked')) { checkboxes.attr(...
2013/01/30
[ "https://Stackoverflow.com/questions/14600506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85443/" ]
You need to escape the square bracket in selector Change ``` var checkboxes = $(":input[name^='form[r']"); ``` To ``` var checkboxes = $(":input[name^='form\[r']"); ```
I'd recomment using this code to select/deselect all checkboxes: ``` $('input#select-all').change(function(){ var checked = $(this).prop('checked'); $(":input[name^='form[r']").prop('checked', checked); }); ```
14,600,506
I have a checkbox which will toggle some other check boxes on a html form: ``` <input type="checkbox" name="selector" onclick="toggle_all(this);"/> <script language="javascript"> function toggle_all(source) { var checkboxes = $(":input[name^='form[r']"); if($(source).is(':checked')) { checkboxes.attr(...
2013/01/30
[ "https://Stackoverflow.com/questions/14600506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85443/" ]
I would suggest an improvement. Change HTML, add some class to all your checkboxes: ``` <input class="check" type="checkbox" name="form[r]"> ``` And JS: ``` function toggle_all(source) { $(".check").prop('checked', source.checked); } ``` <http://jsfiddle.net/tFv3G/> And the reason why is that searching eleme...
You need to escape the square bracket in selector Change ``` var checkboxes = $(":input[name^='form[r']"); ``` To ``` var checkboxes = $(":input[name^='form\[r']"); ```
14,600,506
I have a checkbox which will toggle some other check boxes on a html form: ``` <input type="checkbox" name="selector" onclick="toggle_all(this);"/> <script language="javascript"> function toggle_all(source) { var checkboxes = $(":input[name^='form[r']"); if($(source).is(':checked')) { checkboxes.attr(...
2013/01/30
[ "https://Stackoverflow.com/questions/14600506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85443/" ]
I would suggest an improvement. Change HTML, add some class to all your checkboxes: ``` <input class="check" type="checkbox" name="form[r]"> ``` And JS: ``` function toggle_all(source) { $(".check").prop('checked', source.checked); } ``` <http://jsfiddle.net/tFv3G/> And the reason why is that searching eleme...
I'd recomment using this code to select/deselect all checkboxes: ``` $('input#select-all').change(function(){ var checked = $(this).prop('checked'); $(":input[name^='form[r']").prop('checked', checked); }); ```
24,745,818
I am sending a post request which contains an email address for the username and a password. The request works when I hard code in the email address (test@test.com) like this: ``` test%40test.com ``` However when I pass it the actual email address, it obviously doesn't work. In swift, how do I convert a string to it...
2014/07/14
[ "https://Stackoverflow.com/questions/24745818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3792045/" ]
Thanks Bryan I got the answer from within that thread. Here is what ultimately worked: ``` var originalString = "test@test.com" var escapedString = originalString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet()) println("escapedString: \(escapedString)") ``` This prints...
Just tried this out in a playground and it seemed to work. This is the method I use in Objective-C to escape strings for URLs. ``` var email: CFStringRef = "email@address.com" CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(nil, email, nil, "!*'();:@&=+$,/?%#[]", kCFStringEncodingASCII)) ```
24,745,818
I am sending a post request which contains an email address for the username and a password. The request works when I hard code in the email address (test@test.com) like this: ``` test%40test.com ``` However when I pass it the actual email address, it obviously doesn't work. In swift, how do I convert a string to it...
2014/07/14
[ "https://Stackoverflow.com/questions/24745818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3792045/" ]
Just tried this out in a playground and it seemed to work. This is the method I use in Objective-C to escape strings for URLs. ``` var email: CFStringRef = "email@address.com" CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(nil, email, nil, "!*'();:@&=+$,/?%#[]", kCFStringEncodingASCII)) ```
This is the most recent solution: ``` yourString.addingPercentEncoding(withAllowedCharacters: .letters) ``` Adjust `.letters` to use different sets.
24,745,818
I am sending a post request which contains an email address for the username and a password. The request works when I hard code in the email address (test@test.com) like this: ``` test%40test.com ``` However when I pass it the actual email address, it obviously doesn't work. In swift, how do I convert a string to it...
2014/07/14
[ "https://Stackoverflow.com/questions/24745818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3792045/" ]
Thanks Bryan I got the answer from within that thread. Here is what ultimately worked: ``` var originalString = "test@test.com" var escapedString = originalString.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet()) println("escapedString: \(escapedString)") ``` This prints...
This is the most recent solution: ``` yourString.addingPercentEncoding(withAllowedCharacters: .letters) ``` Adjust `.letters` to use different sets.
45,115,076
When I try to download files from server, it works but the file is incomplete. I join some images, just look at the size of each files. Did I miss something here ? > > Download("\*//XXX/upv/", "loader.swf"); > > > Download("\*://XXX/upv/modules/", "modules/core.swf"); > > > ``` using System; using System.Colle...
2017/07/15
[ "https://Stackoverflow.com/questions/45115076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8286395/" ]
If you want to configure a font to be exactly like an existing font but with some slight changes, you can create a new font object based off of an existing font, and then configure the attributes of that new font object. For example: ``` ... import tkinter.font as tkFont ... def changeFontSize2(): textPad.tag_ad...
As you said, there are many ways to achieve the desired effect. Since there are no other options presented after many hours, here is one that works anyway. I centralized the formatting of the font to one function and call it with different arguments from the various buttons. ``` def setSelTagFont(family, size): cu...
120,581
What's the difference between these two sentences? > > Mary stared at the distance > > > Mary stared off at/into the distance > > >
2013/07/27
[ "https://english.stackexchange.com/questions/120581", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4070/" ]
Per comments from Carlo and Janus, normally we only *stare, look, peer, glare, etc. **at*** things we can actually *see*. We don't normally think of *seeing* things like *distance, darkness, gloom, murk,* etc. These are really words for *the medium **through which** we [might possibly] see something*. There's scope f...
Prepositions help the reader or listener understand the relationship (the logical relationship, the spacial relationship or the temporal relationship between words or phrases. Often as not that relationship is further clarified by the context of the rest of the sentence. Consequently, their informative value may be so ...
379,265
Since I updated to macOS Catalina - 10.15.0, I'm experiencing random "crashes" on the login screen after I wake my MBP (2019) up. I just can't do anything, I see the login screen, but I'm not able to do anything, it just displays the spinning wheel cursor after a few secs. Updated to 10.15.1 and 10.15.2, with no succe...
2020/01/08
[ "https://apple.stackexchange.com/questions/379265", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/96803/" ]
I had this start happening the day following my upgrade to Catalina. For me it turns out that I had cron jobs piling up. I had 3 entries in my crontab for Magento from a project I worked on a couple years ago. Apparently cron has been [deprecated](https://apple.stackexchange.com/questions/12819/why-is-cron-being-deprec...
**Reset NVRAM or PRAM on your Mac** NVRAM (nonvolatile random-access memory) is a small amount of memory that your Mac uses to store certain settings and access them quickly. PRAM (Parameter RAM) stores similar information, and the steps for resetting NVRAM and PRAM are the same. Settings that can be stored in NVRAM ...
379,265
Since I updated to macOS Catalina - 10.15.0, I'm experiencing random "crashes" on the login screen after I wake my MBP (2019) up. I just can't do anything, I see the login screen, but I'm not able to do anything, it just displays the spinning wheel cursor after a few secs. Updated to 10.15.1 and 10.15.2, with no succe...
2020/01/08
[ "https://apple.stackexchange.com/questions/379265", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/96803/" ]
I had this start happening the day following my upgrade to Catalina. For me it turns out that I had cron jobs piling up. I had 3 entries in my crontab for Magento from a project I worked on a couple years ago. Apparently cron has been [deprecated](https://apple.stackexchange.com/questions/12819/why-is-cron-being-deprec...
Given that you've tried resetting NVRAM, the only practical next step is to reinstall macOS, before doing this you need to take a backup. There are two ways to go about this: 1. Reinstall over the top, this should maintain files and settings and replace the operating system, this may work, if it doesn't then... 2. Cl...
35,091,117
I want to make a textbox on an webpage which will take a number from user and that number will be saved in a .txt file. Firstly I have made the textbox in the html and made a form. I have created a submit button to run the php and made it as the action of the form. This php file contains the code for saving the data. B...
2016/01/29
[ "https://Stackoverflow.com/questions/35091117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5173053/" ]
Try using `onsubmit` event , `event.preventDefault()` to prevent `form` submission , create `script` element with `src` set to expected query string at `php` as parameter to `encodeURIComponent()` , append `script` element to `head` element, at `script` `onload` , `onerror` events remove `script` element ```html <!DOC...
You'll need to use javascript if you want to do something like dynamic form submission. The essence of it is that you want the user to do something, and then behind the scenes respond to that action. To the user, you might just inform them "Hey, I got it". So you'll need javascript - specifically you need to send an...
35,091,117
I want to make a textbox on an webpage which will take a number from user and that number will be saved in a .txt file. Firstly I have made the textbox in the html and made a form. I have created a submit button to run the php and made it as the action of the form. This php file contains the code for saving the data. B...
2016/01/29
[ "https://Stackoverflow.com/questions/35091117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5173053/" ]
Modified Answer,Fix an error of value stored as null, ``` <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"> </script> <script> function callSubmit(){ var dataset = {"value1": document.getElementById('itnumber').value }; $.ajax({ url: 'write2file.php', type: 'POST', da...
You'll need to use javascript if you want to do something like dynamic form submission. The essence of it is that you want the user to do something, and then behind the scenes respond to that action. To the user, you might just inform them "Hey, I got it". So you'll need javascript - specifically you need to send an...
51,364,757
i am really new to the REST world, or in fact the WebApp side of java, so please don't mind if it's a silly question. I have a web page where pressing a button will call the following JS function: ``` function testFunction(){ $(document).ready(function() { $.ajax({ url: "http://loca...
2018/07/16
[ "https://Stackoverflow.com/questions/51364757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9394465/" ]
You cannot call JavaScript code from your REST method in Java. However, you can use the `ClientBuilder` of the `javax.ws.rs.client` package. Your method could look like this: ``` @Path("myresource") public class MyResource { @GET @Produces(MediaType.TEXT_PLAIN) public String getIt() { client =...
Take a look at his: [RestTemplate](http://www.baeldung.com/rest-template). This is Spring, however. Seeing as you are using JAX-RS maybe take a look at this: [Jersey](http://www.baeldung.com/jersey-jax-rs-client). The flow you describe is not possible, it is however possible to chain several requests while using data ...
51,364,757
i am really new to the REST world, or in fact the WebApp side of java, so please don't mind if it's a silly question. I have a web page where pressing a button will call the following JS function: ``` function testFunction(){ $(document).ready(function() { $.ajax({ url: "http://loca...
2018/07/16
[ "https://Stackoverflow.com/questions/51364757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9394465/" ]
You cannot call JavaScript code from your REST method in Java. However, you can use the `ClientBuilder` of the `javax.ws.rs.client` package. Your method could look like this: ``` @Path("myresource") public class MyResource { @GET @Produces(MediaType.TEXT_PLAIN) public String getIt() { client =...
If you wish to call another URL from your server, its a redirect call. Following would be an example server side code if you are using Spring framework. ``` @RequestMapping("/to-be-redirected") public RedirectView localRedirect() { RedirectView redirectView = new RedirectView(); redirectView.setUrl("http://www...
4,479,004
I have some code that moves files to the same directory. What would be a good strategy to: * Detect if a file is a duplicate of an existing file in the directory? This is to decide whether to delete the source or simply leave it. * Rename the source file if a destination file with the same name but different content a...
2010/12/18
[ "https://Stackoverflow.com/questions/4479004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225899/" ]
> > Detect duplicate files? > > > Most programming languages will have a function called something similar to `FileExists` taking a filename and returning a boolean indicating whether a file with the given name exists on the file system. > > Handle files which have identical names but different content? > > > ...
Well, an easy way to do it is to do a [cyclic redundancy check](http://en.wikipedia.org/wiki/Cyclic_redundancy_check). Several languages have functions for this implemented. You can also calculate the md5 sum for your files. This is not 100% reliable though. If you need to check if they are IDENTICAL, you need to open...