date stringlengths 10 10 | nb_tokens int64 60 629k | text_size int64 234 1.02M | content stringlengths 234 1.02M |
|---|---|---|---|
2018/03/05 | 959 | 2,456 | <issue_start>username_0: I have an issue with anti aliasing when i spin model with orbiter
i am using
renderer = new THREE.WebGLRenderer({
preserveDrawingBuffer: true,
antialias: true });
it is helping but not resolving the issue fully.
[](https://i.stack.imgu... |
2018/03/05 | 433 | 1,665 | <issue_start>username_0: Given:
```
if(arr[0]!=null && arr[0].value.toString()!="") {
//do something
}
```
Does an if conditional statement return false immediately after the first statement fails? Or does it check the second condition regardless?
Cheers,
Gavin :)<issue_comment>username_1: It will return immedi... |
2018/03/05 | 542 | 1,778 | <issue_start>username_0: I need a div that should be
1. Resizeable and
2. Editable.
And should work in IE and Chrome.
So if I start to edit in the div and if i reach the end of the line in that div then the cursor should move to next line. How do i achieve it.
Below is the code i tried but it does work in IE but n... |
2018/03/05 | 1,097 | 3,956 | <issue_start>username_0: I apologise if any part of this is confusing; it's currently 11:21PM, and I've been trying to get this working since 1PM.
I'm cloning a private Github repository to my working directory using `git clone git@github.com:username/repo.git /var/www`. This works perfectly! No troubles.
I have setu... |
2018/03/05 | 607 | 2,053 | <issue_start>username_0: How can I check whether `my_func` was called from `blur` or `focus`, in the following code?
```
function my_func(my_arg) {
// Maintain compatibility with ECMAScript < 6
// https://stackoverflow.com/a/894877/1563422
my_arg = typeof my_arg !== 'undefined' ? my_arg : false;
if(my... |
2018/03/05 | 1,337 | 4,201 | <issue_start>username_0: I am trying to execute this query in pgAdmin 4 however I am running into errors every time I try to run it. Please see the code and error below:
```
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min... |
2018/03/05 | 2,026 | 5,225 | <issue_start>username_0: I have a table with the following structure (header):
```
ProjID,Cost2001,Cost2002,Cost2003
```
So for example the first two rows look like so:
```
projectA,10,32,30
projectB,42,22,122
```
I would like to transform this table into the following structure (header):
```
ProjID,CostYear,Val... |
2018/03/05 | 993 | 3,068 | <issue_start>username_0: For a given string, I'm trying to count the number of appearances of each word and emoji. I did it already [here](https://stackoverflow.com/q/47375680/7252805) for emojis that consists only from 1 emoji. The problem is that a lot of the current emojis are composed from a few emojis.
Like the ... |
2018/03/05 | 1,025 | 3,730 | <issue_start>username_0: I have mongoose-schema called UserSchema, which stores information about all users.
I want to enable the user to change his information, which I try by using .findByIdAndUpdate.
This is the relevant code:
```
router.post("/updateprofile", function(req,res,next) {
const {id, org, tel, ema... |
2018/03/05 | 1,320 | 4,808 | <issue_start>username_0: I'm using Junit5. I want to implement a dynamic test where test cases are defined in a YAML file. Now I'm hitting a problem as the title.
Looking at my sample code:
```
@Test
public void t1() throws Exception {
java.lang.reflect.Method method = org.junit.jupiter.api.Assertions.class.getMe... |
2018/03/05 | 534 | 2,019 | <issue_start>username_0: I'm currently working with OKHTTP and I've ran into a situation where accepting gzip encoding in my header, would cause text to come back malformatted (i know, its just gzipped).
My solution is to just pull that out of any headers that get passed into my program, replacing gzip with: Accept-En... |
2018/03/05 | 981 | 3,327 | <issue_start>username_0: I would like my ternary operator to not do anything if the `outcome` is neither 1 nor -1
```
outcome === 1 ? playerScore++ : outcome === -1 ? compScore++ : DO_NOTHING;
```
I realize that I could just write a `0` instead of `DO_NOTHING` but is there a better way to ensure nothing happens if n... |
2018/03/05 | 850 | 3,054 | <issue_start>username_0: I'm currently facing a problem while developing a Chrome Extension. This extension is used on a ReactJS based website. I need to scrap some data from the page. He is an example of the page.
```
| ... |
...
```
When I use the Chrome inspector, I can see that my `div class="UserWallet">` h... |
2018/03/05 | 816 | 2,578 | <issue_start>username_0: I am running python via spyder in anaconda. I am a new python user. I am trying to run a black-scholes option pricer by finding code on the internet. I found this site:
<https://www.packtpub.com/mapt/book/application_development/9781783284375/4>
and start to copy the code but get a lot of er... |
2018/03/05 | 1,039 | 3,261 | <issue_start>username_0: I am trying to create a report showing estimated time vs actual time using Team Foundation Server 2017 for User Stories and Bugs. If I execute the following query I get all of the tasks and bugs:
```
SELECT * FROM [Tfs_Warehouse].[dbo].[DimWorkItem]
```
I understand that a User Story can ha... |
2018/03/05 | 633 | 2,189 | <issue_start>username_0: I am using `Symfony 3.4.4` and getting Twig\_Error\_Loader:
```
Unable to find template "MyBundle:Default:index.html.twig" (looked into: /Users/nemanja/sites/SimfoniAplikacija/app/Resources/views, /Users/nemanja/sites/SimfoniAplikacija/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/v... |
2018/03/05 | 1,156 | 3,995 | <issue_start>username_0: I have an Oracle database table containing product reviews. One of the columns is `sort_order` β i.e. the order in which the reviews are displayed when read from the database into a web front end.
I need to batch insert a bunch of new reviews from a temporary loading table (which has been popu... |
2018/03/05 | 1,239 | 4,107 | <issue_start>username_0: Here is my Node class:
```
class Node:
def __init__(self, value):
self.value = value
self.next = None
def __repr__(self):
if self.next == None:
return 'Node({})'.format(repr(self.value))
else:
return 'Node({}, {})'.format(
repr(self.value), repr(self.next))
``... |
2018/03/05 | 1,692 | 5,504 | <issue_start>username_0: When using `ggplot` on objects with large number of groups (e.g. n > 14), most palettes are not able to cope. The function `colorRampPalette` is able to extend the range, but to embed it in the `scale_fill_manual`, you would need to know the number of unique groups.
Is there a way to automati... |
2018/03/05 | 1,018 | 3,699 | <issue_start>username_0: I would like to build a Pipeline that integrates multiple repositories.
The general idea:
1. Provide a branch name as input.
2. Use the GitHub-API to find Pull-Requests across several projects, that were created from a branch with that name.
3. Make (shallow) clones from several repositories,... |
2018/03/05 | 499 | 1,414 | <issue_start>username_0: I have a simple function in a `for` loop. I want when I choose one of the `select` elements, an alert displays and tells me the value that I have chosen.
But the argument `i` of the for loop doesn't work.
What's the problem?
```
choose
1
2
choose
1
2
for(i=1; i<=2; i++)
{
$("#s"+i).change(f... |
2018/03/05 | 768 | 2,723 | <issue_start>username_0: I am trying to replace multiple characters with white-space characters from a user inputted string. The ultimate goal of the program is to count the words and count punctuation as white space. Such as hey...man counting as two words. However, only my last replacement works, I know that why, but... |
2018/03/05 | 1,293 | 4,508 | <issue_start>username_0: I'm returning results from a firebase query. The result is an array of objects with different properties. It's for a car app that I'm making. Each object look like this
```
{
make: "make",
model: "model",
year: "year",
gas: "petrol",
mileage: "mileage",
images: {
image... |
2018/03/05 | 1,066 | 3,894 | <issue_start>username_0: I am coming to Go from Java and some things confuses me.
For example, let's consider the following code:
```
package main
import (
"fmt"
)
type I interface {
Do()
MegaDo()
}
type A struct {
}
func (a *A) Do() {
fmt.Println("A")
}
func (a *A) MegaDo() {
a.Do()
}
type ... |
2018/03/05 | 663 | 2,433 | <issue_start>username_0: Here is a [simple example](https://stackblitz.com/edit/ngxs-example-basic).
In console.log the state is updated correctly. Also the template is updated correctly.
In redux dev tools the state is updated with a delay of a dispatch.
To be more clear, the initial state is:
```
{data: [], loadi... |
2018/03/05 | 1,118 | 3,507 | <issue_start>username_0: I have problem with one query and to be honest i have no idea if this is even possible to write in good and readable way.
I have 2 table.
First is Event with 4 columns :
```
EVENT_ID | EVENT_TYPE | DETAIL_TYPE | DETAIL_ID
```
Second table is EVENT\_DETAIL with more than 10 columns but we ... |
2018/03/05 | 431 | 1,314 | <issue_start>username_0: I'm currently writing a Perl script, so i have an array @A in another array @B, but when the array @A is updated, the array @B don't take this update in consideration.
Here is my code:
```
my @A;my @B;
@B=("test",[@A]);
@A=("aaa","bbb","ccc");
print $B[1][1];
```
It work only when i change... |
2018/03/05 | 446 | 1,637 | <issue_start>username_0: I am building a new tensorflow model based off of SSD V1 coco model in order to perform real time object detection in a video but i m trying to find if there is a way to build a model where I can add a new class to the existing model so that my model has all those 90 classes available in SSD MO... |
2018/03/05 | 964 | 2,853 | <issue_start>username_0: I have this javascript code:
```js
var chars = '<KEY>',
key = '',
c;
for (i = 0; i < 32; i++) {
c = Math.floor(Math.random() * chars.length + 1);
key += chars.charAt(c)
}
console.log('return key length that needs to be 32...' + key.length);
```
I need to always return 32 key ... |
2018/03/05 | 1,197 | 3,845 | <issue_start>username_0: So for class we are learning about OOP in C++, and I built my class but every time I try to compile it I get this error message:
```
Undefined symbols for architecture x86_64:
"Player::set_assits(int)", referenced from:
_main in playerDataBase-666bbb.o
"Player::set_last_name(std:... |
2018/03/05 | 793 | 3,401 | <issue_start>username_0: I'm writing an angular app which uses @ngx-translate. With TranslateModule.forRoot(...) i provide a TranslateLoader:
```
@NgModule({
imports: [
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient, Co... |
2018/03/05 | 647 | 2,718 | <issue_start>username_0: I have an uncommon webpack error and I don't know how to fix it..
It has something to do with my **configuration**, but I don't know what it is. A schoolmate of mine can perfectly run `webpack` in the console with the **same project**.
Earlier I got the error:
```
PS E:\HTL\Projects\EasyWate... |
2018/03/05 | 588 | 2,570 | <issue_start>username_0: I have this function for deleting specific jars from a remote server:
```
deleteJars: function(appDir, version, callback) {
fs.readFile('/file/location', function(err, data) {
if(err) throw err;
var array = data.toString().split("\n");
for(i in array) {
... |
2018/03/05 | 578 | 2,006 | <issue_start>username_0: I have a project subdivided into packages, in the following structure:
```
/project
/pkg
__init__.py
engine.y
ai.py
__init__.py
test_script.py
```
engine.py has an import statement to use ai.py which looks like
```
import pkg.ai as ai
```
This means tha... |
2018/03/05 | 1,327 | 3,761 | <issue_start>username_0: I would like to extract video ids from potentially different URLs
```
https://www.facebook.com/{page-name}/videos/{video-id}/
https://www.facebook.com/{username}/videos/{video-id}/
https://www.facebook.com/video.php?id={video-id}
https://www.facebook.com/video.php?v={video-id}
```
How can I ... |
2018/03/05 | 1,198 | 3,437 | <issue_start>username_0: I am trying to convert NodeList to an array.
The problem is that when NodeList is one element long.
It will work fine
```
var Nlist = document.forms['moj']['pp'];
inputs = Array.prototype.slice.call(Nlist);
console.log(Nlist);
console.log(inputs);
```
But this one wil not work, howcom... |
2018/03/05 | 1,726 | 6,356 | <issue_start>username_0: Currently working for a company that use .NET (not Core) but want to switch to .NET Core and thought to do so by creating an app with a Flutter.io frontend and .NET Core backend. The app w/ backend is just to see how .NET Core functions.
I could not find any information if the combination of t... |
2018/03/05 | 1,048 | 3,242 | <issue_start>username_0: My json structure as below;
```
var MyJson =
[
{
"Country": "Austria",
"SubCategory": "55",
}, {
"Country": "Brazil",
"SubCategory": "0",
}, {
"Country": "Canada",
"SubCategory": "25",
}, {
"Country": "Cyprus",
... |
2018/03/05 | 940 | 3,395 | <issue_start>username_0: I have a feeling I might get downvoted for this, but I really did try to look it up.
I want to initialize an array of class type objects. errr...ref type, I think they call it in C#. I want an array of non-primitive, non struct, types.
After Googling and reading Stack Overflow Answers, the on... |
2018/03/05 | 562 | 1,897 | <issue_start>username_0: I can not connect my Laradock docker with Sequel Pro.
In my .env file
```
### MYSQL
MYSQL_VERSION=8.0
MYSQL_DATABASE=default, athsurvey
MYSQL_USER=homestead
MYSQL_PASSWORD=<PASSWORD>
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=<PASSWORD>
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
```... |
2018/03/05 | 1,359 | 4,180 | <issue_start>username_0: I need to calculate just first five prime numbers. I want to check the length of list while building it in list comprehension. The following code doesn't work.
```
def checkPrime(n):
for i in range(2,int(n**0.5)+1):
if n%i==0:
return False
return True
primes = [] ... |
2018/03/05 | 1,290 | 4,670 | <issue_start>username_0: I am developing an App with React Native. I need to retrieve some data using fetch every 30 seconds. My code works fine and it retrieves the data correctly every 30 seconds. My problem is that as soon as I redirect to another screen, I get the following warning:
>
> Warning: Can only update a... |
2018/03/05 | 478 | 1,765 | <issue_start>username_0: I am trying to capitalize everything i type inside the text-input the caps function on js works fine which i can see on console but the innerhtml function is not changing the html file
```js
function clr() {
document.getElementById("box").value = '';
}
function caps() {
var str = docu... |
2018/03/05 | 657 | 2,559 | <issue_start>username_0: I have a method 'makeFriend(email)' on my node.js server which adds one user with another as a friend using both of their email IDs, as follows
<https://fitnessrace.herokuapp.com/users/>{emailOfUser}/make\_friend/{emailofFriend}
The response from postman is [The Postman successful response](ht... |
2018/03/05 | 593 | 2,030 | <issue_start>username_0: I'm trying to learn more about using Oracle, and I'm trying to understand loops and how to use them. I've got this :
```
loop
update table
set amount=(amount+3)
exit when amount>=20
end loop;
```
Currently amount is 12, so I'd expect it to add 3 to amount until it reaches 21, because then it... |
2018/03/05 | 564 | 2,107 | <issue_start>username_0: My scenario is:
```
this.setState({firstState:1})
if(condition){
this.setState({secondState:2})
}
```
firsState should always be set to 1 but the secondState should only be set to 2 if a certain condition is fulfilled.
Is this bad practice because state will be updated twice directly afte... |
2018/03/05 | 1,087 | 4,604 | <issue_start>username_0: I have a page to edit the administrators of a post. In this page it is possible to update the administrators of a post but also create new administrators for the post.
In this page there are some radio buttons. Each radio button corresponds to an administrator of a post. When a radio button is... |
2018/03/05 | 565 | 2,431 | <issue_start>username_0: I would like to send some info to Firestore database (Firebase), preferably in key-value pairs (but not necessarily), so that it can use it to evaluate access in their rules (both when reading and writing).
However, I don't want this info to be part of the path.
For example, suppose I had so... |
2018/03/05 | 624 | 2,616 | <issue_start>username_0: My data frame contains 3 temperature values and one target value. I want maximum co-occurrence values in temprature based on target value.
Sample dataframe:
```
Index Temp 1 Temp 2 Temp 3 Target
1 62 66 52 0.24
... |
2018/03/05 | 1,775 | 4,997 | <issue_start>username_0: I have a table that contains a lot of data, but the relevant data in the table looks something like this:
**Orders** table:
```
+----------+-----------+---------------+
| OrderID | Product | Date |
+----------+-----------+---------------+
| 1 | Apple | 01/01/2001 |
|... |
2018/03/05 | 412 | 1,512 | <issue_start>username_0: Tried to convert `firestore` timestamp to string and I got this!
[](https://i.stack.imgur.com/6Eeuc.png)
I tried `String date = FieldValue.serverTimestamp().toString();` and instead of time stamp I got this as shown in Screen... |
2018/03/05 | 530 | 2,014 | <issue_start>username_0: In my Angular 5 project I've got a bootstrap nav-bar menu. `routerLinkActive` does work nicely when the start of the path matches the routerlink of the menu, like:
```
- Teacher
```
the Code above activates the menu item nicely for `/entity/teacher/add' and more
Problem is, I've got a Kind ... |
2018/03/05 | 1,274 | 3,747 | <issue_start>username_0: I have this expression with ?: operator:
```
(adc.Voltage1[Counter.ADC_ConversionCount] = ADC_readResult(Handler.myAdc, ADC_ResultNumber_1)) > 10 ? Counter.WriteOut = 1 : Counter.WriteOut = 0;
```
And the same expression with if-else:
```
if((adc.Voltage1[Counter.ADC_ConversionCount] = ADC... |
2018/03/05 | 656 | 2,591 | <issue_start>username_0: When a sap.ui.xmlfragment is rendered by UI5, formatters are executed only once and their results are cached. Then the dialog is closed ( dialog.close() ), user changes for example language, and runs the dialog again ( dialog.open() ).
But formatters are not evaluated again and therefore the p... |
2018/03/05 | 554 | 2,300 | <issue_start>username_0: I have an app that targets Android 4.1+. My designer is working on a screen that has a lot of information and we are trying to make sure it will fit on the smallest possible screen size given my minimum Android version. Is there such a list for actual real existing devices?
Thank you.<issue_c... |
2018/03/05 | 2,049 | 6,053 | <issue_start>username_0: I've been following the upgrade guide provided on the Laravel website from 5.5 -> 5.6
<https://laravel.com/docs/5.6/upgrade>
When I run composer install everything seems okay, but then I run composer update everything gets wonky, this seems to be something I should be concerned about, how do ... |
2018/03/05 | 724 | 3,248 | <issue_start>username_0: As explained in some answers:
>
> On Android, Firebase automatically manages connection state to reduce bandwidth and battery usage. When a client has no active listeners, no pending write or onDisconnect operations, and is not explicitly disconnected by the goOffline method, Firebase closes... |
2018/03/05 | 553 | 2,225 | <issue_start>username_0: The following query is taking more than 1 min, and timing out. It's made from Grafana:
```
/grafana/api/datasources/proxy/2/api/v1/query_range?
query=rate(rmq_publish{name="app1" }
[5m])&start=1520264038&end=1520264338&step=30
```
The behaviour is same both with rate and irate, and wi... |
2018/03/05 | 975 | 3,605 | <issue_start>username_0: I have a GMail add-on which uses CardService for UI. Some of the callback functions for the Card actions take over than 30 sec. Thus, I'm getting the following error.
>
> Gmail could not perform this add-on action.
>
>
>
Is there, any way to run Google Apps Script functions on the Server ... |
2018/03/05 | 2,004 | 6,031 | <issue_start>username_0: I've created a vertical [stacked bar chart](https://ecomfe.github.io/echarts-doc/public/en/option.html#series-bar.stack) with [Baidu ECharts](https://ecomfe.github.io/echarts-doc/public/en/index.html).
Is it possible to show the *sum* of all values on top of the stack?
Edited :
i have edited... |
2018/03/05 | 444 | 1,503 | <issue_start>username_0: I have a Python package installed that displays Google geography info from a search term. I cannot apply the function across all the rows in my data. I can confirm that it works for a single result:
[](https://i.stack.imgur.co... |
2018/03/05 | 329 | 1,442 | <issue_start>username_0: I created `UIViewController` using an `NSManagedObject` instance, let call it `A`. The `A` has beed fetched from `mainContext`.
In other part of the project some kind of process have updated `NSPersistedContainer` using `backgroundContext`. During this update `A` changed state.
What is the b... |
2018/03/05 | 702 | 2,523 | <issue_start>username_0: Is there a binary heap implementation where I can pop other elements than the root in log n time?
I use heapq - but `heap.index( wKeys )` in
```
heap.pop( heap.index( wKeys ) )
```
is very slow. I need a binary heap for my problem - where I sometime use
```
heapq.heappop(heap)
```
but al... |
2018/03/05 | 711 | 2,460 | <issue_start>username_0: i have this xml file :
```
zag
bob
ned
Zorro
Danseur
```
in python3.6 i want to get this output :
```
[[zoulou,yotta,alpha],[beta,omega]]
```
actually i can have all tag with this code in python
```
tree = etree.parse("./file.xml")
[elt.tag for elt in tree.findall("discovers/disc... |
2018/03/05 | 482 | 1,910 | <issue_start>username_0: I am struggling to find any examples of code to get data in Python to print to a printer. Any examples I find either use win32api (which I can't seem to get installed for Python 3.3.2) or just outright won't work.
The documentation I've looked at is all jumbled up to me as I am programming usi... |
2018/03/05 | 469 | 2,052 | <issue_start>username_0: Im am currently having issues with injection of EJBs in a thread. WildFly, Websphere Liberty >17 and even WebSphere Traditional >9 can deal with injection of EJBs in Threads, but in WebSphere Traditional 8.5 I am experiencing a `NullPointerException` in `ResourceInjectionServiceImpl`.
The Jav... |
2018/03/05 | 1,001 | 3,341 | <issue_start>username_0: How can change the presentation of the data so I get the names o the princesses by two columns, shown in "Wanted output". Column grouping on Knight's name gives me a Princess column for each of the princesses names. I only want two columns since I know that a knight will never have more than tw... |
2018/03/05 | 1,259 | 2,498 | <issue_start>username_0: There is data frame df with two columns with datetime.time objects like this:
```
TimeA TimeB
00:50:13 00:50:00
00:51:46 00:50:00
00:52:58 00:50:00
00:54:05 00:51:00
```
I want to create third column with differnce between these two. Elements i... |
2018/03/05 | 924 | 3,728 | <issue_start>username_0: VB.NET:
I've always used bindingsource's with dataset and using the fill command and then populating grids etc - no problem, but I have had to use a programatically coded dataset as manipulation needs to go on behind the scenes due to the nature of what I am working on for the company I am empl... |
2018/03/05 | 849 | 2,970 | <issue_start>username_0: Can I use a javascript if/else function to change the select options of a form? I don't want to use CSS to hide/display different dropdown menus, so here is what I've ccome up with:
```js
function getType() {
var x = document.getElementById("food").value;
var items;
if (x === "fruit"... |
2018/03/05 | 1,154 | 4,067 | <issue_start>username_0: I am working on my form validation and I want to display different error message according to the error I get. I am using `Silex` and `Twig` with the `translator component` and `balloon.css` for the tooltip and it works so far.
Now I want to translate this error message according to the langag... |
2018/03/05 | 1,104 | 3,479 | <issue_start>username_0: I have an enum with different variants and I want to find the first variant that matches then transform it by either returning the variant value or mapping it to something else.
In Scala, I'd use case classes to do something like:
```scala
data.collectFirst{ case d: DataD => d.data }
```
... |
2018/03/05 | 1,294 | 3,289 | <issue_start>username_0: I want to apply an offset rolling window function on a DataFrame with a date index. Here's an example:
```
rng = pd.date_range('2017-01-03', periods=20, freq='W')
df = pd.DataFrame(np.random.randn(20), rng, columns=['Val'])
df.index.name = 'Date'
r = df.rolling('15D')
```
This produces a Dat... |
2018/03/05 | 507 | 1,850 | <issue_start>username_0: When I run my project I get the following error
Error:(3433, 37) error: ';' expected
Error:(3433, 42) error: identifier expected
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
>
> Compilation failed; see the compiler error output for details.
>
>
>
Ther error is in ... |
2018/03/05 | 1,522 | 4,416 | <issue_start>username_0: **Background:**
I have the following for python 3
```
data = [{'name': 'Jon','id_str': '01'},{'name': 'Tom','id_str': '02'}, {'name': 'Jim','id_str': '03'}]
id = ['01','1133', '02', '2222']
```
**Goal**: Keep `data` when `id` == `id_str` and append to a list.
The code below appends the f... |
2018/03/05 | 406 | 1,243 | <issue_start>username_0: I have the following query which returns a total dollar amount.
```
select sum(cast(dollars as dec)) from financials
```
This includes positive and negative values.
I would like 2 separate things:
1. How can I just query the positive dollar amounts? ie. I have 3 records, 10 , -5 , 10. resu... |
2018/03/05 | 421 | 1,405 | <issue_start>username_0: Suppose I have a list of words e.g.
```
var words = new [] {"bob", "alice", "john"};
```
Is there a way to represent each of those words as numbers so that one could use such numbers to sort the words.
One use-case which I think this can be used for is to use *Counting Sort* to sort a list ... |
2018/03/05 | 1,418 | 4,454 | <issue_start>username_0: So I have this function in Scala:
```
def f(a: Int)(b: Int)(c: Double)(d: Double): Double = a * c + b * d
```
The question is What are the three types that make the following statements compile.
```
def g: = f(1)(2)(3.0)
def h: = f(1)(2)
def k: = f(1)
```
I'm still new to Scala and I... |
2018/03/05 | 441 | 1,491 | <issue_start>username_0: I just wanted to display my Array inside of either an div or a heading.
The code i posted down below only displays the last part of the "List".
When i tried to use: document.write instead, everything worked fine.
Is there any special trick to display the list the same way document.write d... |
2018/03/05 | 486 | 1,578 | <issue_start>username_0: I want to save "instructions" for how a value should be determined at a later time, instead of saving the actual value at the current time.
Is this even possible?
A simple C# example:
```
int[] myArray = new int[2];
Dictionary myDictionary = new Dictionary();
//dictionary type can be changed ... |
2018/03/05 | 1,276 | 3,433 | <issue_start>username_0: Given an array like `a = [ -1; 0; 1];`. For each `a(i)`, I need to compute a linearly spaced vector with `linspace(min(a(i),0),max(a(i),0),3);`, where each linspace-vector should be stored into a matrix:
```
A = [-1 -0.5 0;
0 0 0;
0 0.5 1];
```
With a for loop, I can do this ... |
2018/03/05 | 1,281 | 3,549 | <issue_start>username_0: I want to make a function to wrap blocks of my code. So I could put something before it and at the end.
```
function wrap(block) {
console.log("Start")
block
console.log("End")
}
// This block needs to be wrapped
let a = body
console.log(content start)
console.log(a)
console.log("content ... |
2018/03/05 | 1,183 | 4,530 | <issue_start>username_0: I will do my best to explain my problem in detail below, but the question asked stays the same. In short my question is:
**Is there a way to make an element hidden/invisible being 0px in height or at least a considerable less amount in height than 1px but still keep the element it's width so t... |
2018/03/05 | 555 | 2,122 | <issue_start>username_0: I've been reading about the thread-safety of CPython's `collections.deque` [here](https://stackoverflow.com/a/8554182/3019689) and [here](https://bugs.python.org/issue15329#msg199368). I understand that `.append()` and `.popleft()` operations play nice with each other across threads, as do `.ap... |
2018/03/05 | 743 | 2,092 | <issue_start>username_0: 4 distinct data from 1-10 instances, another 4 from 11-20instances, another 4 from 21-30 instances.
I have used
randperm(n,k) function
k->4 %no of distinct data
n %range from 1-nth instance to choose randomly
So,in 1st iteration n = 10. So that it will take randomly from 1st-10th instance... |
2018/03/05 | 846 | 2,646 | <issue_start>username_0: In Application Controller I have a method current\_user with if statement if cookies.signed[:user\_id]. The method works all the time but today I created new controller and route and it throw me an error
```
undefined method `signed' for nil:NilClass
```
This is the Application Controller:
... |
2018/03/05 | 371 | 1,350 | <issue_start>username_0: HI i am trying simple example from this official website of stanford CoreNLP example: <https://stanfordnlp.github.io/CoreNLP/api.html>
\*\*\*\*\* TokensRegexNERAnnotator ner.fine.regexner: Read 585586 unique entries from 2 files
Exception in thread "main" java.lang.OutOfMemoryError: GC overhea... |
2018/03/05 | 499 | 2,126 | <issue_start>username_0: I am trying to achieve an effect for my Android TV app so that views expand while they're focused.
I did that by animating the ViewHolder's main view's `LayoutParams`.
It works fine but the problem is that when i scroll towards the end of the view (Horizontal LinearLayout) the view expansion ... |
2018/03/05 | 259 | 941 | <issue_start>username_0: please help me. How can i bind data to `ng-keyup` value to function
```
$scope.Getvaliedemail = function ($event) {
var valp = $event.key;
if(value.length>3){
//code goes here
}
}
```
Here `var valp = $event.key;` values coming as a after that b<issue... |
2018/03/05 | 415 | 1,390 | <issue_start>username_0: So I was playing around with PowerShell a little and came across a somewhat surprising result in the following code
```
function returns_true(){
return $true
}
function returns_false(){
return $false
}
if (returns_true -eq $true){
Write-Host "I return true"
}
if (returns_false -... |
2018/03/05 | 670 | 2,184 | <issue_start>username_0: I have 8000 images and essentially need to delete any photo that has a white background. I'm hoping to find a way I can sort all of these images by the dominant color (which would hopefully be white), or by the background colour, lets say the top left pixel.
Can this be achieved with imagemagi... |
2018/03/05 | 475 | 1,504 | <issue_start>username_0: I got a scripting question. I have a shell command that produces the output below. Please note there's only one but in reality there are many results.
```
NAME | xpr : SEVERITY
| xxpr : 000
| clavv :
| clfic :
| name :
... |
2018/03/05 | 520 | 1,645 | <issue_start>username_0: Every time I want to rewrite a commit to keep only a part of the diff, I go through this (off the top of my head, something may be off):
```
git rebase -i COMMIT~1
```
then select `e` for amend.
```
git reset HEAD~1
git add -p # select the part I want
git checkout HEAD -- :/ # discard cha... |
2018/03/05 | 531 | 1,897 | <issue_start>username_0: I have a function, which push each key from Firebase to array for further usage in project.
```
// component.ts
let x = this.wordService.getWords();
let randWordList: any[] = new Array();
x.snapshotChanges().subscribe(word => {
word.forEach(element => {
randWordList.push(element.key);
... |
2018/03/05 | 1,064 | 4,345 | <issue_start>username_0: I regularly need to search multiple tables for exact or like matches of a given value. The `SELECT` statements are always the same, but the value I search for is always different.
```
SELECT * FROM employees WHERE first_name = 'foobar';
SELECT * FROM jobs WHERE job_title LIKE 'foobar%';
SELECT... |
2018/03/05 | 1,949 | 8,668 | <issue_start>username_0: I am trying to create a generic Expression builder, which basically works fine as long as none the objects values is null.
My current code looks like this (StartsWith as an example):
```
case FilterOperationTypes.StartsWith:
{
ParameterExpre... |
2018/03/05 | 1,574 | 6,705 | <issue_start>username_0: I am using the following code to change the length of all character variables in my dataset. I am not sure why this loop is not working.
```
data test ;
set my.data;
array chars[*] _character_;
%do i = 1 %to dim(chars);
length chars[i] $ 30 ;
%end;
run;
```... |
2018/03/05 | 785 | 2,687 | <issue_start>username_0: I'm trying to insert a check step in my R script to determine if the structure of the CSV table I'm reading is as expected.
See details:
table.csv has the following colnames:
[1] "A","B","C","D"
This file is generated by someone else, hence I'd like to make sure at beginning of my script that... |
2018/03/05 | 199 | 599 | <issue_start>username_0: I have a logical vector and I would like to find every index of the switches from FALSE to TRUE... ...in a one liner.
For instance :
```
logical = c(TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE)
#return c(3, 6)
```
I thought about something like:
```
which(c(FALSE, TRUE)==logical)
```
But... |
2018/03/05 | 564 | 1,092 | <issue_start>username_0: I have a txt file, which can be shown as:
```
10 1:0.870137474304 2:0.722354071782 3:0.671913562758
11 1:0.764133072717 2:0.4893616821 3:0.332713609364
20 1:0.531732713984 2:0.0967819558321 3:0.169802773309
```
Then I want to read the file and form a matrix in the form of :
```
[[10 0.87... |