date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/03/05
583
2,363
<issue_start>username_0: I have a component that I created and its called options because it renders edit and delete button. Then I have a table component that is reusable. I inject the table component into a view on the site. Then I import the options component but I don't display it on that view because I want to pas...
2018/03/05
2,213
7,303
<issue_start>username_0: I have two objects like following: ``` public class A { private Integer id; private String name; private List **list; public A(Integer id, String name, List **list) { this.id = id; this.name = name; this.list = list; } //getters and setters }**** ``` and ``` public class ...
2018/03/05
2,401
8,631
<issue_start>username_0: I have a main class (its layout is BorderPane) that has a search text field and when you input something and press the button beside it, it should then show a list of the String that is associated with the inputted word. I use an AnchorPane to contain the ListView but whenever I try to populate...
2018/03/05
294
945
<issue_start>username_0: I want to localize my app, but I got a problem: If I call the trans function like this: `{{ __('permission.addUser') }}`, the output is > > Add new user > > > If I call `{{$permissions[13]}}` the output is > > addUser > > > But if I mix them: `{{ __('permission.$permission[13]') ...
2018/03/05
1,679
4,071
<issue_start>username_0: I have a list: `the_list = [1, 2, 3, 4, 5]` Next I would like to sum pairs of numbers from the list, next pairs in the next step, and so on, until we get only one number at the end. The next steps would look like this: ``` [3, 5, 7, 9] [8, 12, 16] [20, 28] [48] ``` I use a loop to add ...
2018/03/05
914
3,299
<issue_start>username_0: I was trying to return data based on an ID, however, I have been running into some problems, I have tested it by manually putting in an ID which will return the values I would expect, when I attempted to do it, dynamically? I can't get it to return the relevant ID's, so I attempted to add the u...
2018/03/05
488
1,977
<issue_start>username_0: I am building an app to track BLE devices, and I have a delegate (in appDelegate) that updates the list of discovered devices over the bluetooth. I need to display this devices in a tableview, so when I discover a device I call a function in viewcontroller that refreshes the tableView. If I c...
2018/03/05
661
2,351
<issue_start>username_0: I am not able to scroll down till last row. I have to use `↓` key to reach it. **Heights are variable for each row.** Each row can show maximum 3 line of text. ```xml ``` **CSS Used** ```css .maxlines { display: inline-block; /* or inline-block */ text-overflow: ellipsis; word-wrap: ...
2018/03/05
615
2,297
<issue_start>username_0: I'd like to create an If/Then statement in VBA where if there are multiple records in the recordset one message populates, and if there is only record another message populates. Right now I'm using ``` If rst.EOF = False Then... Else ... End If ``` This is only returning the first condi...
2018/03/05
1,084
4,317
<issue_start>username_0: I have a anchor element with a RouterLink element that takes parameters. The parameters are necessary in order to navigate to the correct page. Now the router link works when I navigate the page from a different path. For instance my router module looks like this: ``` import { NgModule } from ...
2018/03/05
551
2,209
<issue_start>username_0: I use Anaconda on a Windows 10 laptop with Python 2.7 and Spark 2.1. Built a deep learning model using Sknn.mlp package. I have completed the model. When I try to predict using the predict function, it throws an error. I run the same code on my Mac and it works just fine. Wondering what is wron...
2018/03/05
503
1,977
<issue_start>username_0: I have 4 views which contains a segue(it sends data from a json and store it in a variable called email) which i'm passing it like this: A -> B(email) -> C(email) ... -> B(email) -> D(email) So what i want to do is send back the information of the segue to: C-> B D-> B Any idea how can ...
2018/03/05
530
1,709
<issue_start>username_0: I am using semantic-ui-react's Form.Input, which wraps the input in two divs. This means, ``` ``` is rendered as follows: ``` ``` I would like to get the ref for the element, so that I can call focus(). 1. My ref is set to the component when using ref='myRef' 2. ReactDOM.findDOMNode r...
2018/03/05
1,140
3,707
<issue_start>username_0: I'm trying to enable full text search on a model's column using SQLAlchemy-searchable. I followed the instructions on their [quickstart guide](https://sqlalchemy-searchable.readthedocs.io/en/latest/installation.html#quickstart) and applied the fix specified in [this github issue](https://github...
2018/03/05
223
781
<issue_start>username_0: I'd like to map method to list of instances. All instances are of class, inherited from some abstract class with method `Method()`. I can do it easily with list comprehension: ``` [o.Method() for o in list_of_instances] ``` But how to do it using `map()`? I'am trying ``` map(MyAbstractClass...
2018/03/05
621
1,746
<issue_start>username_0: I'd like to keep the columns in the order they were defined with `pd.DataFrame`. In the example below, `df.info` shows that *GroupId* is the first column and `print` also prints *GroupId*. I'm using Python version 3.6.3 ``` import numpy as np import pandas as pd df = pd.DataFrame({'Id' : n...
2018/03/05
740
2,446
<issue_start>username_0: I have some repository with a electron-js project. I'm trying to setup build and deploy to github releases from travis CI. I have next config: ``` language: node_js node_js: - "8" before_install: - cd app install: - npm install os: - linux - osx env: - TARGET_ARCH=x64 script...
2018/03/05
450
1,926
<issue_start>username_0: I was wondering how concurrency works in python 3.6 with asyncio. My understanding is that when the interpreter executing `await` statement, it will leave it there until the awaiting process is complete and then move on to execute the other coroutine task. But what I see here in the code below ...
2018/03/05
692
2,591
<issue_start>username_0: I'm trying to use the chartjs-plugin-annotation plugin with Chart.js and Angular. I have built a very stripped-down chart based on the chartjs-plugin-annotation sample code, which works fine using straight HTML and JavaScript, displaying a few points and a horizontal line: ``` var scatterC...
2018/03/05
159
548
<issue_start>username_0: Does anyone have info about support for human skeletal data on the SDK 2.0 (or lack thereof)? The Intel site is oddly silent on the matter. Would love to know if it's at least in the works. The D400 series cameras look promising.<issue_comment>username_1: In App.module.ts, on import zone , pa...
2018/03/05
1,348
5,330
<issue_start>username_0: I have csv file (600 MB) and 20 millions rows. I need to read all this data, create list of java objects out of it, and calculate some metrics on objects field, such as average, median, max , total sum and other statistics. What is the best way of doing it in Java? I tried simple .forEach loop ...
2018/03/05
1,328
5,407
<issue_start>username_0: I have two tables Client\_Type and Client\_Data ``` Client_Type Client_Data Type Description ID Type Files ------------------- ----------------------------------- A AGREEMENT 1 Student PDF-R...
2018/03/05
1,258
4,830
<issue_start>username_0: I have blank/empty values in my dataset after loading it from csv. I found out that I can do this: ``` data$col[data$col==""] <- "NA" data$col <- as.factor(data$col) ``` to change them to NA but I have nearly 200 columns so it's not the best method. I tried a for loop with all types of in...
2018/03/05
1,222
3,285
<issue_start>username_0: I'm trying to animate a 2d path, and I would like it to have a sort of "Disappearing Tail", where at any given time, it shows only the last 5 (for example) particles. What I currently have is quite far from this: ``` import numpy as np import matplotlib.pyplot as plt from matplotlib import an...
2018/03/05
1,387
4,688
<issue_start>username_0: I'm getting some odd behavior when trying to stash changes. I'm not a git expert so I'm hoping someone can shed some light on this: 1. On an up-to-date branch, I modify a tracked file. git status shows it as modified 2. git stash (responds with "Saved working directory and index state WIP on.....
2018/03/05
768
2,890
<issue_start>username_0: Based on the `ngrx/store` example (<https://github.com/ngrx/platform/blob/master/docs/store/README.md>) I would like to have 2 independent states of a counter in my Store with the keys `count1` and `count2`. They are defined in the following code: ``` // counter.ts import { Action } from '@ngr...
2018/03/05
1,162
4,131
<issue_start>username_0: I have set up a Kubernetes cluster. The cluster contains, among other things, a cluster and deployment surfacing an API webservice (based on the [`subway-explorer-gmaps-proxy`](https://github.com/ResidentMario/subway-explorer-gmaps-proxy) container). I've deployed the service externally, using...
2018/03/05
824
3,224
<issue_start>username_0: as referenced in [firebase cloud firestore](https://firebase.google.com/docs/firestore/manage-data/transactions#batched-writes) Batched writes: > > If you do not need to read any documents in your operation set, you > can execute multiple write operations as a single batch that contains > a...
2018/03/05
2,059
5,416
<issue_start>username_0: I'm trying to create a layout where the screen is divided into some number of equally-sized cells. When I fill one of the cells with content, it stretches to be larger than the other cells, even though the content is much smaller than the cell itself. Why is the cell stretching despite it bein...
2018/03/05
579
2,058
<issue_start>username_0: Is there any way how can I share one variable (object of class) over more instances of another class? Static member is not what I am looking for. I know that one variable (large object) will be shared among more instances (but not all of them). How can I do that in C++? Thanks for any help. Ex...
2018/03/05
1,689
3,265
<issue_start>username_0: I have a symmetric matrix `s` defined as: ``` s<-matrix(1:25,5) s[lower.tri(s)] = t(s)[lower.tri(s)] dimnames(s) <- list(LETTERS[1:5], LETTERS[1:5]) s A B C D E A 1 6 11 16 21 B 6 7 12 17 22 C 11 12 13 18 23 D 16 17 18 19 24 E 21 22 23 24 25 ``` In addition, there is a vector `t`...
2018/03/05
352
1,112
<issue_start>username_0: When we have an object with a numeric property that works as an accumulation. What's the best way to deal the "accumulate/create" case in ES6 javascript? The simplest way would be: ``` if (obj.foo)) { obj.foo += value; } else { obj.foo = value; } ``` or ``` obj.foo = obj.foo ? obj.f...
2018/03/05
312
1,085
<issue_start>username_0: I am writing a test console program-phonebook with Python. My IDE is JetBrains PyCharm. I have 5 functions - Search contact, Enter contact, Delete contact, All phones and Exit. My question is how can I make the program to save information in text file and when I compile it, the information will...
2018/03/05
1,753
4,021
<issue_start>username_0: I have a large data frame "table" as: ``` Year Month Model Scenario Longitude Latitude tas_month pr_month 1 2000 1 ccsm4_r1i1p1 rpc45 9.57 -84.53 24.20 40.63 2 2000 2 ccsm4_r1i1p1 rpc45 9.57 -84.53 25.05 54.20 3 2000 3 ccsm4_r1i1p1 rpc4...
2018/03/05
640
2,406
<issue_start>username_0: I am using the following code for making the service call using the Rest assured library, can you help me to resolve the build issues. There is a problem in finding the function `"equalTo"` to validate the response data. **See error below:** [![See error](https://i.stack.imgur.com/go2eK.png)...
2018/03/05
1,005
3,057
<issue_start>username_0: I'm trying to write a pandas dataframe as a pickle file into an s3 bucket in AWS. I know that I can write dataframe `new_df` as a csv to an s3 bucket as follows: ``` bucket='mybucket' key='path' csv_buffer = StringIO() s3_resource = boto3.resource('s3') new_df.to_csv(csv_buffer, index=False)...
2018/03/05
734
2,107
<issue_start>username_0: I've seen many questions related to the format and `date/time` conversion in SQL Server but none answer my concern (it is not duplicated). [For example.](https://stackoverflow.com/questions/11745958/sql-format-time-object-from-24-hour-to-12) When executing this statement: ``` select conv...
2018/03/05
729
2,808
<issue_start>username_0: when i try to run `python manage.py migrate` i run into following error [![enter image description here](https://i.stack.imgur.com/wiaWj.png)](https://i.stack.imgur.com/wiaWj.png) Upon running `python manage.py run migrations` it says no changes detected. and when i runserver it gives me warni...
2018/03/05
758
2,835
<issue_start>username_0: I added some npm packages to my ASP.NET Core 2 project in Visual Studio 2017. Now I want to use css and js files from these packages, but VS doesn't see them because node\_modules folder is outside wwwroot. What is the common practice here, how to make Visual Studio working with node\_modules? ...
2018/03/05
974
3,213
<issue_start>username_0: ``` div.gallery:hover { border: 1px solid #777; } div.gallery img { width: 40%; height: auto; padding-top: 5px; } div.desc { padding: 15px; text-align: center; color: #343434; text-transform: lowercase; font-family: "Mplus 1p"; font-size: 10px; text-align: center; letter-spacing: 1px; word-s...
2018/03/05
3,010
8,236
<issue_start>username_0: I am using cURL on Windows 7 to test a RESTful API. My data is in a JSON file that is 16,987 characters long. When I do not set the content length cURL assumes `Content-Length: 8186` and does not send the entire JSON payload. I get `Unexpected end-of-input` from the server. When I do set `-H...
2018/03/05
481
1,852
<issue_start>username_0: I have the following code that does not compile: ``` public class Outer { public Inner MyField = new Inner(); //error here: "field type is less accessible than field" private class Inner { public string Message = "Hello"; } } ``` I must be able to use the class li...
2018/03/05
542
2,156
<issue_start>username_0: I am aware of adding/managing users from GUI in NiFi i.e. a admin user and add user and groups/policies etc. This is maintained in users.xml file. * I wanted to know, can we manually add records in users.xml instead of GUI? * If yes, how is identifier tag of user derived by NiFi. For e.g. I s...
2018/03/05
354
1,283
<issue_start>username_0: Take the following template struct: ``` template struct Widget {}; ``` How to specialize it for cases where `sizeof...(Ts) == n`? E.g. `Widget<3, int, char>` should resolve to the primary template, but `Widget<3, int, char, double>` should resolve to the specialization. I've tried using the...
2018/03/05
679
2,780
<issue_start>username_0: ``` class A implements Serializable{ int a; Thread th; public int getA() { return a; } public void setA(int a) { this.a = a; } public Thread getTh() { return th; } public void setTh(Thread th) { this.th = th; } } public ...
2018/03/05
816
2,772
<issue_start>username_0: I'm trying to do something similar to centerCrop property from android ImageView. Setting the height of the imageview, and making it crop and align to center, just as centerCrop works on android. ``` Widget bindItem(BuildContext context, int index) { return new Card( child: new Column( ...
2018/03/05
506
1,773
<issue_start>username_0: I'm trying to setup Kubernetes locally. I've just run `kubeadm init`, and it's provided me with a `join` command, however it seems I can't join the cluster on the same machine. As running the provided join command results in: ``` [preflight] Running pre-flight checks. [WARNING FileExistin...
2018/03/05
1,970
7,557
<issue_start>username_0: I have not been able to locate any documentation for creating footer nav bars with Flutter/Dart. I know that "*crossAxisAlignment: CrossAxisAlignment.end*" can be used to pull content to the bottom of a column. However, I'm not sure how to render a site footer that sticks to the bottom of the s...
2018/03/05
734
2,674
<issue_start>username_0: Have a scenario to execute a stored procedure and read the return value in EF Core, that returns a single value. I tried with this code, but this does not work. I understand that `ExecuteSqlCommand` does not work for select and can be used only for update to database. ``` var test = context....
2018/03/05
3,408
11,689
<issue_start>username_0: I would like to know what type introspection I can do to detect types that assignable by simply raw memory copy? For example, as far I understand, built-in types tuples of built-in types and tuple of such tuples, would fall in this category. The motivation is that I want to transport raw bytes...
2018/03/05
1,056
3,722
<issue_start>username_0: I have a problem to understand why this doesn't work. I have recursive function who check if value in multidimensional array exists. Then I have `get_teams()` function from which I want to return only unique values. I check for unique values with my `find_value()` function but it still return a...
2018/03/05
922
3,207
<issue_start>username_0: I have this query: ``` SELECT p.ID , p.post_title , tr.trid , tr.language_code FROM ts_posts AS p LEFT JOIN ts_icl_translations AS tr ON tr.element_id = p.ID AND tr.language_code IN ('en', 'us') WHERE p.post_status='publish' AND p.post_type IN ('teaching-re...
2018/03/05
502
1,743
<issue_start>username_0: Let me lay out what some of these fields look like before I explain what I need to do... ``` |---------------------|------------------|------------------| | T1.CustID | T2.CustID | T2.ExtCustID | |---------------------|------------------|------------------| | 1234...
2018/03/05
992
3,802
<issue_start>username_0: I am working with several large Filemaker databases that contains very dirty data recorded over the course of 20+ years. Unfortunately, every database is essentially a single flat file with uncontrolled text fields with no validation or value lists of any kind. Not surprisingly different users ...
2018/03/05
918
3,060
<issue_start>username_0: I am trying to update some images in a new DB. I have read to use this SQL query: ``` UPDATE blogs SET body = REPLACE(body, 'http://www.OLDSITE.com/wp-content/uploads/', 'https://NEWSITE.nyc3.digitaloceanspaces.com/old-wordpress/'); ``` but that does nothing. I ran this query to just make ...
2018/03/05
692
2,447
<issue_start>username_0: I'm develop a theme for **WordPress** and I have created **index.php** for the original loop, and **home.php** for 4 latest posts, now I need to put a link for show all posts, how to I do that?<issue_comment>username_1: There is certainly a way to do it, you would need to write a script for it....
2018/03/05
259
985
<issue_start>username_0: Basically, the exact same question as this: [Storing Lyrics in a MySQL database](https://stackoverflow.com/questions/9350629/storing-lyrics-in-a-mysql-database) except I'm using SQL Server with a C# / asp.net front end. I don't need them searchable, I just want to retrieve them and have them ...
2018/03/05
361
1,479
<issue_start>username_0: I am new to Kotlin and I have this doAsync with a custom exception handler: ``` doAsync(exceptionHander = {e -> handleException(e)}){ //rest call } private val handleException= {throwable : Throwable -> if(throwable is HttpClientErrorException){ val response = JSONO...
2018/03/05
575
1,734
<issue_start>username_0: I have two dataframe `df1` and `df2`. ``` df1 = pd.DataFrame ({'Name': ['<NAME>', '<NAME>', '<NAME>', '<NAME>'], 'Age': [43, 21, 55, 24]}) df2 = pd.DataFrame ({'Name': ['<NAME>', '<NAME>', '<NAME>', '<NAME>'], 'gender': ['M', 'F', 'M', 'M']}) ``` I n...
2018/03/05
827
2,497
<issue_start>username_0: \*EDIT Here is what ended up kind of working. The solutions below do not run the AddProj when new row is inserted. ``` Sub Worksheet_Calculate() Dim X As Range Set X = LastCell 'The X is superflous, you could just use the LastCell variable If Sheet5.Range("A" & Rows.Count).Value < X.Value...
2018/03/05
296
1,003
<issue_start>username_0: How would you set an include file dynamically from a set variables in a php file? ``` {onload;file={tplvar.absopath}} ``` So, once the template is loaded, `$tbs->LoadTemplate($tpl)` the file should produce the html built on the file `absopath` points to.<issue_comment>username_1: If you h...
2018/03/05
330
1,178
<issue_start>username_0: ![enter image description here](https://i.stack.imgur.com/8sXgF.png) Im new to swift and going through a Tutorial on integrating AWS tools and I keep getting this error, " No such module 'AWSCore' " However, on the left, you can see these modules are downloaded and there in the pod File. My q...
2018/03/05
1,182
3,862
<issue_start>username_0: I have a simple egrep command searching for multiple strings in a text file which outputs either null or a value. Below is the command and the output. ``` cat Output.txt|egrep -i "abc|def|efg"|cut -d ':' -f 2 ``` Output is:- ``` xxx (null) yyy ``` Now, i am trying to **prefix my search te...
2018/03/05
870
3,073
<issue_start>username_0: I need to calculate accuracy in my java game. So far, I tried several methods however, everytime it either doesn't work or gives me an error "/ by zero". The initial value for bullets\_shot is zero and the formula for accuracy is enemies\_downed % bullets\_shot. How can I bypass this error whil...
2018/03/05
1,008
3,953
<issue_start>username_0: I have a react native running perfectly on iOS but does not compile in Android studio due to import issues in MainApplication and MainActivity. I followed the React Native FBSDK guidelines. In MainApplication I get "Cannot resolve symbol" on import statements: import com.facebook.react.React...
2018/03/05
1,130
3,733
<issue_start>username_0: I am building a classification model on text data into two categories(i.e. classifying each comment into 2 categories) using GloVe word embeddings. I have two columns, one with textual data(comments) and the other one is a binary Target variable(whether a comment is actionable or not). I was ab...
2018/03/05
1,028
3,494
<issue_start>username_0: ``` using (var fs = new FileStream(@"C:\Users\darren\Contacts\Desktop\staffs.txt", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)) using (var sr = new StreamReader(fs, Encoding.Default)) { string line; while ((line = sr.ReadLi...
2018/03/05
1,259
5,312
<issue_start>username_0: I started making my own php very small framework then learnt the (very) basics of the Symfony framework. A small symfony website involved over 11000 files in about 1000 directories. I have gone back to my own framework and increasingly resist creating new files. I am committed to creating DRY,...
2018/03/05
667
2,454
<issue_start>username_0: I'm trying to work out how I use the Facebook tracking pixel with my angular project. I have added the base pixel into my index.html but I want to fire an event from the javascript, how do I fire this ```js fbq('track', 'CompleteRegistration'); ``` Angular will not compile when I have t...
2018/03/05
765
2,859
<issue_start>username_0: I am trying to add event listener on dynamically generated switch buttons. Each button in different table row. It works fine when there is only one switch button on page, but when there are 2 and I click on second, for some reason event Target is still coming like from the first button. Belo...
2018/03/05
678
2,309
<issue_start>username_0: I'm running Bash 4.4.19, under Fedora 27, and I have a simple script: ``` #!/bin/bash TESTENV="Hello" echo "$TESTENV" if [ -v $TESTENV ]; then echo "Yup" fi echo "Done" ``` When I run this, it prints: ``` Hello ./myscript: line 3: [: Hello: binary operator expected Done ``` So, I add ...
2018/03/05
1,307
4,376
<issue_start>username_0: I am trying to dynamically find a directory the be used programmatically later on in a script. The problem that I am having is accounting for white space which may or may not be there. Using the following example because it outputs three strings separated by spaces (paths in this case). Let's ...
2018/03/05
452
1,650
<issue_start>username_0: I'm making my React app a SPA and adding `React Router 4` with `react-router-dom` to it. Currently, my entry point to my home component looks like this: ``` render ( , document.getElementById('app') ); ``` For another module, I had a different entry point and instead of the component,...
2018/03/05
738
2,713
<issue_start>username_0: tl;dr I have a DataGrid, and I'm binding the row headers. However, I can't get this to work with the `StringFormat` property on the binding. I've got a WPF DataGrid set up like this: ``` <Setter Property="Header" Value="{Binding Lane, StringFormat=Lane {0:0}}"/> ``` But no matter what I d...
2018/03/05
724
2,190
<issue_start>username_0: I am trying to compute the number of sublists each term appears in the list but I am stuck at the very first step. For example, ``` collection = [['a','b','b','c','d','e','f'],['b','b','d','f']] ``` It should return me (a,1) (b,2) (c,1) (d,2) (e,1) (f,2) I am able to iterate through the col...
2018/03/05
566
1,783
<issue_start>username_0: So, I have two functions: **First function:** ``` function FunctionExecutor { param ( $function ) } ``` **Second function is this:** ``` function StartSSHsession { Write-Host "Hi" } ``` Question: How do I execute the StartSSHSession by passing it into FunctionE...
2018/03/05
898
3,136
<issue_start>username_0: Suppose we have nested dictionary given below. We want, ultimately, to make a list of all of the nested named fields that appear in each dictionary. Concatenate nested field names using a period '.' to defined named fields for nested records. Present the list in alphabetical order. For example,...
2018/03/05
689
2,501
<issue_start>username_0: I have a filterable products page that has\_many variations using the [pg\_search](https://github.com/Casecommons/pg_search) gem and it works well. I am tryin to show the total count of the search results as part of my results display. What I've done as you can see below partially works--it sho...
2018/03/05
1,059
3,899
<issue_start>username_0: I have a model `class Person` which implements the `Comparable` interface and a `compareTo(Personne o)` method which returns the proper int depending on the person's age. **Usecase:** I want to check if all the persons inside the collection have the same age with an iterator What I have so f...
2018/03/05
1,952
4,643
<issue_start>username_0: My data is in a tall format. I'm interested in producing line graphs using ggplot for each region. However, I keep receiving errors that the aesthetics must either be length 1 or the same as the data. Hard-coded solution: -------------------- ``` date_q <- HPF$date[1:167] CumulativeSubset_re...
2018/03/05
1,846
7,375
<issue_start>username_0: Say I have a simple `User` model: ``` class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable belongs_to :company end ``` As well as a model for companies: ``` class Company < ApplicationRecord ...
2018/03/05
679
2,451
<issue_start>username_0: Entry level comp sci major here.. I'm certain this question likely has an obvious answer, but I simply can't figure out why the following code produces an infinite loop and it's driving me insane. I understand that `Math.random()` returns a `double` value which when multiplied by 10 moves the d...
2018/03/05
590
1,943
<issue_start>username_0: I've used `source_group` dozens of times with C++ Projects to organize my files, yet for C# Projects this does not seem to work: ``` set (FOO myfoo.cs) set (BAR mybar.cs) set (FILES App.xaml App.xaml.cs MainWindow.xaml MainWindow.xaml.cs ) set (PROPERTIES ) add\_executable( ${CMAK...
2018/03/05
587
2,049
<issue_start>username_0: I have the following set in trac.ini: ``` [components] acct_mgr.admin.accountmanageradminpanel = enabled [inherit] plugins_dir = ../../plugins ``` and in a global plugins folder I have TracAccountManager-0.5.dev0-py2.7.egg. However, I don't see the account manager admin panel still. Puttin...
2018/03/05
486
1,702
<issue_start>username_0: When I perform a "Cells.Find" after selecting a column the search unexpectedly leaves the selected column. I would expect the Find to remain in the column I selected just like when using the 'Find" function in Excel. ``` 'Select first row of data set locations ActiveWorkbook.Worksheets("She...
2018/03/05
505
1,686
<issue_start>username_0: I have a dictionary called `spectradict` which is composed of 5 different keys (multiple values per key), and I'd like to multiply each value under 4 of the keys by some constant A. I've figured out how to multiply all the values (under all the keys) by the constant: ``` spectradict.update((x,...
2018/03/05
2,171
7,648
<issue_start>username_0: My model is: ``` class AndroidOffer(models.Model): name = models.CharField(max_length=128, db_index=True) # ... countries = models.ManyToManyField(Country) ``` And the following code (I skipped previous filtering): ``` active_offers = active_offers.filter(countries__in=[country]...
2018/03/05
542
1,388
<issue_start>username_0: I created a numpy array of shape (4,3,2); I expected following code can print out a array shaped 4 X 3 or 3 X 4 ``` import numpy as np x = np.zeros((4,3,2), np.int32) print(x[:][:][0]) ``` However, I got ``` [[0 0] [0 0] [0 0]] ``` Looks like a 2 X 3? I am really confused on numpy ma...
2018/03/05
1,007
2,518
<issue_start>username_0: I'm trying to make a graph like this using D3 and React Native [![Graph](https://i.stack.imgur.com/TxEFP.png)](https://i.stack.imgur.com/TxEFP.png) Right now I'm trying to define my Y axis using a list of start and end dates. I'm making my yScale using the code: ``` const yScale = scaleTime...
2018/03/05
553
1,699
<issue_start>username_0: I'm developing a program to draw speed and power curves as a function of time, my only problem is that i do not know how to translate the equation: **dt / dv** into a program. Here is the program: ``` // Caractéristique du véhicule Mv = input("Mv = ") // la masse de la voiture S = input("S ...
2018/03/05
1,012
4,268
<issue_start>username_0: I have NET Core 2 Web API application. During the process i have to invoke Client A's API to get some data. So i am using HttpClient to invoke it. Client A also requires me to pass userid and password in header. So instead of directly injecting `HttpClient` i have wrapper around `HttpClient` s...
2018/03/05
395
1,572
<issue_start>username_0: I'm trying to build a ionic1 in Xcode for iOS. The problem is any css, html, js changes it doesn't take effect when I rebuild the project. I notice after 10-15 rebuilds/Xcode restarts I see eventually some edits, not sure what causes that. Is that a known Xcode/Ionic issue? How can I solve?<i...
2018/03/05
354
1,461
<issue_start>username_0: Is there a way to set up a git hook to alert a developer when someone has commented on their pull request. It is frustrating that I stumble on a comment days after it has been posted<issue_comment>username_1: Probably just need to clean your build folder, `Cmd + Shift + K`, or deleting derived ...
2018/03/05
553
1,942
<issue_start>username_0: I want to know how to convert a text file consisting of strings into a dictionary. My text file looks like this: `<NAME>, 45th US President, 71 years old Barack Obama, 44th US President, 56 years old <NAME>, 43rd US President, 71 years old` I want to be able to convert that text file into a ...
2018/03/05
568
1,968
<issue_start>username_0: ``` class Animal def initialize(noise) @noise = noise end def say puts "#{self.class} does #{@noise}" end end dog = Animal.new("Woof Woof") cat = Animal.new("Meow Meow") dog.say cat.say ``` How can I print `dog does woof woof` instead of `Animal does Woof ...
2018/03/05
561
1,939
<issue_start>username_0: I would like to retrieve a belongs\_to association and acquire a database lock on its object. ``` > character.team.lock! ActiveRecord::Base -- Team Load -- { :sql => "SELECT `teams`.* FROM `teams` WHERE `teams`.`id` = 1 LIMIT 1" } ActiveRecord::Base -- Team Load -- { :sql => "SELECT `teams`....
2018/03/05
420
1,262
<issue_start>username_0: This is the code i've wrote so far: ``` def first_word(text: str) -> str: while text.find(' ') == 0: text = text[1:] while text.find('.') == 0: text = text[1:] while text.find(' ') == 0: text = text[1:] while text.find('.') == 0: text = text[1:] ...
2018/03/05
510
1,402
<issue_start>username_0: ``` #include #include #include char \* compress(char \*input, int size){ char \*inputa; char compressedString[100]; inputa = (char\*)malloc(sizeof(size)); snprintf (inputa, size, "%s", input); int i = 0; int x; int counter; while(i < size){ counter = 1; x = i; while (inputa[x] == ...
2018/03/05
994
3,059
<issue_start>username_0: I have this array: ``` rows = [ [ 89, 18, 9 ], [ 1903, 3, 4 ], [ 3, 1, 800 ] ]; ``` It should look like this: ``` [ [ 89, 1903, 3 ], [ 18, 3, 1 ], [ 9, 4, 800 ] ] ``` And the code, that is working, looks like this: ``` rows[0].map((_, columnIndex) => rows.map( row => row[col...
2018/03/05
1,126
3,575
<issue_start>username_0: I have a `data frame` in `pyspark`. This data frame has say some columns with special characters. ``` cols = df.schema.names cols ['abc test', 'test*abc', 'eng)test', 'abc_&test'] reps = ((' ', '_&'), ('(', '*_'), (')', '_*'), ('{', '#_'), ('}', '_#'), (';', '_##'), ('.', '_$'), (',', '_$$')...