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
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Try to create an object class that you can set the properties and let the properties be the value for your view.. Set the datetime data from LINQ as string and not datetime.. ex. ``` //Property class [DataContract()] public class Info { [DataMember(Name = "created_date")] public string CreateDate; } //Controller var ...
try this ``` var select = from s in db.Table where s.date == someDate select new { date = DateTime.Parse(s.date.ToString()).ToString("yyyy-MM-dd"), }; ```
2,428,128
Basically, i need the equivalent of T-SQL `CONVERT(NVARCHAR(10), datevalue, 126)` I've tried: 1. `from t in ctx.table select t.Date.ToString("yyyy-MM-dd")` but it throws not supported exception 2. `from t in ctx.table select "" + t.Date.Year + "-" + t.Date.Month + "-" + t.Date.Day` but i don't think it's an usable so...
2010/03/11
[ "https://Stackoverflow.com/questions/2428128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23795/" ]
Assuming that `t.Date` is nullable (`DateTime?`) this could be the problem, try using: ``` from t in ctx.table select (t.HasValue ? t.Date.Value.ToString("yyyy-MM-dd") : string.Empty ); ``` **Edit: Second try** The problem is the translation to SQL; it tries to translate the `.ToString()` to an SQL representation, ...
Try to create an object class that you can set the properties and let the properties be the value for your view.. Set the datetime data from LINQ as string and not datetime.. ex. ``` //Property class [DataContract()] public class Info { [DataMember(Name = "created_date")] public string CreateDate; } //Controller var ...
1,005,960
i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be. thanks for your attention!
2009/06/17
[ "https://Stackoverflow.com/questions/1005960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85561/" ]
Here's a list implementation in javascript: <http://solutoire.com/2007/10/29/javascript-left-hand-assignment/>
If you can live without the naming, you can do this: ``` var foo = ["coffee", "brown", "caffeine"]; foo[0] + " is " + foo[1] + " and " + foo[2] + " makes it special"; ``` Alternatively, use a object to name the keys: ``` var foo = {drink: "coffee", color: "brown", power: "caffeine"}; foo.drink + " is " + foo.color...
1,005,960
i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be. thanks for your attention!
2009/06/17
[ "https://Stackoverflow.com/questions/1005960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85561/" ]
Maybe [PHP.JS](http://phpjs.org/) is worth looking at (for future stuff maybe). I noticed that the [list()](http://trac.plutonia.nl/projects/phpjs/browser/trunk/_experimental/array/list.js) was only experimental though but maybe it works.
If you can live without the naming, you can do this: ``` var foo = ["coffee", "brown", "caffeine"]; foo[0] + " is " + foo[1] + " and " + foo[2] + " makes it special"; ``` Alternatively, use a object to name the keys: ``` var foo = {drink: "coffee", color: "brown", power: "caffeine"}; foo.drink + " is " + foo.color...
1,005,960
i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be. thanks for your attention!
2009/06/17
[ "https://Stackoverflow.com/questions/1005960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85561/" ]
Here's a list implementation in javascript: <http://solutoire.com/2007/10/29/javascript-left-hand-assignment/>
I think the closest you can get is the explicit ``` var args = inputString.split(","); // Error checking, may not be necessary if (args.length < 3) { throw new Error("Not enough arguments supplied in comma-separated input string"); } var drink = args[0]; var color = args[1]; var power = args[2]; ``` since Javas...
1,005,960
i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be. thanks for your attention!
2009/06/17
[ "https://Stackoverflow.com/questions/1005960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85561/" ]
Maybe [PHP.JS](http://phpjs.org/) is worth looking at (for future stuff maybe). I noticed that the [list()](http://trac.plutonia.nl/projects/phpjs/browser/trunk/_experimental/array/list.js) was only experimental though but maybe it works.
I think the closest you can get is the explicit ``` var args = inputString.split(","); // Error checking, may not be necessary if (args.length < 3) { throw new Error("Not enough arguments supplied in comma-separated input string"); } var drink = args[0]; var color = args[1]; var power = args[2]; ``` since Javas...
1,005,960
i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be. thanks for your attention!
2009/06/17
[ "https://Stackoverflow.com/questions/1005960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/85561/" ]
Here's a list implementation in javascript: <http://solutoire.com/2007/10/29/javascript-left-hand-assignment/>
Maybe [PHP.JS](http://phpjs.org/) is worth looking at (for future stuff maybe). I noticed that the [list()](http://trac.plutonia.nl/projects/phpjs/browser/trunk/_experimental/array/list.js) was only experimental though but maybe it works.
11,723,996
When I run this code: ``` double d = 0.0; for (int i = 0; i < 90; i++) { d += .01; d %= 1; Console.WriteLine(d); } ``` I would expect the output to be ``` 0.01 0.02 0.03 ... 0.9 ``` It acts like that until it gets to what should be 0.81. This is the output I see: ``` ... 0.8 0.810000000000001 0.82000...
2012/07/30
[ "https://Stackoverflow.com/questions/11723996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807137/" ]
0.01 is a decimal fraction: 1/100. Binary floating-point numbers can only represent fractions with a finite number of digits if the denominator is a power of two. One hundred, of course, is not a power of two. (Decimal fractions can be finite if the denominator's only prime factors are 2 and 5, which are of course the ...
try this ``` double d = 0.0; for (int i = 0; i < 90; i++) { d += .01; d %= 1; Console.WriteLine(Math.Round(d, 2)); } ``` I think you do not get the expected result due to rounding
11,723,996
When I run this code: ``` double d = 0.0; for (int i = 0; i < 90; i++) { d += .01; d %= 1; Console.WriteLine(d); } ``` I would expect the output to be ``` 0.01 0.02 0.03 ... 0.9 ``` It acts like that until it gets to what should be 0.81. This is the output I see: ``` ... 0.8 0.810000000000001 0.82000...
2012/07/30
[ "https://Stackoverflow.com/questions/11723996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807137/" ]
try this ``` double d = 0.0; for (int i = 0; i < 90; i++) { d += .01; d %= 1; Console.WriteLine(Math.Round(d, 2)); } ``` I think you do not get the expected result due to rounding
Use `decimal`: ``` decimal d = 0.0m; for (int i = 0; i < 90; i++) { d += .01m; d %= 1; Console.WriteLine(d); } ```
11,723,996
When I run this code: ``` double d = 0.0; for (int i = 0; i < 90; i++) { d += .01; d %= 1; Console.WriteLine(d); } ``` I would expect the output to be ``` 0.01 0.02 0.03 ... 0.9 ``` It acts like that until it gets to what should be 0.81. This is the output I see: ``` ... 0.8 0.810000000000001 0.82000...
2012/07/30
[ "https://Stackoverflow.com/questions/11723996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807137/" ]
0.01 is a decimal fraction: 1/100. Binary floating-point numbers can only represent fractions with a finite number of digits if the denominator is a power of two. One hundred, of course, is not a power of two. (Decimal fractions can be finite if the denominator's only prime factors are 2 and 5, which are of course the ...
Use `decimal`: ``` decimal d = 0.0m; for (int i = 0; i < 90; i++) { d += .01m; d %= 1; Console.WriteLine(d); } ```
63,750,026
Sorry if this is a stupid question. I am trying to teach myself some programming and fell into a little confusion here. The code: ``` #include <stdio.h> void main() { int i; char *array[5]={"Apples", "mangoes", "grapes", "bananas", "oranges"}; printf("THIS IS FROM THE ARRAY:\n"); for(i = 0; i < 5; i...
2020/09/05
[ "https://Stackoverflow.com/questions/63750026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2615642/" ]
First, when printing addresses you should use the `%p` format specifier and cast the argument to `void *`. That being said, the addresses being printed *are* the addresses of where the strings are stored. If you look closely at the differences between the address of each pointer, you'll see that these differences exac...
`sizeof(array[i])` gives you the size of a `char *` not the length of the string. Use `strlen()+1` for the number of bytes in a string. The difference of 7 makes perfect sense for a 6-letter word (+ terminating NUL character). Also, as chux says you should use `%p` to print a pointer value (and to be extra correct, t...
63,750,026
Sorry if this is a stupid question. I am trying to teach myself some programming and fell into a little confusion here. The code: ``` #include <stdio.h> void main() { int i; char *array[5]={"Apples", "mangoes", "grapes", "bananas", "oranges"}; printf("THIS IS FROM THE ARRAY:\n"); for(i = 0; i < 5; i...
2020/09/05
[ "https://Stackoverflow.com/questions/63750026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2615642/" ]
First, when printing addresses you should use the `%p` format specifier and cast the argument to `void *`. That being said, the addresses being printed *are* the addresses of where the strings are stored. If you look closely at the differences between the address of each pointer, you'll see that these differences exac...
You can find out that the array of `char*` exists consecutively if you print `strlen(array[i])` instead of `sizeof(array[i])`. `main()` should return int. `void main()` is not a standard. You should declare `const char*` for your array, not `char*`. It is not modifiable. ``` #include <stdio.h> #include <string.h> i...
23,665,723
Is there any benefit to creating an index on a temporary table containing just a primary key from a materialized query? I want to delete some data from a particular table, as well as other related tables with foreign key references. In order to improve performance, I'm materializing the initial select into a temp tab...
2014/05/14
[ "https://Stackoverflow.com/questions/23665723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1181114/" ]
It entirely depends on what type of queries you run. If you only ever run queries that need to read, or return, the entire table or a significant subset of the entire table, then adding an index will only result in decreasing write performance (which it always does). If you will often execute queries that can use such ...
Actually, this is one case where a primary key index could be dangerous for performance. The queries that you have essentially have two logical execution paths. One is to read the "other" table and look up values in ids. The second is to read the id table and look up values in the "other" table. The latter execution p...
32,622,822
I have two pages in my application. One is for Login User say `Default.asp` and Other for SingleSignon say `sso.aspx` If the user comes through the single sign on and session expires to redirected to `Default.aspx` where user can enter username and password and click login. I want to show different panel on defa...
2015/09/17
[ "https://Stackoverflow.com/questions/32622822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853609/" ]
As you are using the ASP.NET you can use the following two options in Page Load. Option : 1 `Request.ServerVariables["HTTP_REFERER"]` Although note on the above it is possible for browsers to block the value (empty value). Option : 2 You can check the `Request.UrlReferrer` of the current `HttpRequest`: it will usuall...
Session\_Start event is not suitable for these kind of things. Session\_start runs when a user first enters in your applications, think it like the first page load. You can use a query string parameter to determine where the user redirected from. For example, if user redirected from sso.aspx to default.aspx, use url ...
26,009,989
``` void local () { int x = 100; double *loc; loc = (double *) malloc(sizeof(double)*100); memset(rxnrun, 0x0, sizeof(double)*100); // perform some operations // free(loc); return; // without doing free for loc variable } ``` here, i can see what is wrong as memory leak is there for `lo...
2014/09/24
[ "https://Stackoverflow.com/questions/26009989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080000/" ]
Actually, both the `x` and `loc` variables are local function variables, and **both variables are freed** when the function returns. However, `loc` is a pointer and the **memory the pointer points to is what is not freed**. It's just the memory allocated by `malloc()` that is not freed.
All C implementations use a [call stack](http://en.wikipedia.org/wiki/Call_stack). So a local variable is on that stack (or in a register) and disappears when the called function returns. In theory, C does not require any call stack. In practice, all C implementations use one. In fact, a local variable is lost (so di...
26,009,989
``` void local () { int x = 100; double *loc; loc = (double *) malloc(sizeof(double)*100); memset(rxnrun, 0x0, sizeof(double)*100); // perform some operations // free(loc); return; // without doing free for loc variable } ``` here, i can see what is wrong as memory leak is there for `lo...
2014/09/24
[ "https://Stackoverflow.com/questions/26009989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080000/" ]
All C implementations use a [call stack](http://en.wikipedia.org/wiki/Call_stack). So a local variable is on that stack (or in a register) and disappears when the called function returns. In theory, C does not require any call stack. In practice, all C implementations use one. In fact, a local variable is lost (so di...
variables x and loc will be forgotten, but memory allocated by malloc will be occupied but pointer to this memory will be forgotten. nothing good will come.
26,009,989
``` void local () { int x = 100; double *loc; loc = (double *) malloc(sizeof(double)*100); memset(rxnrun, 0x0, sizeof(double)*100); // perform some operations // free(loc); return; // without doing free for loc variable } ``` here, i can see what is wrong as memory leak is there for `lo...
2014/09/24
[ "https://Stackoverflow.com/questions/26009989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1080000/" ]
Actually, both the `x` and `loc` variables are local function variables, and **both variables are freed** when the function returns. However, `loc` is a pointer and the **memory the pointer points to is what is not freed**. It's just the memory allocated by `malloc()` that is not freed.
variables x and loc will be forgotten, but memory allocated by malloc will be occupied but pointer to this memory will be forgotten. nothing good will come.
35,781,466
Here is my string I'm passing to the geocoder service. > > <http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Lindon&region=GB&componentRestrictions=locality> > > > where region=GB is country code for United Kingdom and instead of London I'm passing in Lindon. Componentrestrictions=locality sho...
2016/03/03
[ "https://Stackoverflow.com/questions/35781466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1186050/" ]
1. there is no parameter `componentRestrictions`(this parameter belongs to the Javascript-API), the parameter for the Webservice is called `components` 2. a component must have a name(e.g. `locality`) **and** a value. In your case, when you want to search for a city called **Lindon** it should be `locality:Lindon` 3. t...
Add ",GB" for address parameter. <http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Lindon,UK&region=GB&componentRestrictions=locality&language=en> [![enter image description here](https://i.stack.imgur.com/qVTDC.png)](https://i.stack.imgur.com/qVTDC.png) The region parameter is just "biasing", not...
9,949,103
I need a program that reads from multiple files and displays a report based on the date range entered by the user.Data in the files looks like: ``` [C445] ComputerName:FRONTOFFICE UserID:YB Yenae Ball Station 7A LanId: | (11/23 17:01:55) | Client is disconnected from agent. [C445] ComputerName:FRONTOFFICE UserID:YB Y...
2012/03/30
[ "https://Stackoverflow.com/questions/9949103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1297592/" ]
Instead of printing as you go, try accumulating the data in a map (key: computer name, value: number of disconnects). Then sort on the map keys and print the final totals.
Try creating an object that represents a dataset, create a list of those datasets as well as a `Comparator` and call `Collections.sort(list, comparator)`. Alternatively put the datasets into a sorted collection like a `TreeMap` and use the number of connections as the key. Note that if you want to combine the data of...
27,293,885
I need to apply multiple effects ( mainly innershadow and dropshadow ) through CSS. But I'm not able to chain these effects. Is there CSS equivalent for [setInput()](https://docs.oracle.com/javafx/2/api/javafx/scene/effect/Shadow.html#setInput(javafx.scene.effect.Effect)) of javafx.scene.effect.Effect? So far I foun...
2014/12/04
[ "https://Stackoverflow.com/questions/27293885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2115117/" ]
For Json Parsing in angular you have to use the following code in success method. ``` .success(function(data){ var response=angular.fromJson(data); $scope.artists = response.fields; }) ``` modify your `<table>` as below, Because you have assign the response array to $scope.artists. Then you can use yo...
Shouldn't JSON.parse just work? ``` $scope.artists = JSON.parse(data); ```
27,293,885
I need to apply multiple effects ( mainly innershadow and dropshadow ) through CSS. But I'm not able to chain these effects. Is there CSS equivalent for [setInput()](https://docs.oracle.com/javafx/2/api/javafx/scene/effect/Shadow.html#setInput(javafx.scene.effect.Effect)) of javafx.scene.effect.Effect? So far I foun...
2014/12/04
[ "https://Stackoverflow.com/questions/27293885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2115117/" ]
For Json Parsing in angular you have to use the following code in success method. ``` .success(function(data){ var response=angular.fromJson(data); $scope.artists = response.fields; }) ``` modify your `<table>` as below, Because you have assign the response array to $scope.artists. Then you can use yo...
You have an error in your html, try : ``` <td> {({ fields.artist.link.})} </td> ``` instead of artist.fields.link, according to your json : \"fields\": {\"artist\": \"Leonardo da Vinci\", \"link\": \
14,286,150
I am trying to understand the below algorithm for matrix multiplication using dynamic programming. If `mi, j` is the minimum cost of evaluating the product `Mi × ... × Mj` then: * mi, j = 0, if i = j, and * mi, j = MIN, i ≤ k < j { mi,k + mk+1,j + ri-1rkrj }, if i < j. Algorithm: ``` for i := 1 to n do mi,i := ...
2013/01/11
[ "https://Stackoverflow.com/questions/14286150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1819898/" ]
The algorithm finds the lowest cost to multiply a chain of matrices. Given a matrix `A` with `p` rows and `q` columns, and a matrix `B` with `q` rows and `r` columns, the standard matrix multiplication `A·B` takes `p*q*r` multiplications - for each of the `p×r` entries of the product, `q` multiplications between the e...
i dont like copy&paste, i'll keep it short and give in my own words: the key point for this problem is: calculating A\*B\*C has only two possible ways: A\*(B\*C) or (A\*B)\*C. similarly, calculating A\*B\*C\*D has only three ways: A\*(B\*C\*D), (A\*B)\*(C\*D), (A\*B\*C)\*D. (note: (B\*C\*D) and (A\*B\*C) here is a sub...
74,411,450
some previous questions have been asked on this topic, but they don't seem to include the case when a string contains multiple instances of the same delimiter. [How to extract substring between patterns "\_" and "." in R](https://stackoverflow.com/questions/23518325/how-to-extract-substring-between-patterns-and-in-r) ...
2022/11/12
[ "https://Stackoverflow.com/questions/74411450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473437/" ]
``` library(tidyverse) get_name <- function(position) { vec %>% str_split("/") %>% map_chr( ~ .x[position]) } ``` Get position 2 ``` get_name(2) [1] "Germany" "Germany" "Croatia" "Croatia" ``` Get position 3 ``` get_name(3) [1] "Berlin" "Berlin" "Zagreb" "Zagreb" ```
We can try using `sapply()` along with `strsplit()` here for a base R solution: ```r unname(sapply(vec, function(x) unlist(strsplit(x, "/"))[2])) [1] "Germany" "Germany" "Croatia" "Croatia" unname(sapply(vec, function(x) unlist(strsplit(x, "/"))[3])) [1] "Berlin" "Berlin" "Zagreb" "Zagreb" ```
74,411,450
some previous questions have been asked on this topic, but they don't seem to include the case when a string contains multiple instances of the same delimiter. [How to extract substring between patterns "\_" and "." in R](https://stackoverflow.com/questions/23518325/how-to-extract-substring-between-patterns-and-in-r) ...
2022/11/12
[ "https://Stackoverflow.com/questions/74411450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473437/" ]
We can try using `sapply()` along with `strsplit()` here for a base R solution: ```r unname(sapply(vec, function(x) unlist(strsplit(x, "/"))[2])) [1] "Germany" "Germany" "Croatia" "Croatia" unname(sapply(vec, function(x) unlist(strsplit(x, "/"))[3])) [1] "Berlin" "Berlin" "Zagreb" "Zagreb" ```
Here is another option. When you have a structured text like this, you can create four capture groups to encompass the text between the back slashes, then you can call the captured text by group: ```r vec <- c("Europe/Germany/Berlin/Mitte", "Europe/Germany/Berlin/Charlottenburg", "Europe/Croatia/Za...
74,411,450
some previous questions have been asked on this topic, but they don't seem to include the case when a string contains multiple instances of the same delimiter. [How to extract substring between patterns "\_" and "." in R](https://stackoverflow.com/questions/23518325/how-to-extract-substring-between-patterns-and-in-r) ...
2022/11/12
[ "https://Stackoverflow.com/questions/74411450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8473437/" ]
``` library(tidyverse) get_name <- function(position) { vec %>% str_split("/") %>% map_chr( ~ .x[position]) } ``` Get position 2 ``` get_name(2) [1] "Germany" "Germany" "Croatia" "Croatia" ``` Get position 3 ``` get_name(3) [1] "Berlin" "Berlin" "Zagreb" "Zagreb" ```
Here is another option. When you have a structured text like this, you can create four capture groups to encompass the text between the back slashes, then you can call the captured text by group: ```r vec <- c("Europe/Germany/Berlin/Mitte", "Europe/Germany/Berlin/Charlottenburg", "Europe/Croatia/Za...
66,739
Matthew 21:12 "he overturned the tables of the money-changers and the seats of those who sold pigeons". ESV This is repeated in Mark 11:15. John 2:16 "And he told those who sold the pigeons, "Take these things away..". A. I think in John 2:16 Jesus treats the pigeon sellers relatively gently. NIV "Get these out of he...
2021/08/19
[ "https://hermeneutics.stackexchange.com/questions/66739", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/25763/" ]
Here I consider what I think are the relative merits of 4 translations: 1. Coverdale Bible. "Go ye youre waye". i.e. don't change direction, but as ye go about your normal buisness preach the gospel. This then is not so much an instruction to forsake all and become a missionary; you already are one with your usual con...
A complete list of verbs/participles for Matt 28:19, 20 is as follows: **V19** * πορευθέντες = having gone = aorist passive participle * **μαθητεύσατε** = disciple = **verb**, aorist imperative active * βαπτίζοντες = baptizing = present active participle **V20a** * διδάσκοντες = teaching = present active participle...
66,739
Matthew 21:12 "he overturned the tables of the money-changers and the seats of those who sold pigeons". ESV This is repeated in Mark 11:15. John 2:16 "And he told those who sold the pigeons, "Take these things away..". A. I think in John 2:16 Jesus treats the pigeon sellers relatively gently. NIV "Get these out of he...
2021/08/19
[ "https://hermeneutics.stackexchange.com/questions/66739", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/25763/" ]
A complete list of verbs/participles for Matt 28:19, 20 is as follows: **V19** * πορευθέντες = having gone = aorist passive participle * **μαθητεύσατε** = disciple = **verb**, aorist imperative active * βαπτίζοντες = baptizing = present active participle **V20a** * διδάσκοντες = teaching = present active participle...
Why is μαθητεύσατε translated "*make* disciples of all nations" in the newer translations when the older ones and the modern literal translations render it "*disciple* (or teach) all nations", ie without "make? I note that Blass & Debrunner's Grammar 148(3) say that μαθητεύσατε involves a transitive use of an original...
66,739
Matthew 21:12 "he overturned the tables of the money-changers and the seats of those who sold pigeons". ESV This is repeated in Mark 11:15. John 2:16 "And he told those who sold the pigeons, "Take these things away..". A. I think in John 2:16 Jesus treats the pigeon sellers relatively gently. NIV "Get these out of he...
2021/08/19
[ "https://hermeneutics.stackexchange.com/questions/66739", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/25763/" ]
Here I consider what I think are the relative merits of 4 translations: 1. Coverdale Bible. "Go ye youre waye". i.e. don't change direction, but as ye go about your normal buisness preach the gospel. This then is not so much an instruction to forsake all and become a missionary; you already are one with your usual con...
Why is μαθητεύσατε translated "*make* disciples of all nations" in the newer translations when the older ones and the modern literal translations render it "*disciple* (or teach) all nations", ie without "make? I note that Blass & Debrunner's Grammar 148(3) say that μαθητεύσατε involves a transitive use of an original...
4,147,062
I have two BMWs and two Mercedes and one Kia. They are in a MySQL table with car\_id and brand.I want to know how what brands of car I only have one of. So what I expect returned is one record in this case with a brand of 'Kia' I don't want BMW or Mercedes to show up at all. **Edit** I've over simplified my problem. ...
2010/11/10
[ "https://Stackoverflow.com/questions/4147062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10738/" ]
Use: ``` SELECT t.hid FROM YOUR_TABLE t GROUP BY t.hid HAVING COUNT(*) > 1 ``` Previously: ``` SELECT t.brand FROM YOUR_TABLE t GROUP BY t.brand HAVING COUNT(*) = 1 ```
It *sounds* as though you want a single query which will return both the total number of records *and* the number of `hid`s that only occur once - if so, try: ``` select sum(count_hid) total_count, sum(case count_hid when 1 then 1 else 0 end) singles_count from (select count(*) count_hid from your_table grou...
36,161,513
Is it possible to achieve something like sublime does, and if yes - how ? [![enter image description here](https://i.stack.imgur.com/O8V5U.png)](https://i.stack.imgur.com/O8V5U.png)
2016/03/22
[ "https://Stackoverflow.com/questions/36161513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4758450/" ]
You can get icons by using this extension. Check it out: <https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons> > > Installation > > > Some people have reported that they cannot find the extension when > they insert the installation command: > > > ext install vscode-icons > > > If y...
No, not yet at least. The feature request tracking this is [#211](https://github.com/Microsoft/vscode/issues/211).
36,161,513
Is it possible to achieve something like sublime does, and if yes - how ? [![enter image description here](https://i.stack.imgur.com/O8V5U.png)](https://i.stack.imgur.com/O8V5U.png)
2016/03/22
[ "https://Stackoverflow.com/questions/36161513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4758450/" ]
As of 1.5 this a few of the icon themes are built in: <https://code.visualstudio.com/updates/v1_5> > > **File Icon Themes** > > > The File Explorer can now show file and folder icons. > To enable file icons, pick a File Icon Theme: > > > Use the global menu File > Preferences > File Icon Theme (Code > > Prefere...
No, not yet at least. The feature request tracking this is [#211](https://github.com/Microsoft/vscode/issues/211).
36,161,513
Is it possible to achieve something like sublime does, and if yes - how ? [![enter image description here](https://i.stack.imgur.com/O8V5U.png)](https://i.stack.imgur.com/O8V5U.png)
2016/03/22
[ "https://Stackoverflow.com/questions/36161513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4758450/" ]
You can get icons by using this extension. Check it out: <https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons> > > Installation > > > Some people have reported that they cannot find the extension when > they insert the installation command: > > > ext install vscode-icons > > > If y...
As of 1.5 this a few of the icon themes are built in: <https://code.visualstudio.com/updates/v1_5> > > **File Icon Themes** > > > The File Explorer can now show file and folder icons. > To enable file icons, pick a File Icon Theme: > > > Use the global menu File > Preferences > File Icon Theme (Code > > Prefere...
33,133,627
I have a project which I would like to have it's documentation on a external server. I know I do `pydoc -p 5000` I will have my documentation on `http://localhost:5000/`. However I'm planning to host that documentation on a EC2 instance, as an external server everyone can access. Let's say the IP address of the machine...
2015/10/14
[ "https://Stackoverflow.com/questions/33133627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1040718/" ]
As the [docs](https://docs.python.org/2/library/pydoc.html) state: > > Specifying a `-w` flag before the argument will cause HTML documentation to be written out to a file in the current directory, instead of displaying text on the console. > > > Therefore, use the `-w` flag to write the documentation to files, w...
This feature will be added in version `3.7`. [Documentation](https://python.readthedocs.io/en/latest/library/pydoc.html#module-pydoc). Changed in version 3.7: Added the `-n` option.
65,542,483
I am developing an application on React Native, with this app i want to connect my chatbot developed on Python ( NLP) . How can i fetch data from my python trained model and run it on real time using React Native front end
2021/01/02
[ "https://Stackoverflow.com/questions/65542483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14912369/" ]
Change the minSdkversion 21. You can change it from android/build.gradle directly Open the project go to the android folder and open build.gradle file. In this you can find ``` buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersio...
In my case the answer of this error you just need to add the library in your gradle gradle -> gradle.properties android.enableJetifier=true
22,176,398
I have this test program where I am seeing a NullPointer exception. I need help finding out how to solve it and would like to know the root cause. ``` public class test { private static void practice(String[] words) { int vowelPosition = 0; int consonantPosition = 0; char[] vowel = (char[...
2014/03/04
[ "https://Stackoverflow.com/questions/22176398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3010224/" ]
You have assigned: ``` char[] vowel = (char[])null; ``` and you refer : ``` vowel[j] = words[i].charAt(j); ``` Since the `vowel` array is `null`, this is why you get a NPE. In order to fix it, you need to assign the `vowel` array with a non-null value: ``` char[] vowel = new char[100]; //for example ```
You should allocate memory for vowel and consonant, otherwise they are null. You can do that like this: ``` char[] vowel = (char[])null; char[] consonant = (char[])null; ``` If you don't know how much memory you should allocate for your variable, you can use ArrayList which could allocate memory automaticly. Replace...
22,176,398
I have this test program where I am seeing a NullPointer exception. I need help finding out how to solve it and would like to know the root cause. ``` public class test { private static void practice(String[] words) { int vowelPosition = 0; int consonantPosition = 0; char[] vowel = (char[...
2014/03/04
[ "https://Stackoverflow.com/questions/22176398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3010224/" ]
You have assigned: ``` char[] vowel = (char[])null; ``` and you refer : ``` vowel[j] = words[i].charAt(j); ``` Since the `vowel` array is `null`, this is why you get a NPE. In order to fix it, you need to assign the `vowel` array with a non-null value: ``` char[] vowel = new char[100]; //for example ```
change these two lines ``` char[] vowel = (char[]) null; char[] consonant = (char[]) null; ``` to ``` char[] vowel=new char[100]; char[] consonant = new char[100]; ``` because of intialising these two arrays with null values,you are getting NPE.
22,176,398
I have this test program where I am seeing a NullPointer exception. I need help finding out how to solve it and would like to know the root cause. ``` public class test { private static void practice(String[] words) { int vowelPosition = 0; int consonantPosition = 0; char[] vowel = (char[...
2014/03/04
[ "https://Stackoverflow.com/questions/22176398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3010224/" ]
You have assigned: ``` char[] vowel = (char[])null; ``` and you refer : ``` vowel[j] = words[i].charAt(j); ``` Since the `vowel` array is `null`, this is why you get a NPE. In order to fix it, you need to assign the `vowel` array with a non-null value: ``` char[] vowel = new char[100]; //for example ```
The way you init the two arrays is wrong! ``` char[] vowel = (char[])null; char[] consonant = (char[])null; ``` You have to assign space for vowel and consonant with a non-null value.
22,176,398
I have this test program where I am seeing a NullPointer exception. I need help finding out how to solve it and would like to know the root cause. ``` public class test { private static void practice(String[] words) { int vowelPosition = 0; int consonantPosition = 0; char[] vowel = (char[...
2014/03/04
[ "https://Stackoverflow.com/questions/22176398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3010224/" ]
You should allocate memory for vowel and consonant, otherwise they are null. You can do that like this: ``` char[] vowel = (char[])null; char[] consonant = (char[])null; ``` If you don't know how much memory you should allocate for your variable, you can use ArrayList which could allocate memory automaticly. Replace...
change these two lines ``` char[] vowel = (char[]) null; char[] consonant = (char[]) null; ``` to ``` char[] vowel=new char[100]; char[] consonant = new char[100]; ``` because of intialising these two arrays with null values,you are getting NPE.
22,176,398
I have this test program where I am seeing a NullPointer exception. I need help finding out how to solve it and would like to know the root cause. ``` public class test { private static void practice(String[] words) { int vowelPosition = 0; int consonantPosition = 0; char[] vowel = (char[...
2014/03/04
[ "https://Stackoverflow.com/questions/22176398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3010224/" ]
You should allocate memory for vowel and consonant, otherwise they are null. You can do that like this: ``` char[] vowel = (char[])null; char[] consonant = (char[])null; ``` If you don't know how much memory you should allocate for your variable, you can use ArrayList which could allocate memory automaticly. Replace...
The way you init the two arrays is wrong! ``` char[] vowel = (char[])null; char[] consonant = (char[])null; ``` You have to assign space for vowel and consonant with a non-null value.
364,945
`/etc/systemd/system/volume.service` ==================================== This is my first attempt to create a unit file. ``` [Unit] Description="Set volume level." After=sound.target [Service] Type=simple ExecStart='/usr/bin/amixer sset PCM -- 97%' [Install] WantedBy=multi-user.target ``` I had to update the uni...
2017/05/14
[ "https://unix.stackexchange.com/questions/364945", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/33386/" ]
The single quotes in your `ExecStart` line are problematic: > > ExecStart='/usr/bin/amixer sset PCM -- 97%' > > > According to [systemd.service](https://www.freedesktop.org/software/systemd/man/systemd.service.html): > > Double quotes ("…") and single quotes ('…') may be used, in which case everything until the...
Create a Unit File "drop-in" ============================ This thing makes it possible to change unit files without messing up upgrading (upstream changes). Because unit files should not be changed significantly (collective agreement here, I suppose), a downstream change (drop-in) should be expected to work for a long...
13,783,751
Hey I'm very new to iPhone programming and I have been searching for hours both on this site and on google for the solution to my problem. Basically I am trying to make an app which selects a random string out of my plist and displays it into a text field. I have tried countless ways, but this way seems to work the bes...
2012/12/09
[ "https://Stackoverflow.com/questions/13783751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1888703/" ]
it's the " change ``` <input type="text" id="term" value="<?php echo '<div id="demo"></div>';?>"> ``` to ``` <input type="text" id="term" value="<?php echo "<div id='demo'></div>";?>"> ```
You have double quotes around the word demo that are closing your value. Try: ``` <?php echo "<div id='demo'></div>";?> ```
13,783,751
Hey I'm very new to iPhone programming and I have been searching for hours both on this site and on google for the solution to my problem. Basically I am trying to make an app which selects a random string out of my plist and displays it into a text field. I have tried countless ways, but this way seems to work the bes...
2012/12/09
[ "https://Stackoverflow.com/questions/13783751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1888703/" ]
it's the " change ``` <input type="text" id="term" value="<?php echo '<div id="demo"></div>';?>"> ``` to ``` <input type="text" id="term" value="<?php echo "<div id='demo'></div>";?>"> ```
``` <label>Search Term: <input type="text" id="term" value="<?php echo '<div id="demo"></div>';?>"> </label> ``` What i see from the above script is, you used a double quote to represent your attribute value.. and then single quote to handle the php echo value, then used a double quote again inside ...
13,783,751
Hey I'm very new to iPhone programming and I have been searching for hours both on this site and on google for the solution to my problem. Basically I am trying to make an app which selects a random string out of my plist and displays it into a text field. I have tried countless ways, but this way seems to work the bes...
2012/12/09
[ "https://Stackoverflow.com/questions/13783751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1888703/" ]
it's the " change ``` <input type="text" id="term" value="<?php echo '<div id="demo"></div>';?>"> ``` to ``` <input type="text" id="term" value="<?php echo "<div id='demo'></div>";?>"> ```
Its because the HTTP headers, which you are sending like above, are telling the browser to expect a file to be downloaded. They are not telling browser to expect HTML content (default). Therefore the content you are sending in an echo is not getting displayed. Both won't work together correctly although I'm sure you c...
32,603,837
I have a excel with the following fields: ``` Date Name Task ======================== 16/09/2015 AT 1 16/09/2015 AT 2 16/09/2015 AT 3 16/09/2015 BT 4 16/09/2015 BT 5 16/09/2015 CT 6 15/09/2015 AT 7 15/09/2015 BT 8 15/09/2015 CT 9 ``` The excel s...
2015/09/16
[ "https://Stackoverflow.com/questions/32603837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2370199/" ]
I found the solution for **Objective-C**: ``` if ([UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:@"word"]) { UIReferenceLibraryViewController* ref = [[UIReferenceLibraryViewController alloc] initWithTerm:@"word"]; [currentViewController presentViewController:ref animated:YES completio...
Try with this ``` func wordIsReal(word: String) -> Bool { let checker = UITextChecker() let range = NSMakeRange(0, count(word)) let misspelledRange = checker.rangeOfMisspelledWordInString(word, range: range, startingAt: 0, wrap: false, language: "en_US") NSLog("misspelledRange:\(misspelledRange)") ...
26,477,671
In my previous [question](https://stackoverflow.com/questions/26477209/is-void0-a-null-pointer-constant), the discussion seems to imply that there might be a defect in the C standard, further implied by the top answerer's last sentence: > > The authors of the standard merely neglected to say so. > > > I'm aware t...
2014/10/21
[ "https://Stackoverflow.com/questions/26477671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4164058/" ]
Keeping up with the C standards process is not as convenient as keeping up with the C++ process but by starting from the [WG14 page](http://www.open-std.org/jtc1/sc22/wg14/) we can find the [Defect report summary for C11](http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm) linked at the top and with a some ext...
The link in the question for C++ is to the WG21 (Working Group 21) site. It may come as no surprise that there is one for C, namely WG14, here: <http://www.open-std.org/jtc1/sc22/wg14/> The most recent defect report I see is this one: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm> There is a meeting in...
26,477,671
In my previous [question](https://stackoverflow.com/questions/26477209/is-void0-a-null-pointer-constant), the discussion seems to imply that there might be a defect in the C standard, further implied by the top answerer's last sentence: > > The authors of the standard merely neglected to say so. > > > I'm aware t...
2014/10/21
[ "https://Stackoverflow.com/questions/26477671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4164058/" ]
The link in the question for C++ is to the WG21 (Working Group 21) site. It may come as no surprise that there is one for C, namely WG14, here: <http://www.open-std.org/jtc1/sc22/wg14/> The most recent defect report I see is this one: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm> There is a meeting in...
No, there is not a specific website, or dedicated mailing list. The procedure for filing bug reports is outlined at URL: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/template.htm> Substitute the email address of the current Convenor, on the page: <http://www.open-std.org/jtc1/sc22/wg14/www/contacts> as...
26,477,671
In my previous [question](https://stackoverflow.com/questions/26477209/is-void0-a-null-pointer-constant), the discussion seems to imply that there might be a defect in the C standard, further implied by the top answerer's last sentence: > > The authors of the standard merely neglected to say so. > > > I'm aware t...
2014/10/21
[ "https://Stackoverflow.com/questions/26477671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4164058/" ]
Keeping up with the C standards process is not as convenient as keeping up with the C++ process but by starting from the [WG14 page](http://www.open-std.org/jtc1/sc22/wg14/) we can find the [Defect report summary for C11](http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm) linked at the top and with a some ext...
No, there is not a specific website, or dedicated mailing list. The procedure for filing bug reports is outlined at URL: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/template.htm> Substitute the email address of the current Convenor, on the page: <http://www.open-std.org/jtc1/sc22/wg14/www/contacts> as...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
I got around this by moving my engine's routes from config/routes.rb to a class method in the engine class itself: ``` module MyEngine class Engine < Rails::Engine def self.routes MyRailsApp::Application.routes.draw do resources :products end end end end ``` and then in the base app's...
There is no way to override a route within an engine. Instead, you must define an overruling route. You can do this by calling `prepend` on the engine's router: ``` An::Engine.routes.prepend do root :to => "somewhere#action" end ``` If the engine's namespace is isolated, this will use the `SomewhereController` fro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
Routing rules defined in routes.rb are applied from the top down until a match is found. I was able to override the route defined in the mounted engine simply by moving the higher-priority rule *above* the line where the engine is mounted. So, ```html get 'about', controller: 'static', action: 'about', as: 'about' mo...
To Replace the default routes path provided by gem or engine we can achive that in following way. For me I wanted to replace 'spree\_user' with 'account' etc from all routes /user/**spree\_user**/sign\_in I did this in following way Step 1 Create config/some\_engine\_route\_override.rb Copy the content of engine ro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
I'm afraid that there's no such easy way. The routes are defined in `lib/action_dispatch/routing/mapper.rb:271`, which calls add\_route on the RouteSet (defined in `rack-mount-0.6.14/lib/rack/mount/route_set.rb`, and on line 71 the name is attached). There's no remove\_route method, and the Engine's route is added last...
Routing rules defined in routes.rb are applied from the top down until a match is found. I was able to override the route defined in the mounted engine simply by moving the higher-priority rule *above* the line where the engine is mounted. So, ```html get 'about', controller: 'static', action: 'about', as: 'about' mo...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
I'm afraid that there's no such easy way. The routes are defined in `lib/action_dispatch/routing/mapper.rb:271`, which calls add\_route on the RouteSet (defined in `rack-mount-0.6.14/lib/rack/mount/route_set.rb`, and on line 71 the name is attached). There's no remove\_route method, and the Engine's route is added last...
There is no way to override a route within an engine. Instead, you must define an overruling route. You can do this by calling `prepend` on the engine's router: ``` An::Engine.routes.prepend do root :to => "somewhere#action" end ``` If the engine's namespace is isolated, this will use the `SomewhereController` fro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
There is no way to override a route within an engine. Instead, you must define an overruling route. You can do this by calling `prepend` on the engine's router: ``` An::Engine.routes.prepend do root :to => "somewhere#action" end ``` If the engine's namespace is isolated, this will use the `SomewhereController` fro...
Routing rules defined in routes.rb are applied from the top down until a match is found. I was able to override the route defined in the mounted engine simply by moving the higher-priority rule *above* the line where the engine is mounted. So, ```html get 'about', controller: 'static', action: 'about', as: 'about' mo...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
You need add initializer hook to config/application.rb, like this: ``` class Application < Rails::Application config.encoding = "utf-8" ... initializer :add_routing_paths do |app| their_routes_path = app.routes_reloader.paths.select{|path| path =~ /DIR/}.first app.routes_reloader.paths.delete(their_ro...
To Replace the default routes path provided by gem or engine we can achive that in following way. For me I wanted to replace 'spree\_user' with 'account' etc from all routes /user/**spree\_user**/sign\_in I did this in following way Step 1 Create config/some\_engine\_route\_override.rb Copy the content of engine ro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
I got around this by moving my engine's routes from config/routes.rb to a class method in the engine class itself: ``` module MyEngine class Engine < Rails::Engine def self.routes MyRailsApp::Application.routes.draw do resources :products end end end end ``` and then in the base app's...
Routing rules defined in routes.rb are applied from the top down until a match is found. I was able to override the route defined in the mounted engine simply by moving the higher-priority rule *above* the line where the engine is mounted. So, ```html get 'about', controller: 'static', action: 'about', as: 'about' mo...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
I'm afraid that there's no such easy way. The routes are defined in `lib/action_dispatch/routing/mapper.rb:271`, which calls add\_route on the RouteSet (defined in `rack-mount-0.6.14/lib/rack/mount/route_set.rb`, and on line 71 the name is attached). There's no remove\_route method, and the Engine's route is added last...
To Replace the default routes path provided by gem or engine we can achive that in following way. For me I wanted to replace 'spree\_user' with 'account' etc from all routes /user/**spree\_user**/sign\_in I did this in following way Step 1 Create config/some\_engine\_route\_override.rb Copy the content of engine ro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
You can prepend routes as suggest by Ryan Bigg above. I found that in order overrule the named route helper with my custom route I need to call `append` instead of `prepend`, like so: ``` An::Engine.routes.append do root :to => "somewhere#action" end ``` Otherwise the app contains both routes and the named helper ...
To Replace the default routes path provided by gem or engine we can achive that in following way. For me I wanted to replace 'spree\_user' with 'account' etc from all routes /user/**spree\_user**/sign\_in I did this in following way Step 1 Create config/some\_engine\_route\_override.rb Copy the content of engine ro...
5,997,527
I am working on a Ruby on Rails 3(.0) application that uses a Rails engine. However, in my local application, I want to override one of the routes provided by the Rails engine. From the engine config/routes.rb: ``` match 'their_named_route' => 'controller#action', :as => 'the_route' ``` From my application config/...
2011/05/13
[ "https://Stackoverflow.com/questions/5997527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87380/" ]
You can prepend routes as suggest by Ryan Bigg above. I found that in order overrule the named route helper with my custom route I need to call `append` instead of `prepend`, like so: ``` An::Engine.routes.append do root :to => "somewhere#action" end ``` Otherwise the app contains both routes and the named helper ...
Routing rules defined in routes.rb are applied from the top down until a match is found. I was able to override the route defined in the mounted engine simply by moving the higher-priority rule *above* the line where the engine is mounted. So, ```html get 'about', controller: 'static', action: 'about', as: 'about' mo...
2,950,490
How do I get a list of all the functions for a particular user? EDIT for question clarification: When (as USER1) I run ``` select * from all_objects where owner = 'USER2' and object_type = 'FUNCTION'; ``` it doesn't return all the functions that I know USER2 owns. I suspect that it is only returning those function...
2010/06/01
[ "https://Stackoverflow.com/questions/2950490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168646/" ]
Yes, your suspicion is correct. The ALL\_OBJECTS view will only list those items that the current user has access to. If you can log in as USER2, then you can query USER\_OBJECTS as that user to see all objects owned by that user. If you can log in as SYSTEM, then you would have access to all objects regardless of ow...
If you mean a list of functions the belong to a particular user then: ``` select object_name from all_objects where owner = 'WHOEVER' and object_type = 'FUNCTION'; ``` This will return only stand-alone functions, not procedures or function in packages, that belong to the schema 'WHOEVER'. To obtain a list of ...
2,950,490
How do I get a list of all the functions for a particular user? EDIT for question clarification: When (as USER1) I run ``` select * from all_objects where owner = 'USER2' and object_type = 'FUNCTION'; ``` it doesn't return all the functions that I know USER2 owns. I suspect that it is only returning those function...
2010/06/01
[ "https://Stackoverflow.com/questions/2950490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168646/" ]
If you mean a list of functions the belong to a particular user then: ``` select object_name from all_objects where owner = 'WHOEVER' and object_type = 'FUNCTION'; ``` This will return only stand-alone functions, not procedures or function in packages, that belong to the schema 'WHOEVER'. To obtain a list of ...
select \* from dba\_objects where owner = 'USER2' and object\_type = 'FUNCTION';
2,950,490
How do I get a list of all the functions for a particular user? EDIT for question clarification: When (as USER1) I run ``` select * from all_objects where owner = 'USER2' and object_type = 'FUNCTION'; ``` it doesn't return all the functions that I know USER2 owns. I suspect that it is only returning those function...
2010/06/01
[ "https://Stackoverflow.com/questions/2950490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168646/" ]
Yes, your suspicion is correct. The ALL\_OBJECTS view will only list those items that the current user has access to. If you can log in as USER2, then you can query USER\_OBJECTS as that user to see all objects owned by that user. If you can log in as SYSTEM, then you would have access to all objects regardless of ow...
select \* from dba\_objects where owner = 'USER2' and object\_type = 'FUNCTION';
19,649,590
Similar to the [Builder pattern](http://www.youtube.com/watch?v=WrCbqlN4uXg) where a series of functions or code that must be called in a specific order can be called from one public function. Is there a pattern for when the client must call a specific initializer function first, followed by zero or more client code c...
2013/10/29
[ "https://Stackoverflow.com/questions/19649590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421178/" ]
Depending on language used, you can try with [NVI](http://en.wikibooks.org/wiki/More_C++_Idioms/Non-Virtual_Interface) idiom or [Proxy](http://en.wikipedia.org/wiki/Proxy_pattern) pattern. There are also some other idioms/patterns tackling with this problem indirectly.
My preference in this situation is to have the client call a single function (which we might call `executeFn()`), with the parameters `f`, which is a function that the client provides, and `fp` which is a way for the the client to provide arguments to `f()` via `executeFn()`. `f()` may also be required to accept argume...
19,649,590
Similar to the [Builder pattern](http://www.youtube.com/watch?v=WrCbqlN4uXg) where a series of functions or code that must be called in a specific order can be called from one public function. Is there a pattern for when the client must call a specific initializer function first, followed by zero or more client code c...
2013/10/29
[ "https://Stackoverflow.com/questions/19649590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421178/" ]
Depending on language used, you can try with [NVI](http://en.wikibooks.org/wiki/More_C++_Idioms/Non-Virtual_Interface) idiom or [Proxy](http://en.wikipedia.org/wiki/Proxy_pattern) pattern. There are also some other idioms/patterns tackling with this problem indirectly.
Addition to Simon's answer, you can do delegation instead of hard-coding the operation inside, and depended on language, you can using delegation to be passed. For example in C# for calling a webservice, which language is able to pass delegation: ``` public class Invoker{ public ResultClass Invoke(Func<InvokeResu...
19,649,590
Similar to the [Builder pattern](http://www.youtube.com/watch?v=WrCbqlN4uXg) where a series of functions or code that must be called in a specific order can be called from one public function. Is there a pattern for when the client must call a specific initializer function first, followed by zero or more client code c...
2013/10/29
[ "https://Stackoverflow.com/questions/19649590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/421178/" ]
Depending on language used, you can try with [NVI](http://en.wikibooks.org/wiki/More_C++_Idioms/Non-Virtual_Interface) idiom or [Proxy](http://en.wikipedia.org/wiki/Proxy_pattern) pattern. There are also some other idioms/patterns tackling with this problem indirectly.
You may need the [Adapter Pattern](http://en.wikipedia.org/wiki/Adapter_pattern) where you have the client call `methodA()` on adapter which implementation is ``` class Adaptee { methodA() { // some code } } class Adapter extends Adaptee { methodA() { mustBeCalledFirst(); //methodB(...
1,169,494
I am using macOS Sierra and using an iPad Pro as a second monitor using Air Display 3. The display will only mirror, I can not get it to act as a second screen. When I use "System Preferences -> Displays" I get an error: "Could not load Displays preference pane.". How do I get this to work?
2017/01/20
[ "https://superuser.com/questions/1169494", "https://superuser.com", "https://superuser.com/users/283046/" ]
Short Answer: > > Press Command-F1 to toggle to multiple displays. > > > This is the long answer that I got from the company that makes air display: > > Unfortunately you're running into a known bug in Sierra's Displays > preference pane. We believe this bug affects all virtual displays, not > just Air Displa...
I quit the AirDisplay host. Then I loaded the “Displays” preference pane. Then I turned off “show mirroring options in the menu bar when available.” Then I relaunched the AirDisplay host and connected to my iPad Pro. Then the display“Displays”preference pane loaded properly (and I was able to change the arrangement...
26,909,870
I have a String of JSON that looks like this: ``` String json = """ { "content":{ "response":{ "body": [ { "firstName":"Jim", "lastName":"Smith" }, { ...
2014/11/13
[ "https://Stackoverflow.com/questions/26909870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4009451/" ]
You get the list by `collect()`ing the entries: ``` List<Person> l = slurper.content.response.body.collect{ new Person(firstName: it.firstName, surname: it.lastName) } ``` e.g.: ``` import groovy.json.JsonSlurper import groovy.transform.ToString String json = """ { "content":{ "respo...
well, no need to explicitly construct Person object: (groovy-shell) ``` @ToString class Person { String firstName String lastName } slurped = new JsonSlurper().parseText(json) l = slurped.content.response.body.collect {it as Person} ``` Just need to be sure that `Person` type represents json completely (e....
64,665,153
I'm reading from a JS object (from JSX) and trying to pass value of a component but it's rendered as string. I tried placing components (in `icon` key of `data` see below) in `{}` but that doesn't help as `data` gives an error. Here's the simplified version of the files. `data.js` as below: ``` const data = [ { ...
2020/11/03
[ "https://Stackoverflow.com/questions/64665153", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14234705/" ]
In the object you are defining as: ```js { icon: "<TwitterIcon />", title: "title 1", desc: "desc 1", } ``` Don't use `"<TwitterIcon />"` It will always return a string, instead use `TwitterIcon`: ``` { icon: TwitterIcon, title: "title 1", desc: "desc 1", } ``` And finally, call it where you need it, ...
I think you should pass directly the icon component in **the object**, like this: ``` const data = [ { title: "some title", desc: "some desc", }, [ { icon: <TwitterIcon />, title: "title 1", desc: "desc 1", } ... ``` Then in **index.js** you can do (it is more clear to pass down props ...
4,105,833
Suppose we have a topos $Shv(\mathcal{C})$, category of sheaves on a small site $\mathcal{C}$ and $S$ is an object of $Shv(\mathcal{C})$. Then whether the over category $Shv(\mathcal{C})/S$ is equivalent with a category of sheaves on some site? I was reading an article where the answer was given to be yes and it was wr...
2021/04/17
[ "https://math.stackexchange.com/questions/4105833", "https://math.stackexchange.com", "https://math.stackexchange.com/users/292133/" ]
In the case where $\mathcal{C}$ is a one-point category so that $Shv(\mathcal{C})$ is equivalent to $Set$, consider an object of $Set / S$, i.e. a set $X$ and a function $f : X \to S$. Then we can consider this as being equivalent to specifying the fibers $f^{-1}(\{ s \})$ for each $s \in S$. More generally, if $\mathc...
This is indeed true; a reference is for instance Moerdijk/Mac Lane *Sheaves in geometry and logic*, where it is stated on page 157 as Exercise III.8.
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
They serve two different functions. `<p>` (paragraph) is a block element which is used to hold text. `<br />` is used to force a line break within the `<p>` element. **Example** ``` <p>Suspendisse sodales odio in felis sagittis hendrerit. Donec tempus laoreet est bibendum sollicitudin. Etiam tristique convallis<br /...
You should use `<p>` when you want to separate two paragraphs. From Wikipedia: > > A paragraph (from the Greek paragraphos, "to write beside" or "written > beside") is a self-contained unit of a discourse in writing dealing > with a particular point or idea. > > > Use the `<br>` tag when you want to force a new...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
I may be breaking rules of etiquette when answering a question in this thread —as most of the answers thus far have been great —but here's how I approach this argument: While I agree that a 'p' is element which is used to hold text and a 'br' tag is used to break text, in many occasions one may want to manipulate a 'b...
The `p` tag is a block level element, and is mainly used to add content, whereas the `br` tag is used to force a line-break within the element. That is, if you're going to follow semantics. A lot of people are doing that these days to add specific meaning to tags and whatnot. I hope that helps. Good luck, though. =)
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
You want to use the `<p>` tag when you need to break up two streams of information into separate thoughts. ``` <p> Now is the time for all good men to come to the aid of their country. </p> <p>The quick brown fox jumped over the lazy sleeping dog.</p> ``` The `<br/>` tag is used as a forced line break within the t...
I wouldn't use `<p>` unless you intend to put content within it. Of course, this is merely an opinion (as I assume most answers will be). However, it may be easier to style a `<p>` tag (there are more options at least) which may lend itself to be used more often. My only problem is that this is not very easy to read (...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
I may be breaking rules of etiquette when answering a question in this thread —as most of the answers thus far have been great —but here's how I approach this argument: While I agree that a 'p' is element which is used to hold text and a 'br' tag is used to break text, in many occasions one may want to manipulate a 'b...
I wouldn't use `<p>` unless you intend to put content within it. Of course, this is merely an opinion (as I assume most answers will be). However, it may be easier to style a `<p>` tag (there are more options at least) which may lend itself to be used more often. My only problem is that this is not very easy to read (...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
They serve two different functions. `<p>` (paragraph) is a block element which is used to hold text. `<br />` is used to force a line break within the `<p>` element. **Example** ``` <p>Suspendisse sodales odio in felis sagittis hendrerit. Donec tempus laoreet est bibendum sollicitudin. Etiam tristique convallis<br /...
I wouldn't use `<p>` unless you intend to put content within it. Of course, this is merely an opinion (as I assume most answers will be). However, it may be easier to style a `<p>` tag (there are more options at least) which may lend itself to be used more often. My only problem is that this is not very easy to read (...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
You should use `<p>` when you want to separate two paragraphs. From Wikipedia: > > A paragraph (from the Greek paragraphos, "to write beside" or "written > beside") is a self-contained unit of a discourse in writing dealing > with a particular point or idea. > > > Use the `<br>` tag when you want to force a new...
I wouldn't use `<p>` unless you intend to put content within it. Of course, this is merely an opinion (as I assume most answers will be). However, it may be easier to style a `<p>` tag (there are more options at least) which may lend itself to be used more often. My only problem is that this is not very easy to read (...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
You want to use the `<p>` tag when you need to break up two streams of information into separate thoughts. ``` <p> Now is the time for all good men to come to the aid of their country. </p> <p>The quick brown fox jumped over the lazy sleeping dog.</p> ``` The `<br/>` tag is used as a forced line break within the t...
The `p` tag is a block level element, and is mainly used to add content, whereas the `br` tag is used to force a line-break within the element. That is, if you're going to follow semantics. A lot of people are doing that these days to add specific meaning to tags and whatnot. I hope that helps. Good luck, though. =)
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
You want to use the `<p>` tag when you need to break up two streams of information into separate thoughts. ``` <p> Now is the time for all good men to come to the aid of their country. </p> <p>The quick brown fox jumped over the lazy sleeping dog.</p> ``` The `<br/>` tag is used as a forced line break within the t...
I may be breaking rules of etiquette when answering a question in this thread —as most of the answers thus far have been great —but here's how I approach this argument: While I agree that a 'p' is element which is used to hold text and a 'br' tag is used to break text, in many occasions one may want to manipulate a 'b...
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
They serve two different functions. `<p>` (paragraph) is a block element which is used to hold text. `<br />` is used to force a line break within the `<p>` element. **Example** ``` <p>Suspendisse sodales odio in felis sagittis hendrerit. Donec tempus laoreet est bibendum sollicitudin. Etiam tristique convallis<br /...
The `p` tag is a block level element, and is mainly used to add content, whereas the `br` tag is used to force a line-break within the element. That is, if you're going to follow semantics. A lot of people are doing that these days to add specific meaning to tags and whatnot. I hope that helps. Good luck, though. =)
13,688,158
What's the verdict on when you should use another `<p>...</p>` instead of a `<br />` tag? What's are the best practices for this kind of thing? I looked around for this question, but most of the writing seems a bit old, so I'm not sure whether opinions about this topic have evolved since. EDIT: to clarify the questio...
2012/12/03
[ "https://Stackoverflow.com/questions/13688158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1311267/" ]
You should use `<p>` when you want to separate two paragraphs. From Wikipedia: > > A paragraph (from the Greek paragraphos, "to write beside" or "written > beside") is a self-contained unit of a discourse in writing dealing > with a particular point or idea. > > > Use the `<br>` tag when you want to force a new...
The `p` tag is a block level element, and is mainly used to add content, whereas the `br` tag is used to force a line-break within the element. That is, if you're going to follow semantics. A lot of people are doing that these days to add specific meaning to tags and whatnot. I hope that helps. Good luck, though. =)
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
You don't need a loop, this should do it. ``` function changeWidth(){ var widthSize=document.getElementById("num").value; if(widthSize < 0 || widthSize > 800){ alert("Not a valid width size"); } else { document.getElementById("box-1").style.width=widthSize+"px"; } } ```
s will never be less than 0 as thats the min value for your for loop and if the number u input is less than 800 then the IF condition will never execute. Are you entering a number more than 800 and still the alert is not showing up?
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
You don't need a loop, this should do it. ``` function changeWidth(){ var widthSize=document.getElementById("num").value; if(widthSize < 0 || widthSize > 800){ alert("Not a valid width size"); } else { document.getElementById("box-1").style.width=widthSize+"px"; } } ```
If your trying to change the width several times, So you just need to remove the quotes for your variable s. Like this: ``` document.getElementById("box-1").style.width=s; ``` But in case your trying to just set the value of widthSize, and just once, it maybe be like this: ``` document.getElementById("box-1").styl...
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
You don't need a loop, this should do it. ``` function changeWidth(){ var widthSize=document.getElementById("num").value; if(widthSize < 0 || widthSize > 800){ alert("Not a valid width size"); } else { document.getElementById("box-1").style.width=widthSize+"px"; } } ```
This should work... ```js function changeWidth() { var widthSize = parseInt(document.getElementById("num").value); if (widthSize < 0 || widthSize > 800) { alert("Not a valid width size"); } else { document.getElementById("box-1").style.width = widthSize + 'px'; } } ``` ```css .box { border: ...
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
You don't need a loop, this should do it. ``` function changeWidth(){ var widthSize=document.getElementById("num").value; if(widthSize < 0 || widthSize > 800){ alert("Not a valid width size"); } else { document.getElementById("box-1").style.width=widthSize+"px"; } } ```
```js function changeWidth(){ var widthSize=document.getElementById("num").value; for(var s=0;s<widthSize;s++){ if(widthSize<0 || widthSize>800){ alert("Not a valid width size"); break; } else{ ...
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
If your trying to change the width several times, So you just need to remove the quotes for your variable s. Like this: ``` document.getElementById("box-1").style.width=s; ``` But in case your trying to just set the value of widthSize, and just once, it maybe be like this: ``` document.getElementById("box-1").styl...
s will never be less than 0 as thats the min value for your for loop and if the number u input is less than 800 then the IF condition will never execute. Are you entering a number more than 800 and still the alert is not showing up?
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
This should work... ```js function changeWidth() { var widthSize = parseInt(document.getElementById("num").value); if (widthSize < 0 || widthSize > 800) { alert("Not a valid width size"); } else { document.getElementById("box-1").style.width = widthSize + 'px'; } } ``` ```css .box { border: ...
s will never be less than 0 as thats the min value for your for loop and if the number u input is less than 800 then the IF condition will never execute. Are you entering a number more than 800 and still the alert is not showing up?
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
If your trying to change the width several times, So you just need to remove the quotes for your variable s. Like this: ``` document.getElementById("box-1").style.width=s; ``` But in case your trying to just set the value of widthSize, and just once, it maybe be like this: ``` document.getElementById("box-1").styl...
This should work... ```js function changeWidth() { var widthSize = parseInt(document.getElementById("num").value); if (widthSize < 0 || widthSize > 800) { alert("Not a valid width size"); } else { document.getElementById("box-1").style.width = widthSize + 'px'; } } ``` ```css .box { border: ...
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
If your trying to change the width several times, So you just need to remove the quotes for your variable s. Like this: ``` document.getElementById("box-1").style.width=s; ``` But in case your trying to just set the value of widthSize, and just once, it maybe be like this: ``` document.getElementById("box-1").styl...
```js function changeWidth(){ var widthSize=document.getElementById("num").value; for(var s=0;s<widthSize;s++){ if(widthSize<0 || widthSize>800){ alert("Not a valid width size"); break; } else{ ...
39,523,489
I'm trying to change the width of a box using user-input with a for loop and if-else statement. Cant seem to get the first if statement to execute. Here is the javascript: ``` function changeWidth(){ var widthSize = document.getElementById("num").value; for(var s = 0; s < widthSize; s++){ if(s < 0 || s...
2016/09/16
[ "https://Stackoverflow.com/questions/39523489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6837807/" ]
This should work... ```js function changeWidth() { var widthSize = parseInt(document.getElementById("num").value); if (widthSize < 0 || widthSize > 800) { alert("Not a valid width size"); } else { document.getElementById("box-1").style.width = widthSize + 'px'; } } ``` ```css .box { border: ...
```js function changeWidth(){ var widthSize=document.getElementById("num").value; for(var s=0;s<widthSize;s++){ if(widthSize<0 || widthSize>800){ alert("Not a valid width size"); break; } else{ ...
2,277,517
$$\sum\_{i=k}^n\binom ik=\binom{n+1}{k+1}$$ $$n,k\in N^+;n\ge k$$ Or it can be expressed as: $$\sum\_{i=k}^ni(i-1)\cdots(i-k+1)=\frac{n+1}{k+1}n(n-1)\cdots(n-k+1)$$ $$n,k\in N^+;n\ge k$$
2017/05/12
[ "https://math.stackexchange.com/questions/2277517", "https://math.stackexchange.com", "https://math.stackexchange.com/users/419686/" ]
It's not really clear from your question what you are hoping to find. If you are looking for examples of Lehmer's phenomenon, you are looking for pairs of zeros on the critical line which are extremely close (relative to the height $t$). Lots of software packages have these calculations built in; *Mathematica*'s ZetaZe...
I suppose that more than one local extremum between zeros of the Riemann-Siegel Z function would imply zeros off the critical line at some of these extrema. So any such cases would show up as a discrepancy in the counts mentioned by @stopple. Searching for multiple local extrema is therefore not an efficient way to dis...
87,956
I have a main enemy in my story I want to use. As a way for him to be immortal, I was going to make him a vampire. I want him to interact with the party but they have a paladin who can detect evil pretty well. I was wondering if a vampire can conceal his evil aura?
2016/09/14
[ "https://rpg.stackexchange.com/questions/87956", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/31374/" ]
Ther most obvious way to hide one's evil aura is [Angelskin](http://www.d20pfsrd.com/equipment---final/special-materials#TOC-Angelskin) special material from PF. > > The preserved skin of an angel retains a portion of celestial grace and can be crafted into leather, hide, or studded leather armor. Angelskin radiates ...
All of the above answers are more functional, but I wanted to add another possible option: the [tiefling's](http://www.d20pfsrd.com/races/other-races/featured-races/arg-tiefling) do have a variant racial ability that allows you to choose the outcome of anything attempting to detect your alignment (number 70 on the Vari...
87,956
I have a main enemy in my story I want to use. As a way for him to be immortal, I was going to make him a vampire. I want him to interact with the party but they have a paladin who can detect evil pretty well. I was wondering if a vampire can conceal his evil aura?
2016/09/14
[ "https://rpg.stackexchange.com/questions/87956", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/31374/" ]
I'd recommend the spells Undetectable Alignment or Misdirection. Misdirection is the 'better' choice IMO, because it will hold up to most inquiry but it provides a fun possible hint if you ever need a neat little magic puzzle.
All of the above answers are more functional, but I wanted to add another possible option: the [tiefling's](http://www.d20pfsrd.com/races/other-races/featured-races/arg-tiefling) do have a variant racial ability that allows you to choose the outcome of anything attempting to detect your alignment (number 70 on the Vari...
87,956
I have a main enemy in my story I want to use. As a way for him to be immortal, I was going to make him a vampire. I want him to interact with the party but they have a paladin who can detect evil pretty well. I was wondering if a vampire can conceal his evil aura?
2016/09/14
[ "https://rpg.stackexchange.com/questions/87956", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/31374/" ]
He could have a [Ring of Mind Shielding](http://www.d20pfsrd.com/magic-items/rings/ring-of-mind-shielding). 8,000g for a ring that makes you immune to any attempt to magically discern alignment, plus it gives immunity to Detect Thoughts and Discern Lies.
All of the above answers are more functional, but I wanted to add another possible option: the [tiefling's](http://www.d20pfsrd.com/races/other-races/featured-races/arg-tiefling) do have a variant racial ability that allows you to choose the outcome of anything attempting to detect your alignment (number 70 on the Vari...
87,956
I have a main enemy in my story I want to use. As a way for him to be immortal, I was going to make him a vampire. I want him to interact with the party but they have a paladin who can detect evil pretty well. I was wondering if a vampire can conceal his evil aura?
2016/09/14
[ "https://rpg.stackexchange.com/questions/87956", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/31374/" ]
Sure, there are a few possible ways. The real question is do you want to hide the fact that you are evil or not be evil at all? 1. Undetectable Alignment ------------------------- Using a wand of [undetectable alignment](http://www.d20pfsrd.com/magic/all-spells/u/undetectable-alignment) would cost 4,500gp and give 50...
All of the above answers are more functional, but I wanted to add another possible option: the [tiefling's](http://www.d20pfsrd.com/races/other-races/featured-races/arg-tiefling) do have a variant racial ability that allows you to choose the outcome of anything attempting to detect your alignment (number 70 on the Vari...
1,036,088
I'm trying to use a Year-Week format in oracle SQL to return results only from a range of Year-Weeks. Here's what I'm trying ``` SELECT * FROM widsys.train trn WHERE trn.WID_DATE>=TO_DATE('2008-13', 'YYYY-IW') AND trn.WID_DATE<=TO_DATE('2008-15', 'YYYY-IW') ORDER BY trn.wid_date ``` but it shoots this error. ORA-...
2009/06/24
[ "https://Stackoverflow.com/questions/1036088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You could flip it around and do a string compare. ``` SELECT * FROM widsys.train trn WHERE to_char(trn.WID_DATE, 'YYYY-IW') ='2008-13' ORDER BY trn.wid_date; ``` I suppose it makes sense that to\_date() doesn't work with IW, as the start of the week is somewhat ambiguous - some locales start the week on Sunday...
How about ``` select * from widsys.train trn where to_char(trn.wid_date, 'YYYY-IW') = ? order by trn.wid_date ``` and for ranges ``` select * from widsys.train trn where to_char(trn.wid_date, 'YYYY-IW') between ? and ? order by trn.wid_date ``` The range will use string comparisons, which works fine if...
1,036,088
I'm trying to use a Year-Week format in oracle SQL to return results only from a range of Year-Weeks. Here's what I'm trying ``` SELECT * FROM widsys.train trn WHERE trn.WID_DATE>=TO_DATE('2008-13', 'YYYY-IW') AND trn.WID_DATE<=TO_DATE('2008-15', 'YYYY-IW') ORDER BY trn.wid_date ``` but it shoots this error. ORA-...
2009/06/24
[ "https://Stackoverflow.com/questions/1036088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How about ``` select * from widsys.train trn where to_char(trn.wid_date, 'YYYY-IW') = ? order by trn.wid_date ``` and for ranges ``` select * from widsys.train trn where to_char(trn.wid_date, 'YYYY-IW') between ? and ? order by trn.wid_date ``` The range will use string comparisons, which works fine if...
I prefer to create a table for weeks for each year that matches my domains local understanding, but thats just me.
1,036,088
I'm trying to use a Year-Week format in oracle SQL to return results only from a range of Year-Weeks. Here's what I'm trying ``` SELECT * FROM widsys.train trn WHERE trn.WID_DATE>=TO_DATE('2008-13', 'YYYY-IW') AND trn.WID_DATE<=TO_DATE('2008-15', 'YYYY-IW') ORDER BY trn.wid_date ``` but it shoots this error. ORA-...
2009/06/24
[ "https://Stackoverflow.com/questions/1036088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You could flip it around and do a string compare. ``` SELECT * FROM widsys.train trn WHERE to_char(trn.WID_DATE, 'YYYY-IW') ='2008-13' ORDER BY trn.wid_date; ``` I suppose it makes sense that to\_date() doesn't work with IW, as the start of the week is somewhat ambiguous - some locales start the week on Sunday...
I prefer to create a table for weeks for each year that matches my domains local understanding, but thats just me.
17,111,743
Using ProGuard on my jar files has broken my calls to `class.getResource("")`. I have seen that in the ProGuard manual you need to specify the `-keepdirectories mypackage` ([manual link](http://proguard.sourceforge.net/index.html#manual/usage.html#keepdirectories)). However, I have specified the `-keepdirectories` opti...
2013/06/14
[ "https://Stackoverflow.com/questions/17111743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1408045/" ]
ProGuard expects dots in packages names, and slashes in file names and directory names: ``` -keeppackagenames com.example.mypackage -keepdirectories com/example/mypackage ```
I found that I was able to get it working with the following modification to `-keepdirectories` ``` -keepdirectories **mypackage** ``` However, this feels sort of clunky, and while it works, I feel as if there is a better solution out there.
22,583,941
I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal). While inve...
2014/03/22
[ "https://Stackoverflow.com/questions/22583941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362135/" ]
Since Windows Vista, TCP\_NODELAY option must be set prior to calling `connect`, or (on the server) prior to calling `listen`. If you set `TCP_NODELAY` after calling `connect`, it will not *actually* disable Nagle algorithm, yet `GetSocketOption` will state that Nagle has been disabled! This all appears to be undocumen...
> > With this approach, the second data packet will be received by the > receiver at around the same time as the previous data packet. As a > result, the ACK should get sent immediately from the receiver to the > sender (emulating what TcpAckFrequency=1 does in the registry). > > > I'm not convinced that this w...
22,583,941
I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal). While inve...
2014/03/22
[ "https://Stackoverflow.com/questions/22583941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362135/" ]
Since Windows Vista, TCP\_NODELAY option must be set prior to calling `connect`, or (on the server) prior to calling `listen`. If you set `TCP_NODELAY` after calling `connect`, it will not *actually* disable Nagle algorithm, yet `GetSocketOption` will state that Nagle has been disabled! This all appears to be undocumen...
To solve the problem, it's necessary to understand the normal functioning of TCP connections. Telnet is a good example to analyze. TCP guarantees delivery by acknowledging successful data transmission. The " Ack" can be sent as a message by itself, but this introduces quite some overhead - an Ack is very small message...
22,583,941
I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal). While inve...
2014/03/22
[ "https://Stackoverflow.com/questions/22583941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362135/" ]
> > With this approach, the second data packet will be received by the > receiver at around the same time as the previous data packet. As a > result, the ACK should get sent immediately from the receiver to the > sender (emulating what TcpAckFrequency=1 does in the registry). > > > I'm not convinced that this w...
To solve the problem, it's necessary to understand the normal functioning of TCP connections. Telnet is a good example to analyze. TCP guarantees delivery by acknowledging successful data transmission. The " Ack" can be sent as a message by itself, but this introduces quite some overhead - an Ack is very small message...
22,583,941
I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal). While inve...
2014/03/22
[ "https://Stackoverflow.com/questions/22583941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362135/" ]
Use reliable UDP libraries and write your own congestion control algorithm, this will definitely overcome your TCP latency problem. this the following library, which i use for reliable UDP transfers: <http://udt.sourceforge.net/>
> > every packet I send needs to arrive (and be in order); > > > This requirement is the cause of your latency. Either you have a network with negligible packet loss, in which UDP would be delivering every packet, or you have loss, in which TCP is doing retransmit, delaying everything by (multiples of) the retra...
22,583,941
I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal). While inve...
2014/03/22
[ "https://Stackoverflow.com/questions/22583941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1362135/" ]
> > With this approach, the second data packet will be received by the > receiver at around the same time as the previous data packet. As a > result, the ACK should get sent immediately from the receiver to the > sender (emulating what TcpAckFrequency=1 does in the registry). > > > I'm not convinced that this w...
I would suggest you leave the Nagle alogithm and buffers turned on, as its basic purpose is to collect small writes into full/larger packets (this improves performance a lot), but at the same time use [FlushFileBuffers](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439%28v=vs.85%29.aspx)() on the socket ...