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
33,888,080
I've been trying to push a django web app to heroku with no avail because of the following error: ``` (venv)douglaswong@Douglas-MacBook-Pro ~/testing (testing)$ git push heroku master Counting objects: 53, done. Delta compression using up to 4 threads. Compressing objects: 100% (35/35), done. Writing objects: 100% (53...
2015/11/24
[ "https://Stackoverflow.com/questions/33888080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5511353/" ]
I had a similar issue. For me the problem was that I forgot to commit the changes to my local repo. Also, make sure you commit to the same branch you're pushing to. Hope this helps!
I found out that this issue might occur for two reasons: * There isn't the `requirements.txt` file in the current directory. * You are pushing on a different branch. On the other hand you could set the respective [buildpacks](https://devcenter.heroku.com/articles/buildpacks) at the moment of create the app. `heroku ...
33,888,080
I've been trying to push a django web app to heroku with no avail because of the following error: ``` (venv)douglaswong@Douglas-MacBook-Pro ~/testing (testing)$ git push heroku master Counting objects: 53, done. Delta compression using up to 4 threads. Compressing objects: 100% (35/35), done. Writing objects: 100% (53...
2015/11/24
[ "https://Stackoverflow.com/questions/33888080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5511353/" ]
Just to bring to the notice of anyone who has the same problem. Even I had the same problem and was committing to the exact branch I was pushing to. However, since I didn't have the requirements.txt file, the push was being rejected. So, also make sure you have the Procfile and the requirements.txt before pushing to...
I found out that this issue might occur for two reasons: * There isn't the `requirements.txt` file in the current directory. * You are pushing on a different branch. On the other hand you could set the respective [buildpacks](https://devcenter.heroku.com/articles/buildpacks) at the moment of create the app. `heroku ...
30,334
When creating electronic beats, I have a hard time deciding if I should really use a synthesizer to sequence my whole rhythm section. Sometimes I end up using samples or recording something close to what I want, so I can process it until I get there. Whatever the chosen method is, I'm never sure of it. What are the ...
2015/02/28
[ "https://music.stackexchange.com/questions/30334", "https://music.stackexchange.com", "https://music.stackexchange.com/users/19074/" ]
There is no blanket answer to your question. It depends. "It depends" isn't very useful though, so let's try to dive a little more into it. Advantages and disadvantages ---------------------------- Generally speaking: * Sample: Less complexity, less flexibility. * Synthesis: More complexity, more flexibility. But ...
> > When should I use one over another? > > > The big advantage of using samples is that it's easier to make your hits sound like **real instruments**. If you sample a snare drum, and use that sample, it will sound more like the real thing vs. a synthesized snare hit, which will more likely sound synthesized. One...
6,671,710
I'm working on an asp.net website with telerik controls. Im using multiple conditional grids (Show data based on selection in a grid.) Every time I do new selection it is kinda slow (I'm using ajax call). Is it possible to preload all data to the client and then instantly show it to user. I mean, is there any simple wa...
2011/07/12
[ "https://Stackoverflow.com/questions/6671710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194076/" ]
There is a good chance that the slowness comes from the amount of data being rendered on your page. Keep in mind that AJAX still goes through the entire life-cycle of the page; the savings come from not having to render the entire page, just the updated parts. Are your AJAX settings correctly updating the controls, or...
If your controls are getting data from the server, it does not make sense to cache the data on the client. I am not sure how much control you have over configuring them [controls]. You can store/cache data on server side instead (e.g. Cache, Session etc.). The data retrieval from there should be fast unless you send t...
6,671,710
I'm working on an asp.net website with telerik controls. Im using multiple conditional grids (Show data based on selection in a grid.) Every time I do new selection it is kinda slow (I'm using ajax call). Is it possible to preload all data to the client and then instantly show it to user. I mean, is there any simple wa...
2011/07/12
[ "https://Stackoverflow.com/questions/6671710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194076/" ]
There is a good chance that the slowness comes from the amount of data being rendered on your page. Keep in mind that AJAX still goes through the entire life-cycle of the page; the savings come from not having to render the entire page, just the updated parts. Are your AJAX settings correctly updating the controls, or...
There is no simple answer to your question. It all depends on data volume, security requirements. Moreover, your controls may not be able to pull data from the client-side.
72,812,917
Given an unsorted binary array, `a`, the only allowed operation is `all_zeros(a)`, which returns `True` iff all of the array's elements are 0. The complexity of this `all_zeros(a)` is `o(len(a)) + large overhead constant` I would like to find all the indices which contain 1s, *in the least runs as possible of all\_...
2022/06/30
[ "https://Stackoverflow.com/questions/72812917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/913098/" ]
I would check big chunks and only try smaller ones if they are not zero. Depending on the ratio of 1s and 'large overhead constant' I would chose a suitable start size. Here the idea how to check (by example) The data: (spaces only for readability) ``` 00001110 00100001 00100000 01000000 00000000 00000000 0000010...
if `all_zeros(a)` returns false for some subarray, then you can binary search within that subarray to find the position of the first 1. This process tells you nothing about any elements following that 1, so you would start again after that. The question is what size to make your initial queries. You will make the fewe...
32,665,582
I'm new to Android development and I've had a lot of difficulty figuring out how to load images efficiently. The short version of my question is as follows: **I have some png images in my res/drawable folder. How can I load these images onto an Android device without risking an OutOfMemory error?** Here are some more ...
2015/09/19
[ "https://Stackoverflow.com/questions/32665582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5254048/" ]
you shoud convert your png image (xxhdpi,mdpi etc..) using this link <https://romannurik.github.io/AndroidAssetStudio/nine-patches.html> automatically image chaged depending upon your device
The cause is here: ``` android:maxWidth="20000dp" android:maxHeight="20000dp" ``` Try delete these two lines. Your app just contains a simple image, it should not have anything to do with OutOfMemory error.
27,718,794
I would like to adjust the **height** of a `UITableViewCell` to have multiple lines based on the text that is stored within an `NSString` - the contents of the `NSString` changes a number of times and therefore I cannot predefine the cell's **height**. I have attempted the following however, as you can view from the i...
2014/12/31
[ "https://Stackoverflow.com/questions/27718794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3917539/" ]
You have to give absolute path as url will not work in file and directory handlig. so your new function will be like that ``` mkdir('./images/1/thumb', 0777, true); ```
``` <?php $structure = './images/1/thumb'; // To create the nested structure, the $recursive parameter // to mkdir() must be specified. if (mkdir($structure, 0777, true)) { echo "Folder Created"; }else{ echo "Not Created"; } ?> ```
4,380,701
I am struggling to solve the following differential equation. We are given the following: $$2xy + 1 + (x^2 + 2y)y' = 0,\;\;\;y(1) = -1.$$ So far, I tried moving the third term to the right side but I do not see how I could possibly use Separable Equation method to solve it. Perhaps, there is another method that I may b...
2022/02/13
[ "https://math.stackexchange.com/questions/4380701", "https://math.stackexchange.com", "https://math.stackexchange.com/users/880664/" ]
Note that $$2xy+x^2y'+2yy'=\frac{d}{dx}(x^2y+y^2).$$ So the equation is equivalent to: $$\frac{d}{dx}(x^2y+y^2)=-1$$ $$\implies x^2y+y^2=-x+C$$ $$\implies y=\frac{-x^2\pm \sqrt{x^4-4x+4C}}{2}$$ $$y(1)=\frac{-1\pm\sqrt{4C-3}}{2}=-1 \implies C=1$$ Since at $x=1$ the $\pm$ is $-$, and $y$ is differentiable at any poin...
Your differential equation is an [exact differential equation](https://en.wikipedia.org/wiki/Exact_differential_equation). Indeed, you can check that $I(x, y) = 2xy + 1$ and $J(x, y) = x^2 + 2y$ are both continuously differentiable everywhere and $$ \frac{\partial I}{\partial y} = 2x = \frac{\partial J}{\partial x}. $$...
42,236,210
I want to use `assert` module in `browserify`/`tsify` bundles. See <https://www.npmjs.com/package/assert> and <https://github.com/substack/browserify-handbook#builtins> and <https://nodejs.org/api/assert.html>. In short, it's node-js compatible `assert` module in browser, that is browserify builtin. So I added `@types...
2017/02/14
[ "https://Stackoverflow.com/questions/42236210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/805266/" ]
You can set keys in an object with variables by using bracket notation. ``` let theVariable = 'useful_name'; let theValue = 12345; let myObj = {}; myObj [ theVariable ] = theValue; ``` Will result in: ``` { useful_name : 12345 } ``` And stringify as you'd expect. Edit based on request for more info: Say you...
If you don't need to create it in one statement (and there is few chance you do), you'd do as follow: ``` var yourObject = { "static_key_1": "value", "static_key_2": [{ "static_key_3": { "id": "1097274153" }, "static_key_4": "value", "static_key_5": { "static_key_6": {}, "st...
44,674,817
I am getting a response from a payment device in json format. I want to access that in array. Here is my json response ``` Without OrderId:- doInBackground: {"amount":"1.00","reason":"Transaction declined by card","transactionId":"219775","transactionData":"{\"result\":\"success\",\"transactionId\":219775,\"billN...
2017/06/21
[ "https://Stackoverflow.com/questions/44674817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5907157/" ]
As @Ian noted, your data is invalid. But if you strip off `Without OrderId:- doInBackground:` it will work. ``` $data = json_decode('{"amount":"1.00","reason":"Transaction declined by card","transactionId":"219775","transactionData":"{\"result\":\"success\",\"transactionId\":219775,\"billNumber\":\"101:879209:675466....
You don't have a valid response, what do you expect? `Without OrderId:- doInBackground:` isn't valid. After you run `json_decode` on this string, if you run `json_last_error_msg`, you get "Syntax error." You must strip away the parts of this message that are not key-value pairs before passing it to `json_decode`. ...
44,674,817
I am getting a response from a payment device in json format. I want to access that in array. Here is my json response ``` Without OrderId:- doInBackground: {"amount":"1.00","reason":"Transaction declined by card","transactionId":"219775","transactionData":"{\"result\":\"success\",\"transactionId\":219775,\"billN...
2017/06/21
[ "https://Stackoverflow.com/questions/44674817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5907157/" ]
You don't have a valid response, what do you expect? `Without OrderId:- doInBackground:` isn't valid. After you run `json_decode` on this string, if you run `json_last_error_msg`, you get "Syntax error." You must strip away the parts of this message that are not key-value pairs before passing it to `json_decode`. ...
do : -> echo json\_decode('json/array name');
44,674,817
I am getting a response from a payment device in json format. I want to access that in array. Here is my json response ``` Without OrderId:- doInBackground: {"amount":"1.00","reason":"Transaction declined by card","transactionId":"219775","transactionData":"{\"result\":\"success\",\"transactionId\":219775,\"billN...
2017/06/21
[ "https://Stackoverflow.com/questions/44674817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5907157/" ]
As @Ian noted, your data is invalid. But if you strip off `Without OrderId:- doInBackground:` it will work. ``` $data = json_decode('{"amount":"1.00","reason":"Transaction declined by card","transactionId":"219775","transactionData":"{\"result\":\"success\",\"transactionId\":219775,\"billNumber\":\"101:879209:675466....
do : -> echo json\_decode('json/array name');
21,764,985
I am working on code for one of my classes and I have hit a wall. I need the user to input a number that will be used as the number of times a for loop will be repeated. The first loop where I ask for this number is a while loop. I need to make sure the value entered is a number and not a letter or special character. ...
2014/02/13
[ "https://Stackoverflow.com/questions/21764985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307173/" ]
I'd check [Check if input is integer type in C](https://stackoverflow.com/questions/4072190/check-if-input-is-integer-type-in-c) for the answer to this...
Check the return value of `scanf`. Per the man page: > > *RETURN VALUE* > > > These functions return the number of input items successfully matched and assigned, which can be fewer than provided > for, or even zero in the event of an early matching failure. > > > The value `EOF` is returned if the end of input i...
21,764,985
I am working on code for one of my classes and I have hit a wall. I need the user to input a number that will be used as the number of times a for loop will be repeated. The first loop where I ask for this number is a while loop. I need to make sure the value entered is a number and not a letter or special character. ...
2014/02/13
[ "https://Stackoverflow.com/questions/21764985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307173/" ]
Check the return value of `scanf`. Per the man page: > > *RETURN VALUE* > > > These functions return the number of input items successfully matched and assigned, which can be fewer than provided > for, or even zero in the event of an early matching failure. > > > The value `EOF` is returned if the end of input i...
``` do{ char ch = 0; num_of_scores = 0; printf("\nEnter the number of quiz scores between 1 and 13: "); if(scanf("%d%c", &num_of_scores, &ch)!=2 || ch != '\n'){ int ch; while((ch=getchar())!='\n' && ch !=EOF); } } while(num_of_scores<1 || num_of_scores>13); ```
21,764,985
I am working on code for one of my classes and I have hit a wall. I need the user to input a number that will be used as the number of times a for loop will be repeated. The first loop where I ask for this number is a while loop. I need to make sure the value entered is a number and not a letter or special character. ...
2014/02/13
[ "https://Stackoverflow.com/questions/21764985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307173/" ]
I'd check [Check if input is integer type in C](https://stackoverflow.com/questions/4072190/check-if-input-is-integer-type-in-c) for the answer to this...
``` do{ char ch = 0; num_of_scores = 0; printf("\nEnter the number of quiz scores between 1 and 13: "); if(scanf("%d%c", &num_of_scores, &ch)!=2 || ch != '\n'){ int ch; while((ch=getchar())!='\n' && ch !=EOF); } } while(num_of_scores<1 || num_of_scores>13); ```
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
Going back to this... just to update the question. ``` store.collection('sessions',function(err, collection){ collection.remove({},function(err, removed){ }); }); ```
I'm not sure whether you were able to figure this out, but your code did not work for me...perhaps because of changes in the API? Anyway I was able to remove an entire collection's contents using the following code: ``` db.CollectionName.remove().exec(function(error) { if(error) { console.log('Uh oh: ' + e...
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
Going back to this... just to update the question. ``` store.collection('sessions',function(err, collection){ collection.remove({},function(err, removed){ }); }); ```
I know this is a little late to the party and much has changed, but to [remove a collection in node](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#drop), you do this: ``` db.collection('someCollection').drop(); ``` From the mongo terminal you do this: ``` db.someCollection.drop(); ``` It's ...
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
Going back to this... just to update the question. ``` store.collection('sessions',function(err, collection){ collection.remove({},function(err, removed){ }); }); ```
Providing a more recent answer, based on API changes and trying the previous answers myself. The following example represents a block of code as we use it in our integration tests: ```js const mongoUrl = 'mongodb://localhost:27017/test-database'; const mongoClient = await MongoClient.connect(mongoUrl, { useNewUrlPa...
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
I know this is a little late to the party and much has changed, but to [remove a collection in node](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#drop), you do this: ``` db.collection('someCollection').drop(); ``` From the mongo terminal you do this: ``` db.someCollection.drop(); ``` It's ...
I'm not sure whether you were able to figure this out, but your code did not work for me...perhaps because of changes in the API? Anyway I was able to remove an entire collection's contents using the following code: ``` db.CollectionName.remove().exec(function(error) { if(error) { console.log('Uh oh: ' + e...
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
Providing a more recent answer, based on API changes and trying the previous answers myself. The following example represents a block of code as we use it in our integration tests: ```js const mongoUrl = 'mongodb://localhost:27017/test-database'; const mongoClient = await MongoClient.connect(mongoUrl, { useNewUrlPa...
I'm not sure whether you were able to figure this out, but your code did not work for me...perhaps because of changes in the API? Anyway I was able to remove an entire collection's contents using the following code: ``` db.CollectionName.remove().exec(function(error) { if(error) { console.log('Uh oh: ' + e...
8,041,348
I'm trying to remove all items in a collection. ``` db.collection('sessions', function(err, collection) { collection.remove(); }); ``` This is the error I get: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ...
2011/11/07
[ "https://Stackoverflow.com/questions/8041348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/439750/" ]
I know this is a little late to the party and much has changed, but to [remove a collection in node](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#drop), you do this: ``` db.collection('someCollection').drop(); ``` From the mongo terminal you do this: ``` db.someCollection.drop(); ``` It's ...
Providing a more recent answer, based on API changes and trying the previous answers myself. The following example represents a block of code as we use it in our integration tests: ```js const mongoUrl = 'mongodb://localhost:27017/test-database'; const mongoClient = await MongoClient.connect(mongoUrl, { useNewUrlPa...
71,517,541
I have a json file, it was generated using rest api call as below: ``` import json resp = requests.get('https://....offset=0&limit=500&where=....', headers=headers) json_data = json.loads(resp.text) with open('strings.json') as f: d = json.load(f) print(d) ``` After reading it in variable `d`, I get followi...
2022/03/17
[ "https://Stackoverflow.com/questions/71517541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12860141/" ]
```json [{}, {}, {},{}] ``` is valid JSON. ```json {}{}{}{} ``` is not. It is a different, JSON-based serialization format ("JSON lines" using lines as delimiters apparently). You should be able to simply generate this using a list comprehension and some JSON serialization for the objects: ```py "".join([json.dum...
A jsonlines python library exists, so you could go ahead and try to use that. ``` import json import jsonlines with open('strings.json', 'r') as f: d = json.load(f) with jsonlines.open('strings.jsonl', 'w') as f: f.write_all(d) ``` See <https://jsonlines.readthedocs.io/en/latest/#user-guide>
71,517,541
I have a json file, it was generated using rest api call as below: ``` import json resp = requests.get('https://....offset=0&limit=500&where=....', headers=headers) json_data = json.loads(resp.text) with open('strings.json') as f: d = json.load(f) print(d) ``` After reading it in variable `d`, I get followi...
2022/03/17
[ "https://Stackoverflow.com/questions/71517541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12860141/" ]
```json [{}, {}, {},{}] ``` is valid JSON. ```json {}{}{}{} ``` is not. It is a different, JSON-based serialization format ("JSON lines" using lines as delimiters apparently). You should be able to simply generate this using a list comprehension and some JSON serialization for the objects: ```py "".join([json.dum...
The simplest way of doing it: ```py import json with open('strings.json', 'r') as f: d = json.load(f) output_path = "your/output/path/result.jsonl" with open(output_path, 'w') as f: for line in d: f.write(json.dumps(line) + '\n') ```
71,517,541
I have a json file, it was generated using rest api call as below: ``` import json resp = requests.get('https://....offset=0&limit=500&where=....', headers=headers) json_data = json.loads(resp.text) with open('strings.json') as f: d = json.load(f) print(d) ``` After reading it in variable `d`, I get followi...
2022/03/17
[ "https://Stackoverflow.com/questions/71517541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12860141/" ]
A jsonlines python library exists, so you could go ahead and try to use that. ``` import json import jsonlines with open('strings.json', 'r') as f: d = json.load(f) with jsonlines.open('strings.jsonl', 'w') as f: f.write_all(d) ``` See <https://jsonlines.readthedocs.io/en/latest/#user-guide>
The simplest way of doing it: ```py import json with open('strings.json', 'r') as f: d = json.load(f) output_path = "your/output/path/result.jsonl" with open(output_path, 'w') as f: for line in d: f.write(json.dumps(line) + '\n') ```
44,121,005
I am trying to install `PyAudio` inside my `webfaction` server. [![enter image description here](https://i.stack.imgur.com/23oQq.jpg)](https://i.stack.imgur.com/23oQq.jpg) It gives me the following error. I got the same error while installing it locally but I read the solution and the `sudo` command solves it. The ...
2017/05/22
[ "https://Stackoverflow.com/questions/44121005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4678264/" ]
Your pagination is outside the `infinite-scroll`. Try ``` <div class="infinite-scroll"> @foreach($articles as $article) <article class="post"> <header> <div class="title"> <h2>{{ $article->title }}</h2> </div> </header> </article> @endforeach {{ $article...
Try like this: ``` <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jscroll/2.3.7/jquery.jscroll.min.js"></script> <script type="text/javascript"> $('ul.pagination').hide(); $(function() { $('document').ready(f...
50,336,550
In my code I make a connection with the Google calendar API. First I authenticate and then I request a list with all the data I need. Now I have a problem, because I need to request in three different ways. See below: ``` PrivateExtendedProperty = new string[] { "UserId=" + userId }, PrivateExtendedProperty = new str...
2018/05/14
[ "https://Stackoverflow.com/questions/50336550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4425441/" ]
Just make `classroomId` nullable, and add some logic so the request is sent with only the parameters the caller provided. ``` public List<Meeting> GetMeetings(DateTime minTime, DateTime maxTime, string userId = null, int? classroomId = null) { CalendarService service = Authentica...
You should use optional parameters in the function declaration and dynamically generate a string array to be sent in "PrivateExtendedProperty". Take a look at [C# Optional Parameters](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments) docs for reference.
50,336,550
In my code I make a connection with the Google calendar API. First I authenticate and then I request a list with all the data I need. Now I have a problem, because I need to request in three different ways. See below: ``` PrivateExtendedProperty = new string[] { "UserId=" + userId }, PrivateExtendedProperty = new str...
2018/05/14
[ "https://Stackoverflow.com/questions/50336550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4425441/" ]
With that many parameters, this is becoming a code smell. Refactor the parameters into their own class (SRP - Single Responsibility Principle) ``` public class MeetingOptions { public DateTime minTime { get; set; } public DateTime maxTime { get; set; } public string userId { get; set; } public int?...
Just make `classroomId` nullable, and add some logic so the request is sent with only the parameters the caller provided. ``` public List<Meeting> GetMeetings(DateTime minTime, DateTime maxTime, string userId = null, int? classroomId = null) { CalendarService service = Authentica...
50,336,550
In my code I make a connection with the Google calendar API. First I authenticate and then I request a list with all the data I need. Now I have a problem, because I need to request in three different ways. See below: ``` PrivateExtendedProperty = new string[] { "UserId=" + userId }, PrivateExtendedProperty = new str...
2018/05/14
[ "https://Stackoverflow.com/questions/50336550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4425441/" ]
Just make `classroomId` nullable, and add some logic so the request is sent with only the parameters the caller provided. ``` public List<Meeting> GetMeetings(DateTime minTime, DateTime maxTime, string userId = null, int? classroomId = null) { CalendarService service = Authentica...
The documentation says <https://developers.google.com/resources/api-libraries/documentation/calendar/v3/csharp/latest/classGoogle_1_1Apis_1_1Calendar_1_1v3_1_1EventsResource_1_1ListRequest.html#a2d1fe67042944d5f7bd0cf2d3bcaac88> > > "This parameter might be repeated multiple times to return events that > match all...
50,336,550
In my code I make a connection with the Google calendar API. First I authenticate and then I request a list with all the data I need. Now I have a problem, because I need to request in three different ways. See below: ``` PrivateExtendedProperty = new string[] { "UserId=" + userId }, PrivateExtendedProperty = new str...
2018/05/14
[ "https://Stackoverflow.com/questions/50336550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4425441/" ]
With that many parameters, this is becoming a code smell. Refactor the parameters into their own class (SRP - Single Responsibility Principle) ``` public class MeetingOptions { public DateTime minTime { get; set; } public DateTime maxTime { get; set; } public string userId { get; set; } public int?...
You should use optional parameters in the function declaration and dynamically generate a string array to be sent in "PrivateExtendedProperty". Take a look at [C# Optional Parameters](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments) docs for reference.
50,336,550
In my code I make a connection with the Google calendar API. First I authenticate and then I request a list with all the data I need. Now I have a problem, because I need to request in three different ways. See below: ``` PrivateExtendedProperty = new string[] { "UserId=" + userId }, PrivateExtendedProperty = new str...
2018/05/14
[ "https://Stackoverflow.com/questions/50336550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4425441/" ]
With that many parameters, this is becoming a code smell. Refactor the parameters into their own class (SRP - Single Responsibility Principle) ``` public class MeetingOptions { public DateTime minTime { get; set; } public DateTime maxTime { get; set; } public string userId { get; set; } public int?...
The documentation says <https://developers.google.com/resources/api-libraries/documentation/calendar/v3/csharp/latest/classGoogle_1_1Apis_1_1Calendar_1_1v3_1_1EventsResource_1_1ListRequest.html#a2d1fe67042944d5f7bd0cf2d3bcaac88> > > "This parameter might be repeated multiple times to return events that > match all...
44,241,681
I have this code below, when I run it the output file has additional columns like Comment, RowError, RowState, Table, ItemArray, HasErrors ``` $dataSet.Tables | Select-Object -Expand Rows | ConvertTo-HTML -head $a –body $body | Out-File $OutputFile ``` I want to get rid of these columns but dont know how to. I have...
2017/05/29
[ "https://Stackoverflow.com/questions/44241681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906206/" ]
If you assign `highestSoFar` to `person`, `highestSoFar` is never changed inside the loop, and keeps referring to its initial value - `this.members.get(0)`. If you assign `person` to `highestSoFar`, as you should, your loop finds the person with the highest `divide()`.
`a = b` is not same as `b = a` in java. From [java docs](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op1.html) : > > One of the most common operators that you'll encounter is the simple > assignment operator "=". > it assigns the value on its right to the operand on its left. > > > So when you do...
44,241,681
I have this code below, when I run it the output file has additional columns like Comment, RowError, RowState, Table, ItemArray, HasErrors ``` $dataSet.Tables | Select-Object -Expand Rows | ConvertTo-HTML -head $a –body $body | Out-File $OutputFile ``` I want to get rid of these columns but dont know how to. I have...
2017/05/29
[ "https://Stackoverflow.com/questions/44241681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906206/" ]
If you assign `highestSoFar` to `person`, `highestSoFar` is never changed inside the loop, and keeps referring to its initial value - `this.members.get(0)`. If you assign `person` to `highestSoFar`, as you should, your loop finds the person with the highest `divide()`.
In the second case you make put first value in your `highestSoFar` variable and don't modify this variable after that.
44,241,681
I have this code below, when I run it the output file has additional columns like Comment, RowError, RowState, Table, ItemArray, HasErrors ``` $dataSet.Tables | Select-Object -Expand Rows | ConvertTo-HTML -head $a –body $body | Out-File $OutputFile ``` I want to get rid of these columns but dont know how to. I have...
2017/05/29
[ "https://Stackoverflow.com/questions/44241681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906206/" ]
If you assign `highestSoFar` to `person`, `highestSoFar` is never changed inside the loop, and keeps referring to its initial value - `this.members.get(0)`. If you assign `person` to `highestSoFar`, as you should, your loop finds the person with the highest `divide()`.
You have 2 parts in the affectation (left part and right part). In the affectation, the left part value will be lose and will receive the value of the right part. The right part will not change. **a = b** ==> replace the content of **a** by **b**. **b** will not change and **a** will. **b = a** ==> replace the cont...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
In my applications, I keep a "baseUrl" in my application config and I assign that to registry on bootstrapping. Later I use the following View Helper to generate the URL: ``` <?php class Zend_View_Helper_UrlMap { public function UrlMap($original) { $newUrl = $original; $baseUrl = Zend_Registr...
I wouldnt use $\_SERVER, I would use the values from `Zend_Controller_Request_Http::getServer($keyName);` (or the direct getters on the request object when that applies - i forget which ones are direct members of the object and which ones need to be accessed with getServer). Technically these are the exact same values,...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
phpfour's way is OK, but you have to check for https://, ftp:// and mailto: too... :) I prefefer having all urls root-absolute (`/files/js/jquery.js`). The "hardcore zend way" is ``` <?php // document root for example.com is in /htdocs // but application's index.php resides in /htdocs/myapp/public echo $this->bas...
I wouldnt use $\_SERVER, I would use the values from `Zend_Controller_Request_Http::getServer($keyName);` (or the direct getters on the request object when that applies - i forget which ones are direct members of the object and which ones need to be accessed with getServer). Technically these are the exact same values,...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
Without mvc ``` echo $this->serverUrl() . $this->baseUrl('cass/base.css'); ``` or with mvc ``` echo $this->serverUrl() . $this->url(array('controller'=>'index','action'=>'index'),null,true); ```
I wouldnt use $\_SERVER, I would use the values from `Zend_Controller_Request_Http::getServer($keyName);` (or the direct getters on the request object when that applies - i forget which ones are direct members of the object and which ones need to be accessed with getServer). Technically these are the exact same values,...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
phpfour's way is OK, but you have to check for https://, ftp:// and mailto: too... :) I prefefer having all urls root-absolute (`/files/js/jquery.js`). The "hardcore zend way" is ``` <?php // document root for example.com is in /htdocs // but application's index.php resides in /htdocs/myapp/public echo $this->bas...
In my applications, I keep a "baseUrl" in my application config and I assign that to registry on bootstrapping. Later I use the following View Helper to generate the URL: ``` <?php class Zend_View_Helper_UrlMap { public function UrlMap($original) { $newUrl = $original; $baseUrl = Zend_Registr...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
Without mvc ``` echo $this->serverUrl() . $this->baseUrl('cass/base.css'); ``` or with mvc ``` echo $this->serverUrl() . $this->url(array('controller'=>'index','action'=>'index'),null,true); ```
In my applications, I keep a "baseUrl" in my application config and I assign that to registry on bootstrapping. Later I use the following View Helper to generate the URL: ``` <?php class Zend_View_Helper_UrlMap { public function UrlMap($original) { $newUrl = $original; $baseUrl = Zend_Registr...
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
In my applications, I keep a "baseUrl" in my application config and I assign that to registry on bootstrapping. Later I use the following View Helper to generate the URL: ``` <?php class Zend_View_Helper_UrlMap { public function UrlMap($original) { $newUrl = $original; $baseUrl = Zend_Registr...
Use the below method. `<a href="<?php echo $this->serverUrl() . $this->url('application', ['action' => 'detail']) ?>">`
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
phpfour's way is OK, but you have to check for https://, ftp:// and mailto: too... :) I prefefer having all urls root-absolute (`/files/js/jquery.js`). The "hardcore zend way" is ``` <?php // document root for example.com is in /htdocs // but application's index.php resides in /htdocs/myapp/public echo $this->bas...
Without mvc ``` echo $this->serverUrl() . $this->baseUrl('cass/base.css'); ``` or with mvc ``` echo $this->serverUrl() . $this->url(array('controller'=>'index','action'=>'index'),null,true); ```
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
phpfour's way is OK, but you have to check for https://, ftp:// and mailto: too... :) I prefefer having all urls root-absolute (`/files/js/jquery.js`). The "hardcore zend way" is ``` <?php // document root for example.com is in /htdocs // but application's index.php resides in /htdocs/myapp/public echo $this->bas...
Use the below method. `<a href="<?php echo $this->serverUrl() . $this->url('application', ['action' => 'detail']) ?>">`
1,881,254
Is there a best practice for creating absolute URLs using the Zend framework? I wonder if there is some helper or if this would just be concatenating the scheme, host, etc. from the $\_SERVER variable and then add the relative path generated by Zend.
2009/12/10
[ "https://Stackoverflow.com/questions/1881254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53346/" ]
Without mvc ``` echo $this->serverUrl() . $this->baseUrl('cass/base.css'); ``` or with mvc ``` echo $this->serverUrl() . $this->url(array('controller'=>'index','action'=>'index'),null,true); ```
Use the below method. `<a href="<?php echo $this->serverUrl() . $this->url('application', ['action' => 'detail']) ?>">`
377,623
I want to make a bootable USB thumb drive to install Windows on my computer. I don't want to use my old DVD to create an image and then upgrade to SP1, so I decided to download an untouched .iso file that already has SP1 in it. My question is this, is there a difference between these two files files? > > en\_windows\...
2012/01/12
[ "https://superuser.com/questions/377623", "https://superuser.com", "https://superuser.com/users/31760/" ]
the u version is more recent according to this site [check this for details](http://www.mydigitallife.info/get-windows-7-sp1-u-media-refresh-msdntechnet-iso-download-or-convert/)
U means it is updated with this hotfix, as per reading the link provided by daya <http://support.microsoft.com/kb/2534111> ![enter image description here](https://i.stack.imgur.com/WaLQN.png)
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
``` curl_setopt($c, CURLOPT_HEADER, true); // you need this to get the headers $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); ```
Use [guzzle](http://guzzle3.readthedocs.org/) to interact with CURL in a sane manner. Then your script becomes something like: ``` <?php use Guzzle\Http\Client; // Create a client and provide a base URL $client = new Client('http://www.example.com'); $response = $client->get('/'); $code = $response->getStatusCode();...
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
Try this: ``` public function getFileUsingCurl($url) { //set all option $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $file = curl_exec($ch); $curlinfo = curl_getinfo($ch); curl_close...
``` curl_setopt($c, CURLOPT_HEADER, true); // you need this to get the headers $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); ```
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
Could you try curl'ing the url on your terminal to check its status code with: `curl -I www.site.com` (I know this a question rather than answer, but i dont have enough stackoverflow rep to comment yet haha, so i'll edit this to an answer when i have more info)
Use [guzzle](http://guzzle3.readthedocs.org/) to interact with CURL in a sane manner. Then your script becomes something like: ``` <?php use Guzzle\Http\Client; // Create a client and provide a base URL $client = new Client('http://www.example.com'); $response = $client->get('/'); $code = $response->getStatusCode();...
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
Try this: ``` public function getFileUsingCurl($url) { //set all option $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $file = curl_exec($ch); $curlinfo = curl_getinfo($ch); curl_close...
Could you try curl'ing the url on your terminal to check its status code with: `curl -I www.site.com` (I know this a question rather than answer, but i dont have enough stackoverflow rep to comment yet haha, so i'll edit this to an answer when i have more info)
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
you should use `curl_setopt($c, CURLOPT_HEADER, true);` to include headers in output. <http://www.php.net/manual/en/function.curl-setopt.php> Then use `var_dump($file)` to see whether it is really 200 or not... Using below code for checking status should work ``` $infoArray = curl_getinfo($ch); $httpStatus = $infoA...
Use [guzzle](http://guzzle3.readthedocs.org/) to interact with CURL in a sane manner. Then your script becomes something like: ``` <?php use Guzzle\Http\Client; // Create a client and provide a base URL $client = new Client('http://www.example.com'); $response = $client->get('/'); $code = $response->getStatusCode();...
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
Try this: ``` public function getFileUsingCurl($url) { //set all option $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $file = curl_exec($ch); $curlinfo = curl_getinfo($ch); curl_close...
you should use `curl_setopt($c, CURLOPT_HEADER, true);` to include headers in output. <http://www.php.net/manual/en/function.curl-setopt.php> Then use `var_dump($file)` to see whether it is really 200 or not... Using below code for checking status should work ``` $infoArray = curl_getinfo($ch); $httpStatus = $infoA...
23,610,671
I am Using PHP curl, my target url gives 200 or 500 depending on request parameter. But how ever it throw 500 or 200 i am getting 200 using curl\_getinfo($ch, CURLINFO\_HTTP\_CODE). Here is the code ``` /** * use for get any file form a remote uri * * @param String $url * @return String */ public function getFil...
2014/05/12
[ "https://Stackoverflow.com/questions/23610671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860926/" ]
Try this: ``` public function getFileUsingCurl($url) { //set all option $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $file = curl_exec($ch); $curlinfo = curl_getinfo($ch); curl_close...
Use [guzzle](http://guzzle3.readthedocs.org/) to interact with CURL in a sane manner. Then your script becomes something like: ``` <?php use Guzzle\Http\Client; // Create a client and provide a base URL $client = new Client('http://www.example.com'); $response = $client->get('/'); $code = $response->getStatusCode();...
5,220,256
I have a BroadcastReceiver registered to listen for the following action.. ``` public static final String MY_ACTION = "com.blah.intent.action.DOSOMETHING"; ``` And in my code I have ``` Intent intent = new Intent(MY_ACTION); sendBroadcast(intent); ``` If I use this the broadcast is sent and received fine, however...
2011/03/07
[ "https://Stackoverflow.com/questions/5220256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/358338/" ]
Android looks not only on ACTION, but also on type of the data and schema. You should tell that your receiver can receive this type by call to addDataSchema() or addDataType() on IntentFilter. If you want to just send String, why don't you use extras?
I agree with damluar. From Android developer: Add a new Intent data scheme to match against. If any schemes are included in the filter, then an Intent's data must be either one of these schemes or a matching data type. If no schemes are included, then an Intent will match only if it includes no data. Vice verse, if y...
3,916,831
I have the following question. If we want to verify that a random variable $T$ is a stopping time, according to the definition of a stopping time we have to show that $[T\le n]\in F\_{n} $ for each $n\in\mathbb{N}$. I noticed that is enough to show only $[T= n]\in F\_{n}$ for each $n\in\mathbb{N}$. Why is it enought?
2020/11/21
[ "https://math.stackexchange.com/questions/3916831", "https://math.stackexchange.com", "https://math.stackexchange.com/users/848634/" ]
It's enough because, $[T\leq n] = \cup\_{k=1}^{n}[T=k]$ where $[T=k]\in\mathcal{F}\_n\subset \mathcal{F}\_n$ for all $1\leq k\leq n.$
It is assumed that $\mathcal F\_n$'s are increasing. $[T=n]=[T=1] \cup [T=2]\cup...\cup[T=n]$ and $[T=i] \in F\_i \subseteq F\_n$ for each $i \in \{1,2...,n\}$. Hence $[T=n] \in F\_n$
6,191,178
This seems like one of those questions that, if you know the answer, it's obvious, and if you don't, it's impossible... How do I include a table of multi-line examples in a SpecFlow feature file? My example would be: ``` Given there is some invalid input: | input | | """ Multi-line example 1...
2011/05/31
[ "https://Stackoverflow.com/questions/6191178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173572/" ]
Well, it looks like this isn't possible [according to a poster in the Google SpecFlow group](http://groups.google.com/group/specflow/browse_thread/thread/fa4727ee921da0cd). He also points out that I may have too much implementation in my behavior test, and maybe this fits into unit tests more appropriately.
you can do it like this: ``` Given there is some invalid input: | <Here goes column Name> | <Column Name2..> | | Line 1 for column 1 | Line 1 for column2| | Line 2 for column 1 | Line 2 for column2| | ..and so on | and so on... | When something interesting happens Then the err...
6,191,178
This seems like one of those questions that, if you know the answer, it's obvious, and if you don't, it's impossible... How do I include a table of multi-line examples in a SpecFlow feature file? My example would be: ``` Given there is some invalid input: | input | | """ Multi-line example 1...
2011/05/31
[ "https://Stackoverflow.com/questions/6191178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1173572/" ]
Well, it looks like this isn't possible [according to a poster in the Google SpecFlow group](http://groups.google.com/group/specflow/browse_thread/thread/fa4727ee921da0cd). He also points out that I may have too much implementation in my behavior test, and maybe this fits into unit tests more appropriately.
Since I do the comparison of actual and expected values myself (not using the automatic table comparison feature of SpecFlow), I allow using regular expressions for special values, like strings containing newline: ``` Then I expect the result values | Name | Value | | Multilinestring | ...
10,186,466
I was developing the code of creating a thread but without extending the thread class or implementing the runnable interface , that is through anonymous inner classes .. ``` public class Mythread3 { public static void main(String... a) { Thread th = new Thread() { public synchronized void run...
2012/04/17
[ "https://Stackoverflow.com/questions/10186466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305172/" ]
``` Runnable run = new Runnable() { public void run() { try { for (int i = 0; i < 20; i++) { Thread.sleep(1000); System.out.print(i + "\n" + ".."); } } catch (InterruptedException e) { System.out.println(" interrupted"); }...
The fact that you declare two anonymous inner classes extending Thread and overriding the run() method is not an issue in itself. We may consider not really readable but there is no issue. However, you should consider using the `Runnable` interface. You should separate the processing/algorithms and the Threading polic...
10,186,466
I was developing the code of creating a thread but without extending the thread class or implementing the runnable interface , that is through anonymous inner classes .. ``` public class Mythread3 { public static void main(String... a) { Thread th = new Thread() { public synchronized void run...
2012/04/17
[ "https://Stackoverflow.com/questions/10186466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305172/" ]
``` Runnable run = new Runnable() { public void run() { try { for (int i = 0; i < 20; i++) { Thread.sleep(1000); System.out.print(i + "\n" + ".."); } } catch (InterruptedException e) { System.out.println(" interrupted"); }...
Anonymous inner classes are the classes without a name, means there is no explicit name for it, but JVM name it as Mythread3$1 for referencing its objects. so when you print th.getClass() and th.getClass().getSuperclass() you will get output as MyThread3$1 and Thread. you can create Anonymous inner classes by extendi...
228,507
Using the "function to cut linestings and multilinestrings at nearest point junctions" found in chapter 11 of the book *PostGIS in Action* by Regina Obe and Leo Hsu (Second Edition) It returns this error when running in PgAdmin 4: ``` ERROR: syntax error at or near "END" LINE 40: END IF; ^ ********** ...
2017/02/15
[ "https://gis.stackexchange.com/questions/228507", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/91260/" ]
The reason is simple, missing semi-colon on the end of this line:- ``` kutt(var_lset[j],var_pset[i]); ``` It has nothing to do with Postgis being installed
I guess you haven't installed PostGIS in the database. Run ``` Create extension PostGIS; ``` before creating the function
29,060,482
Here is my navigation bar ![Image link](https://i.stack.imgur.com/c4NLs.png) I had a problem about changing vertical position of Settings `UIBarButtonItem` on my navigation bar. I would like to move the button item "Settings" down Here is my code ``` UIBarButtonItem *settingsItem = [[UIBarButtonItem alloc] init...
2015/03/15
[ "https://Stackoverflow.com/questions/29060482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4673026/" ]
You can easily add a Custom Button to your NavigationBarItem, Here is the way, ``` UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; //create custom Button [button setTitle:@"Settings" forState:UIControlStateNormal]; [button.titleLabel setFont:[UIFont systemFontOfSize:14.0]]; [button set...
Cited from apple's documentation on `UIAppearance` protocol > > iOS applies appearance changes when a view enters a window, it doesn’t > change the appearance of a view that’s already in a window. > > > So if your code of setting UIBarButtonItem's appearance is after the navigationItem assignment code. It won't ...
59,847,928
I'm starting to work with Azure and tried these steps: * I added a secret to an Azure Vault. * I linked a service principal to my Azure DevOps pipelines. * I created a variable group linked to my vault. * I created a variable group with some variables. * I created a azure-pipelines.yaml with a variables: group: group1...
2020/01/21
[ "https://Stackoverflow.com/questions/59847928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/230638/" ]
You can have a try using **overrideParameters** parameter for the task to override your ARM template's parameters with the variables defined in your variable groups. Check [here](https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureResourceManagerTemplateDeploymentV3/README.md) for more parameters ...
Variable groups aren't intended to be used with YAML pipelines. Add a `AzureKeyVault` step to your pipeline in order to retrieve secrets from the keyvault. Or link your ARM template directly to the keyvault; ARM templates have native support for keyvault parameters: ``` "adminPassword": { "reference": { ...
47,575,090
While editing JavaScript source files in Visaul Studio 2017, the following error keeps occuring: ``` The JavaScript language service has been disabled for the following project(s): ... ``` Even if I disable the JavaScript language service entirely, the error keeps occuring. Why is this happening and how do I stop th...
2017/11/30
[ "https://Stackoverflow.com/questions/47575090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13445631/" ]
The solution to the problem was simply to use a tsconfig.json file, even though there were only JavaScript files in my solution. I've just used the following tsconfig.json file in the root of the project: ``` {   "compileOnSave": true,  "compilerOptions": {     "noImplicitAny": false,     "noEmitOnError": true,     ...
open 'developer command line tool for visual studio'. run : devenv.exe /resetuserdata
4,508,564
Using the WindowBuilder for Eclipse, I have created a `TableViewer` which I have placed inside a composite. (The `TableViewer` creates an SWT `Table`, in which the `TableViewer` itself is inserted). I have tried to make the composite resizable by setting `grabExcessHorizontalSpace` and `grabVerticalSpace` to true, bu...
2010/12/22
[ "https://Stackoverflow.com/questions/4508564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340811/" ]
Hard to tell without code, but from your description you don't set a layout on your `Composite`. Try adding `composite.setLayout(new FillLayout());` if your composite contains only the TableViewer. If your composite has more than one child, you'll need a different layout, like GridLayout, or MigLayout. Then you'll al...
I got the answer now, (Big thanks to rcjsuen on the #eclipse channel on irc.freenode.net). The code I had looked like this: Composite comp = new Composite(container, SWT.NONE); comp.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1)); What I needed to do was, in addition to setting grabExcessiveHorizon...
61,666,571
I am a complete beginner in Python and am trying to use it to generate a merged data file to be used in a molecular simulation. I am trying to place one group of atoms over the other along the y-axis using the ASE python code. For this I need to find the minimum of y coordinate of one atom group stored as a 3D numpy a...
2020/05/07
[ "https://Stackoverflow.com/questions/61666571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13493614/" ]
What you are doing seems correct. You can remove the brackets as well: ``` y_min = np.max(atoms_2[:,1]) y_max = np.min(atoms_1[:,1]) ``` `np.max` is an alias for `np.amax` suggested in comments.
You can get the maximum value in each of the columns using: ``` import numpy as np atoms = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 4, 6]]) print(np.amax(atoms, axis=0)) >>> [7 8 9] print(np.amin(atoms, axis=0)) >>> [1 2 3] ``` To assign it, just use: ...
61,666,571
I am a complete beginner in Python and am trying to use it to generate a merged data file to be used in a molecular simulation. I am trying to place one group of atoms over the other along the y-axis using the ASE python code. For this I need to find the minimum of y coordinate of one atom group stored as a 3D numpy a...
2020/05/07
[ "https://Stackoverflow.com/questions/61666571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13493614/" ]
What you are doing seems correct. You can remove the brackets as well: ``` y_min = np.max(atoms_2[:,1]) y_max = np.min(atoms_1[:,1]) ``` `np.max` is an alias for `np.amax` suggested in comments.
You can also pass axis into `max` and `min` ``` a = np.arange(27).reshape(3,3,-1) a.max(axis=1), a.min(axis=1) ``` Output: ``` (array([[ 6, 7, 8], [15, 16, 17], [24, 25, 26]]), array([[ 0, 1, 2], [ 9, 10, 11], [18, 19, 20]])) ```
17,282,200
I define class methods dynamically in Rails as follows: ``` class << self %w[school1 school2].each do |school| define_method("self.find_by_#{school}_id") do |id| MyClass.find_by(school: school, id: id) end end end ``` How can I use method missing to call `find_by_SOME_SCHOOL_id` without having to...
2013/06/24
[ "https://Stackoverflow.com/questions/17282200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927667/" ]
It is not completely clear to me what you want to achieve. If you want to call a method, you naturally have to define it first (as long as ActiveRecord does not handle this). You could do something like this: ``` class MyClass class << self def method_missing(m, *args, &block) match = m.to_s.match(/find_...
I recommend return the super unless you have a match ```rb class MyClass class << self def method_missing(m, *args, &block) match = m.to_s.match(/find_by_school([0-9]+)_id/) match ? match.captures.first : super end end end ```
631,666
In [a Veritasium video](https://youtu.be/pTn6Ewhb27k), it is claimed that it is impossible to experimentally measure the 'one-way speed' $^1$ of light. The host further stipulates the stronger claim that the laws of physics are unaffected by the division of speed of light between its sent and return journey as long as ...
2021/04/24
[ "https://physics.stackexchange.com/questions/631666", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/278710/" ]
> > If the speed of light is kc in a direction where > $k\in[\frac{1}{2},1]$, then what would the speed of light be in the opposite > direction? > > > This can be found out by just figuring out what the speed of light must be in the opposite direction to ensure that the average speed of light across the total jour...
It's true that the one-way speed of light cannot be measured, but it is **always** the case that the speed of light is *calculated* to be $c$. I.e. the two-way speed of light will always average to be $c$ over the total journey. Therefore if say, in a certain direction, the speed is $v\_{direction} = \frac{1}{2} c$ the...
631,666
In [a Veritasium video](https://youtu.be/pTn6Ewhb27k), it is claimed that it is impossible to experimentally measure the 'one-way speed' $^1$ of light. The host further stipulates the stronger claim that the laws of physics are unaffected by the division of speed of light between its sent and return journey as long as ...
2021/04/24
[ "https://physics.stackexchange.com/questions/631666", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/278710/" ]
> > If the speed of light is kc in a direction where > $k\in[\frac{1}{2},1]$, then what would the speed of light be in the opposite > direction? > > > This can be found out by just figuring out what the speed of light must be in the opposite direction to ensure that the average speed of light across the total jour...
Of course you can measure the one way speed of light, the only "gotcha" is that you need to use two different clocks in different places to do so. So you need to define how to synchronize them. For example, you could synchronize the clocks in the same place, then carry them slowly and carefully equal distances to the f...
33,346,064
How can I achieve the below radiobutton in html using rails helpers?? I do have a field ***guests*** in my database where the selected value of the radio button gets stored. ``` <div class="segmented-control" style="width: 100%; color: #5FBAAC"> <input type="radio" name="guests" id="1"> <input ...
2015/10/26
[ "https://Stackoverflow.com/questions/33346064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2874507/" ]
There is a helper method called `options_for_select` which transforms an array of arrays into select input options. ``` <%= f.select :guests, options_for_select([["1","1"],["2","2"],["3","3"],["4","4"], ["5","5"],["6","6"]]), id: "guests", class: "form-control" %> ``` documentation : <http://api.rubyonrails.org/clas...
I think it returns what you want: ``` <%1.upto(6) do |n|%> <%= radio_button_tag :guests, "#{n}",nil, id: "#{n}" %> <%end%> <%1.upto(6) do |n|%> <%= label_tag("#{n}", "#{n}", "data-tag"=>"#{n}") %> <%end%> ```
7,507,773
I'm trying to merge two separate PHP functions into one that I can use in my Wordpress theme. I'm using Wordpress functions to get the post meta of the key "\_videoembed" which is then trimmed from a YouTube URL down to the YouTube video ID. I'll include both the earlier functions & how I use them and then the one I'm ...
2011/09/21
[ "https://Stackoverflow.com/questions/7507773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/892447/" ]
Frazell's answer would have worked if my root model was the one that was abstract. However, that's not the case for me so what ended up working was this: <http://mvccontrib.codeplex.com/wikipage?title=DerivedTypeModelBinder&referringTitle=Documentation>
ASP.NET MVC's built in Model Binding doesn't support Abstract classes. You can roll your own to handle the Abstract class though see [ASP.NET MVC 2 - Binding To Abstract Model](https://stackoverflow.com/questions/4012217/asp-net-mvc-2-binding-to-abstract-model) .
7,507,773
I'm trying to merge two separate PHP functions into one that I can use in my Wordpress theme. I'm using Wordpress functions to get the post meta of the key "\_videoembed" which is then trimmed from a YouTube URL down to the YouTube video ID. I'll include both the earlier functions & how I use them and then the one I'm ...
2011/09/21
[ "https://Stackoverflow.com/questions/7507773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/892447/" ]
ASP.NET MVC's built in Model Binding doesn't support Abstract classes. You can roll your own to handle the Abstract class though see [ASP.NET MVC 2 - Binding To Abstract Model](https://stackoverflow.com/questions/4012217/asp-net-mvc-2-binding-to-abstract-model) .
I'm going to jump in here, even though it seems you've already solved it. But would ``` public class DemographicsModel<T> Where T : QuestionModel { public List<T> Questions { get; set; } } ``` Work? ``` [HttpPost] public ActionResult Demographics(DemographicsModel<ChooseOneQuestionModel> model) { //... }...
7,507,773
I'm trying to merge two separate PHP functions into one that I can use in my Wordpress theme. I'm using Wordpress functions to get the post meta of the key "\_videoembed" which is then trimmed from a YouTube URL down to the YouTube video ID. I'll include both the earlier functions & how I use them and then the one I'm ...
2011/09/21
[ "https://Stackoverflow.com/questions/7507773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/892447/" ]
Frazell's answer would have worked if my root model was the one that was abstract. However, that's not the case for me so what ended up working was this: <http://mvccontrib.codeplex.com/wikipage?title=DerivedTypeModelBinder&referringTitle=Documentation>
I'm going to jump in here, even though it seems you've already solved it. But would ``` public class DemographicsModel<T> Where T : QuestionModel { public List<T> Questions { get; set; } } ``` Work? ``` [HttpPost] public ActionResult Demographics(DemographicsModel<ChooseOneQuestionModel> model) { //... }...
51,807,463
I'm new in windows environment. How can I execute the following powershell command from cmd `"hello gourav how are you1" | Out-File filename -append`
2018/08/12
[ "https://Stackoverflow.com/questions/51807463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210098/" ]
Maybe a bit off-topic but this does the same trick without powershell (i.e. directly from cmd prompt): > > echo *Your text* >>filename > > >
you can use `powershell.exe` in cmd to execute powershell command. ``` powershell.exe "your command" ``` like ``` powershell.exe "\"hello gourav how are you1\" | Out-File filename -append" ``` And you can enter interact interface in powershell using `powershell` directly
51,807,463
I'm new in windows environment. How can I execute the following powershell command from cmd `"hello gourav how are you1" | Out-File filename -append`
2018/08/12
[ "https://Stackoverflow.com/questions/51807463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210098/" ]
Open cmd from Run and execute powershell /? to know all the options you have. ``` PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>] [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] [-WindowStyle <style>] [-EncodedCommand <...
you can use `powershell.exe` in cmd to execute powershell command. ``` powershell.exe "your command" ``` like ``` powershell.exe "\"hello gourav how are you1\" | Out-File filename -append" ``` And you can enter interact interface in powershell using `powershell` directly
51,807,463
I'm new in windows environment. How can I execute the following powershell command from cmd `"hello gourav how are you1" | Out-File filename -append`
2018/08/12
[ "https://Stackoverflow.com/questions/51807463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210098/" ]
simple ``` @ECHO off SET LONG_COMMAND=^ if ($true)^ {^ $Resolution=Get-DisplayResolution;^ Write-Host $Resolution;^ } START Powershell -noexit -command %LONG_COMMAND% ``` with return ``` @echo off set "psCommand="[Environment]::GetFolderPath('DesktopDirectory')"" for /f "usebackq delims=" %%I in (`powershell %ps...
you can use `powershell.exe` in cmd to execute powershell command. ``` powershell.exe "your command" ``` like ``` powershell.exe "\"hello gourav how are you1\" | Out-File filename -append" ``` And you can enter interact interface in powershell using `powershell` directly
51,807,463
I'm new in windows environment. How can I execute the following powershell command from cmd `"hello gourav how are you1" | Out-File filename -append`
2018/08/12
[ "https://Stackoverflow.com/questions/51807463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210098/" ]
Open cmd from Run and execute powershell /? to know all the options you have. ``` PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>] [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] [-WindowStyle <style>] [-EncodedCommand <...
Maybe a bit off-topic but this does the same trick without powershell (i.e. directly from cmd prompt): > > echo *Your text* >>filename > > >
51,807,463
I'm new in windows environment. How can I execute the following powershell command from cmd `"hello gourav how are you1" | Out-File filename -append`
2018/08/12
[ "https://Stackoverflow.com/questions/51807463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210098/" ]
Open cmd from Run and execute powershell /? to know all the options you have. ``` PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>] [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] [-WindowStyle <style>] [-EncodedCommand <...
simple ``` @ECHO off SET LONG_COMMAND=^ if ($true)^ {^ $Resolution=Get-DisplayResolution;^ Write-Host $Resolution;^ } START Powershell -noexit -command %LONG_COMMAND% ``` with return ``` @echo off set "psCommand="[Environment]::GetFolderPath('DesktopDirectory')"" for /f "usebackq delims=" %%I in (`powershell %ps...
200,263
I am trying to convey a subtle message that I'm not particularly keen at giving a presentation while also allowing the possibility that I can give it after all if the other party so desires. As reason for preferring not to give the presentation I would like to cite my public shyness. I thought I could say something li...
2014/10/07
[ "https://english.stackexchange.com/questions/200263", "https://english.stackexchange.com", "https://english.stackexchange.com/users/66696/" ]
* I don't like being the centre of attention but if you insist... * I tend to shun the limelight but if you can't find anyone else... * to be frank/honest I find presentations to be nerve wracking experiences, but if you need someone count me in. But your original phrase > > ... I don't **enjoy the spotlight** so I ...
*I prefer to be behind the scenes,* or *.. backstage.*
200,263
I am trying to convey a subtle message that I'm not particularly keen at giving a presentation while also allowing the possibility that I can give it after all if the other party so desires. As reason for preferring not to give the presentation I would like to cite my public shyness. I thought I could say something li...
2014/10/07
[ "https://english.stackexchange.com/questions/200263", "https://english.stackexchange.com", "https://english.stackexchange.com/users/66696/" ]
* I don't like being the centre of attention but if you insist... * I tend to shun the limelight but if you can't find anyone else... * to be frank/honest I find presentations to be nerve wracking experiences, but if you need someone count me in. But your original phrase > > ... I don't **enjoy the spotlight** so I ...
I'd prefer not to give a presentation (because they make me nervous/uncomfortable), but I am willing to do it if you want me to. Or perhaps ...if you think it's important.
200,263
I am trying to convey a subtle message that I'm not particularly keen at giving a presentation while also allowing the possibility that I can give it after all if the other party so desires. As reason for preferring not to give the presentation I would like to cite my public shyness. I thought I could say something li...
2014/10/07
[ "https://english.stackexchange.com/questions/200263", "https://english.stackexchange.com", "https://english.stackexchange.com/users/66696/" ]
*I prefer to be behind the scenes,* or *.. backstage.*
I'd prefer not to give a presentation (because they make me nervous/uncomfortable), but I am willing to do it if you want me to. Or perhaps ...if you think it's important.
17,326,925
I've struggled with this error hours, and finally I drill down to this piece of code. This code works well when you "Run" the app, but will cause app crashes when "Test". I've googled and found this question: [Occasional errors when running OCUnit application test suite on device](https://stackoverflow.com/questions/4...
2013/06/26
[ "https://Stackoverflow.com/questions/17326925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/531851/" ]
The Z3 C++ API provides the following methods for creating bit-vector values. ``` expr bv_val(int n, unsigned sz); expr bv_val(unsigned n, unsigned sz); expr bv_val(__int64 n, unsigned sz); expr bv_val(__uint64 n, unsigned sz); expr bv_val(char const * n, unsigned sz); ``` For bit-vector values o...
Likely, the only answer you'll get to this question is "Because the devs made it so". We can really only represent finite quantities in computer science. When designing an API, the question sometimes comes up as to what the maximum or minimum value of something should be. In this particular case, the maximum value for...
1,227,159
> > Consider the inequality > $x\_1 + x\_2 + x\_3 + x\_4 ≤n$ where $x\_1,x\_2,x\_3,x\_4,n ≥ 0$ are all integers. Suppose also that $x\_2 ≥ 2$, that $x\_3$ is a multiple of 4, and $1 ≤ x\_4 ≤ 3$. Let $c\_n$ be the number of solutions of the inequality subject to these restrictions. Find the generating function for the...
2015/04/09
[ "https://math.stackexchange.com/questions/1227159", "https://math.stackexchange.com", "https://math.stackexchange.com/users/207880/" ]
First, let's sort out what the generating function is. $x\_1$ can be any non-negative integer: $$1+x+x^2+x^3+x^4+\ldots$$ $x\_2$ is any integer greater than or equal to $2$: $$x^2+x^3+x^4+x^5+\ldots$$ $x\_3$ is a non-negative multiple of four: $$1+x^4+x^8+x^{12}+\ldots$$ $x\_4$ is in $\{1,2,3\}$: $$x+x^2+x^3$$ Multip...
I would do: $$\newcommand{\u}[2]{\underbrace{#1}\_{#2}} \u{(x^0+x^1+x^2+...)}{x\_1}\u{(x^2+x^3+x^4+...)}{x\_2}\u{(x^0+x^4+x^8+...)}{x\_3}\u{(x^1+x^2+x^3)}{x\_4}$$ Or: $$\newcommand{\c}[2]{{}^{#1}{\mathbb C}\_{#2}}\frac{1}{1-x}\frac{x^2}{1-x}\frac{1}{1-x^4}\frac{x(1-x^3)}{1-x}=x^3(1-x^3)(1-x)^{-4}(1+x)^{-1}(1+x^2)^{-1}\...
54,201,943
I would like to provide links to a website with the credentials already within the link. The link is: ``` https://mychart.covh.org/MyChart/ ``` The credentials are: Username = AllStarUser Password = FiveStarPassword I have tried ``` https://mychart.covh.org/MyChart/?Username=AllstarUser,Password=FiveStarPass...
2019/01/15
[ "https://Stackoverflow.com/questions/54201943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10115680/" ]
In the `SearchBar.js` file you are updating the `testHighlight` to a string: ``` this.setState({ testHighlight: searchBarText }); ``` Didn't you mean to do: ``` this.setState({ testHighlight: [searchBarText] }); ``` Or if you want to add it to the existing array: ``` this.setState({ testHighlight: [...this.sta...
Your state 'testHighlight' is being saved as a string and 'HighlighterImplementation' component needs the 'testHighlight' as an array. So, while setting the state as a prop, you should change that state in an array. split() method can change the string to an array of strings. You have added searchBarText initial stat...
126,328
**Sentence:** > > She got married at **the age of** 30 > > > **Question:** Can I omit the part of the sentence "the age of"? > > She got married at 30 > > >
2017/04/11
[ "https://ell.stackexchange.com/questions/126328", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/50207/" ]
Without the picture, I can only define the three types of streetlights you might be talking about. "Lampposts" are poles with a light on top that resembles a lantern or globe. The light goes in all directions horizontally, and possibly up. "Pole mounted street lights" are poles that have a directional light at the to...
There is a whole lot of outside lighting; there are **wall-mounted lights (or wall bracket street lights, wall lights), street lights, lampposts, street lamps, heritage lights, bollard lights, recessed wall lights, path lights spotlights, post lamps and pole lights.** We may name all of the **outside (outdoor/external...
5,362
Is this true? "If there are no weather front or severe weather systems, then the dew point within a single day is fairly constant, no matter how large the day/night temperature variation."
2015/08/12
[ "https://earthscience.stackexchange.com/questions/5362", "https://earthscience.stackexchange.com", "https://earthscience.stackexchange.com/users/3325/" ]
From a review of weather observations, that statement is false. Below are the synoptic weather maps for Australia for 11 August 2015 and [12 August 2015](http://www.bom.gov.au/australia/charts/synoptic_col.shtml). There are no weather fronts, or adverse weather in the western two-thirds of the continent. [![Aus synop...
If you consider a closed system, this will be true, as dewpoint is related to the absolute moisture which is not a function of temperature. However, as Fred's answer demonstrates, the atmosphere is not a closed system. Even devoid of fronts and severe weather there are still pressure gradients which result in wind. Win...
55,799,009
I have a class which returns an object with its properties. I would like to access to the value of a previous prop inside the constructor. I have next working code: ``` class KafkaConsumer { constructor (metaDataBrokerList, groupID, autoCommit, AutoOffsetReset, topicName) { return { consumer...
2019/04/22
[ "https://Stackoverflow.com/questions/55799009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7757135/" ]
You example shows a CTE. So, you can use a recursive CTE: ``` with recursive dates as ( select date('2010-01-01') as day union all select day + interval 1 day from dates where day < '2010-02-01' ) select d.day, count(distinct t.action_id) as actions from dates d left join my_tab...
it seems just you need group by and count ``` select date, count(distinct action_id) as action from my_table left join dates on dates.date = my_table.date group by date ```
55,799,009
I have a class which returns an object with its properties. I would like to access to the value of a previous prop inside the constructor. I have next working code: ``` class KafkaConsumer { constructor (metaDataBrokerList, groupID, autoCommit, AutoOffsetReset, topicName) { return { consumer...
2019/04/22
[ "https://Stackoverflow.com/questions/55799009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7757135/" ]
You example shows a CTE. So, you can use a recursive CTE: ``` with recursive dates as ( select date('2010-01-01') as day union all select day + interval 1 day from dates where day < '2010-02-01' ) select d.day, count(distinct t.action_id) as actions from dates d left join my_tab...
``` with dates as ( select a.Date from ( select curdate() - INTERVAL (a.a + (10 * b.a) + (100 * c.a) + (1000 * d.a) ) DAY as Date from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all...
56,938,824
I have a table (table1) with 7 million rows and I need to copy one value from that table into a column from a different table (table2). I have tried to do this on a sample table with only 50 rows and it was very expensive (22 seconds). Am I missing something? It's a relatively simple operation and I can't have this tak...
2019/07/08
[ "https://Stackoverflow.com/questions/56938824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177850/" ]
An UPDATE with a join, that is usually faster: ``` update table2 set myvalue = t1.myvalue from table1 t1 where table2.id=t1.id; ```
Updating all the rows will be expensive. However, for this query: ``` update table2 set myvalue = (SELECT myvalue from table1 t1 where table2.id = t1.id); ``` You have a lot of scanning. An index would help, specifically on `table1(id, myvalue)`.
203,969
I'm not talking about countryside colleges/unis. * Are there any thought-out procedures in top-ranking institutions based on formal criteria, actual statistics or demand from the industry? * If so, what are the criteria used? * Are the decisions to drop certain languages and introduce others made systematically or in ...
2013/07/07
[ "https://softwareengineering.stackexchange.com/questions/203969", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/67140/" ]
If we're talking about, say, top 10 ranked US colleges and universities (other countries will likely have different traditions and people will have wildly different definitions of a "countryside college or university"), no. A community college will generally choose what languages to teach based on what languages employ...
Most colleges that I know of teach Java as the introductory language. Talking to one of my professors about how our department chose that language (and why it can't be replaced by something else), he said: * Java is portable. Write once, run everywhere. * It's strongly-typed * It's a managed language (most first-year ...
203,969
I'm not talking about countryside colleges/unis. * Are there any thought-out procedures in top-ranking institutions based on formal criteria, actual statistics or demand from the industry? * If so, what are the criteria used? * Are the decisions to drop certain languages and introduce others made systematically or in ...
2013/07/07
[ "https://softwareengineering.stackexchange.com/questions/203969", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/67140/" ]
If we're talking about, say, top 10 ranked US colleges and universities (other countries will likely have different traditions and people will have wildly different definitions of a "countryside college or university"), no. A community college will generally choose what languages to teach based on what languages employ...
Most "higher-ranked" universities don't focus on particular technologies or languages, because they are teaching concepts of Computer Science. Their primary goal is not to prepare graduates to do enterprise software development. So while their introductory courses might all use the same language for consistency's sake...
203,969
I'm not talking about countryside colleges/unis. * Are there any thought-out procedures in top-ranking institutions based on formal criteria, actual statistics or demand from the industry? * If so, what are the criteria used? * Are the decisions to drop certain languages and introduce others made systematically or in ...
2013/07/07
[ "https://softwareengineering.stackexchange.com/questions/203969", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/67140/" ]
Most "higher-ranked" universities don't focus on particular technologies or languages, because they are teaching concepts of Computer Science. Their primary goal is not to prepare graduates to do enterprise software development. So while their introductory courses might all use the same language for consistency's sake...
Most colleges that I know of teach Java as the introductory language. Talking to one of my professors about how our department chose that language (and why it can't be replaced by something else), he said: * Java is portable. Write once, run everywhere. * It's strongly-typed * It's a managed language (most first-year ...
431,664
I need help to recognize a dead component from a lab instrument control board. It is part of a TTL-serial interface, arguably a logic gate or some level shifter, in a TSSOP-14 package. You can see the picture below: manufacturer is easy to recognize as Fairchild, now OnSemi, while part of the code has been blown up. ...
2019/04/09
[ "https://electronics.stackexchange.com/questions/431664", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/188558/" ]
Vdd is the power supply voltage. Vin is the signal input voltage, and Vout is the signal output voltage. Ioh and Iol are the currents that an output pin can sink or source. They are not directly related to the current the chip draws from the power supply. Vih is the minimum input voltage that will be recognised as a...
Perhaps this fills in the gaps to your knowledge of standard CMOS datasheets. [![enter image description here](https://i.stack.imgur.com/cd0yg.png)](https://i.stack.imgur.com/cd0yg.png) Generally CD4xxx series was high voltage and high impedance. > 300 ~ 1000 Ohm for RdsOn . Since both Nch Pch drivers conduct during ...
57,091,881
I have one database table consisting of 5 fields , one is of data type int and rest four are of type string. ``` ref_num field 1 field 2 field 3 field 4 38 Test_user1 NULL NULL NULL 38 NULL Network_L2_P1 NULL NULL 38 ...
2019/07/18
[ "https://Stackoverflow.com/questions/57091881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11802156/" ]
Unit testing usually means individually testing a specific thing in isolation for example a function call. What you are doing when testing multiple components together is more commonly known as integration testing. I believe the confusion may come about as there is another type of testing - End to end testing, whic...
The moment you test more than one component at one go and you are interested in the way different components interact with each others, it is called integration testing > > Integration testing (sometimes called integration and testing, > abbreviated I&T) is the phase in software testing in which individual > softwa...
36,041,510
My project uses a test profile in Maven. When I run the unit tests in eclipse I need to pass a VM arg to replicate the profile settings. I have read that you can edit the JRE to add these arguments, but I'd prefer not to edit the JRE. Is there a project level setting in Eclipse to accomplish this?
2016/03/16
[ "https://Stackoverflow.com/questions/36041510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305875/" ]
You can add the arguments to the Run Configuration(s), but that can be tedious if you use a lot of different run configs to run tests (eg, if you run different test classes or packages of tests individually). Another option is to create an alternate JRE configuration that you use just for running tests. It can point t...
No this must be done in the Run Configuration if you want to run the JUnit Test with Eclipse.
36,041,510
My project uses a test profile in Maven. When I run the unit tests in eclipse I need to pass a VM arg to replicate the profile settings. I have read that you can edit the JRE to add these arguments, but I'd prefer not to edit the JRE. Is there a project level setting in Eclipse to accomplish this?
2016/03/16
[ "https://Stackoverflow.com/questions/36041510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305875/" ]
You can add the arguments to the Run Configuration(s), but that can be tedious if you use a lot of different run configs to run tests (eg, if you run different test classes or packages of tests individually). Another option is to create an alternate JRE configuration that you use just for running tests. It can point t...
I think you can use the Run Configuration settings. You can also setup at JRE level in order to default. Go to Window->Preferences->Java->Installed JREs. Select the JRE you're using, click Edit, and there will be a line for Default VM Arguments which will apply to every execution. For instance, I use this on OSX to hi...
71,371,384
I have this array: ``` [{start_date: "2022-12-05T04:00:00Z" ,distance: 1000, time: 3600} ,{start_date: "2022-02-07T04:00:00Z" ,distance: 1500, time: 6400}, {start_date: "2022-12-08T04:00:00Z" ,distance: 1000, time: 1300}] ``` I want to add the distance and time values ​​grouping them by the month indicated by the s...
2022/03/06
[ "https://Stackoverflow.com/questions/71371384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12842571/" ]
you can use `reduce` to group them by month which will give an object like ``` { 12: { distance: 2000, month: 12, time: 4900 }, 2: { distance: 1500, month: 2, time: 6400 } } ``` and using `Object.values` get the values array of it ```js let x = [{start_date: "2022-12-05T04:00:00Z" ,d...
You can use a object as a dictionary and save a accumulated value of time and distance per month key. Then, reduce all keys to an array with the requested format. ```js const groupPerMonth = (list) => { const extractMonth = (stringDate) => { const month = new Date(stringDate).getMonth() + 1; retur...
71,371,384
I have this array: ``` [{start_date: "2022-12-05T04:00:00Z" ,distance: 1000, time: 3600} ,{start_date: "2022-02-07T04:00:00Z" ,distance: 1500, time: 6400}, {start_date: "2022-12-08T04:00:00Z" ,distance: 1000, time: 1300}] ``` I want to add the distance and time values ​​grouping them by the month indicated by the s...
2022/03/06
[ "https://Stackoverflow.com/questions/71371384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12842571/" ]
you can use `reduce` to group them by month which will give an object like ``` { 12: { distance: 2000, month: 12, time: 4900 }, 2: { distance: 1500, month: 2, time: 6400 } } ``` and using `Object.values` get the values array of it ```js let x = [{start_date: "2022-12-05T04:00:00Z" ,d...
There might be different solutions to this, but one way to solve this is by using the lodash library to solve this. We can first `group` by month, followed by `mapping` each grouped item and adding the distance and time values in each group using `reduce`: ```js const list = [ {start_date: "2022-12-05T04:00:00Z" ...
53,921
I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I can't seem to limit the number of decimal places so that I just have solid numbers. Right now I have 13 places after the d...
2013/03/08
[ "https://gis.stackexchange.com/questions/53921", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/15778/" ]
If you create a new field, make it "integer" instead of "real" if you don't want any values after the comma anyway. Alternatively, use the "toint" function in "conversions".
You don't do that in the field calculator, try the properties of that field, there is a button, num or ... That will allow you to set rounding and precision.
53,921
I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I can't seem to limit the number of decimal places so that I just have solid numbers. Right now I have 13 places after the d...
2013/03/08
[ "https://gis.stackexchange.com/questions/53921", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/15778/" ]
Open the field calculator, click on `new virtual field`, assign decimal data type and then use the following code ``` count("the column you want to limit", 2) ``` Your new virtual field will be having the same value as your decimal field, but will be limited to 2 decimal numbers.
You don't do that in the field calculator, try the properties of that field, there is a button, num or ... That will allow you to set rounding and precision.
53,921
I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I can't seem to limit the number of decimal places so that I just have solid numbers. Right now I have 13 places after the d...
2013/03/08
[ "https://gis.stackexchange.com/questions/53921", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/15778/" ]
If you create a new field, make it "integer" instead of "real" if you don't want any values after the comma anyway. Alternatively, use the "toint" function in "conversions".
Open the field calculator, click on `new virtual field`, assign decimal data type and then use the following code ``` count("the column you want to limit", 2) ``` Your new virtual field will be having the same value as your decimal field, but will be limited to 2 decimal numbers.
80,764
Darksiders 2 doesn't seem to have any in-game info telling me exactly how the game difficulty will increase if I choose Apocalyptic instead of Normal difficulty. I've seen games handle this in a variety of different ways, such as upping monster health/damage, lowering drop rates of things like healing potions, or even ...
2012/08/15
[ "https://gaming.stackexchange.com/questions/80764", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3062/" ]
When I clicked on change difficulty, it prompted me that changing the difficulty mid-session will result in being rewarded based on the lowest difficulty selected. So my guess is the drops will change if you select a harder difficulty, however I'm not certain because it may mean that choosing difficulty mid-session wil...
In Darksiders II the quality item drop rate increases. As well as other things mentioned above