date stringlengths 10 10 | nb_tokens int64 60 629k | text_size int64 234 1.02M | content stringlengths 234 1.02M |
|---|---|---|---|
2018/02/25 | 989 | 2,766 | <issue_start>username_0: My excel sheet has a column of percentages stored with the percent symbol (eg "50%"). How can I coerce `pandas.read_excel` to read the string "50%" instead of casting it to a float?
Currently the `read_excel` implementation parses the percentage into the float 0.5. Additionally if I add a `con... |
2018/02/25 | 1,583 | 4,597 | <issue_start>username_0: This isn't a duplicate because I have checked everything before this post on this site. I think I have managed to do the first two bullet points. The first one I will do through a string but I am willing to change that if you know another way. The 2nd one is using comma seperators for the $'s. ... |
2018/02/25 | 697 | 2,242 | <issue_start>username_0: I have `@Embeddable` class for id:
```
/**
* @ORM\Embeddable()
*/
final class Id
{
/**
* @ORM\Id()
* @ORM\Column(type="string")
*/
private $id;
//getters, setters, etc
}
```
And two classes that have `@ManyToOne` relationship:
```
/**
* @ORM\Entity()
*/
final... |
2018/02/25 | 1,168 | 3,561 | <issue_start>username_0: I've recently picked up makefiles and am trying to automate my build process. For this makefile, I want it to find every xxx/src/xxx.c source file and build an equivalent xxx/obj/xxx.o object for each. So every obj folder mirrors the layout of a src folder.
This is working as intended but only... |
2018/02/25 | 699 | 2,209 | <issue_start>username_0: I work on the code that will calculate Array Formula basing on how many records is in the column N:N that is 11 columns earlier (offset 11). I want to use the formula with array that will use the parallel row from the column N:N and copy down until the last record in column N:N exist. However, ... |
2018/02/25 | 1,890 | 5,476 | <issue_start>username_0: It is just really hard to understand from a standard description, so:
For instance, I'm trying to set a k-th position of some list (ls) to a specific value. Even have a function of my own, that gives acces to k-th elt.
```
(defun kth-elt (lst k)
(cond ((> 0 k) nil)
((equal 0 k) (car lst))
... |
2018/02/25 | 1,481 | 5,458 | <issue_start>username_0: Hello i am trying to create a file that reads from a excel file 125000 ids and usernames which have to be delimited, create tokens based on that and then creating confirmations links. The problem is that at a certain point in time (after more than 30 000 iterations) the index goes out of range ... |
2018/02/25 | 1,153 | 2,455 | <issue_start>username_0: Im trying to pass result from database to js variable as array:
```
$test_min_max_list = TestsMinMax
::join('results', 'tests_min_max.id', '=', 'results.test_result_id')
->select('created_at','min','avg','max')
->where([
['results.user_id', '=', $use... |
2018/02/25 | 725 | 1,821 | <issue_start>username_0: I want to reshape a pandas DataFrame from two columns into one row:
```
import numpy as np
import pandas as pd
df_a = pd.DataFrame({ 'Type': ['A', 'B', 'C', 'D', 'E'], 'Values':[2,4,7,9,3]})
df_a
Type Values
0 A 2
1 B 4
2 C 7
3 D 9
4 E 3
df_b = df_a.pivot(columns='Type... |
2018/02/25 | 11,742 | 39,303 | <issue_start>username_0: I have a **parent div that creates a grey layer** and a **inner child div that contains the text which should be scrollable**.
**Problem:** the child div doesnt consider the max-height 100% and thsu overruns the parent div and doesnt become scrollable.
**Note:** *I know it can be fixed if t... |
2018/02/25 | 276 | 964 | <issue_start>username_0: I need to use a ngClass to make a notification badge behavior on my web page.
If i use this:
```
```
I'm trying to make some like this:
```
```
But of course, it doesn't work.
How can I make this badge show the number of trips only when tripsCount greater than zero with Angular?<issue_... |
2018/02/25 | 1,173 | 4,672 | <issue_start>username_0: I'm trying to fill the database with my StoreInitializer, but tables are empty, I'm using Entity Framework Core and ASP.NET Core, I want to configure my Initializer for using **Update-Database** in Package Manager Console. I followed this tutorial <https://learn.microsoft.com/pl-pl/aspnet/core/... |
2018/02/25 | 341 | 1,175 | <issue_start>username_0: How can I hide the output of any command in the form `:!command` in Vim. I don't want to get any messages from Vim after running this command (like `Press ENTER or type command to continue`) also. I want shell commands to run in background completely.<issue_comment>username_1: "I want shell com... |
2018/02/25 | 640 | 2,575 | <issue_start>username_0: I'm adding tests on a project and improving coverage. I would like to know how can I test a module definition (mymodule.module.ts file) in NestJs.
In particular, I'm testing a main module that imports other modules, one of them inits a db connection, this means that I need to mock the service ... |
2018/02/25 | 538 | 2,116 | <issue_start>username_0: I have this screen shot showing how I am logged in and showing the output of two select statements. I see the server name and instance name but what is the name in the browser tree at left? " SQLSERVERINSTAN " is the name of the computer that I gave when I installed the O/S. What is the differe... |
2018/02/25 | 944 | 3,922 | <issue_start>username_0: I'm a complete beginner in mongodb . Actually I'm trying to find all the documents containing null or nothing for example documents like `{
"_id" : "abc"
}` for deleting them from collection.
But even after searching a lot of `SO` questions I couldn't get any solution .So, how can I do this ?... |
2018/02/25 | 1,098 | 4,435 | <issue_start>username_0: I have a loop throwing multiple go routines, they call a function that makes a http get petition and calculate and object.
I want to recover the result of all those routines.
I tried using channels, but hey are empty, even if I force wait for all the routines to be done.
This is the code that... |
2018/02/25 | 2,532 | 6,460 | <issue_start>username_0: I get this json response from a post:
```
{access_token: "<KEY>", expires_in: 300, refresh_expires_in: 1800, refresh_token: "<KEY>", token_type: "bearer", …}
access_token
:
"<KEY>"
expires_in
:
300
not-before-policy
:
0
refresh_expires_in
:
1800
refresh_token
:
"<KEY>"
session_state
:
"9b81d5... |
2018/02/25 | 348 | 1,103 | <issue_start>username_0: Here's my code:
```
var never = [1,2,3,4,7];
function please () {
for (var i = 0; i < never.length; i++) {
document.getElementById("more").innerHTML = "" + never[i] + "";
}
}
```
I have a button in my HTML that invokes this function but it only creates a button for the last item (7)... |
2018/02/25 | 492 | 1,367 | <issue_start>username_0: I have created a express App in Node.js
* express v4.16.2
* mysql v2.15.0
and i use MySQL as a Document Store
```
Columns
id: integer
value: JSON
```
when i query the MySQL Database via mysql I get the result:
```
RowDataPacket {
id: '1',
date: '2018-02-25T17:48:52.000Z',
value: '{"na... |
2018/02/25 | 838 | 2,151 | <issue_start>username_0: Given
```
a = [('AB', 11), ('CD', 12), ('EF', 13), ('GG', 1332)]
```
and
```
b = [('AB', 411), ('XX', 132), ('EF', 113), ('AF', 113), ('FF', 113)]
```
If `n = 3`, I want to only consider the top 3 elements in each lists and return tuples that have same first element (the string).
For ex... |
2018/02/25 | 907 | 2,654 | <issue_start>username_0: I would like to create types when being given **only strings** of their names. Here it's obvious:
```
Type t = System.Type.GetType("System.Double");
```
But when I try to get type from another namespace, like `System.Drawing`, the above method won't return the correct type. Working solution ... |
2018/02/25 | 888 | 2,487 | <issue_start>username_0: I still in the learning process but I think spending over 5 hours on a problems is sufficient time to start asking questions! Unsure if the post title accurately explains the issue? See the attached image.
Trying to change min-height: 100px (basically get rid of the large gap between question... |
2018/02/25 | 352 | 1,199 | <issue_start>username_0: I'm trying to run a random forest on a set of variables. Most of the variables are categorical (factor), and some have a lot of values. My dataset has ~1500 variables, and i'll like to drop those which have >50 categories.
Is it possible to do this in R?
Edit: I've been trying to codify this... |
2018/02/25 | 669 | 1,711 | <issue_start>username_0: I have a dictionary of the following format:
```
data={'city':np.array(['chicago','champaign','kansas city','dallas','champaign','chicago']),
'state':np.array(['IL','IL','KA','TX','IL','IL']), 'transaction_dt':np.array(['1-1-2018','2-1-2018','3-1-2018','7-1-2018','1-1-2018','2-1-2018'])}
``... |
2018/02/25 | 693 | 1,968 | <issue_start>username_0: ```js
var element;
function getElement(elem, functionToCall) {
if (elem.length === undefined) {
elem = [elem]
};
element = elem;
for (var i = 0; i < element.length; i++) {
functionToCall
}
};
function changeElementStyle() {
element[i].style.color = "red"
}
get... |
2018/02/25 | 430 | 1,374 | <issue_start>username_0: I have a text in a file with multiple lines. I would like to create one big list, with each line as a seperate list inside. Within these lists each word should be a string. This is my code at the moment, I am failling to split the strings within the lists.
```
f = open("test.txt","r")
for li... |
2018/02/25 | 625 | 2,044 | <issue_start>username_0: I want to create a function that uses an algorithm to search for a primary key. The algorithm simply tests whether the first column has all unique values, if not, it tests the first and second column, and so on until there are no more columns. The output is "PRIMARY KEY (...)", where ... is the... |
2018/02/25 | 794 | 1,935 | <issue_start>username_0: I have to sort these words in to a sentence.
This is my list, with the numbers:
```
sms=['Szentírás ', 'bölcs ', 'a ', 'már ', 'szükséges ', 'mondhat ', 'biztosak ', 'a ',
'feladata, ', 'Mivel ', 'ellent ', 'a ', 'érzéki ', 'azokkal ', 'következtetésekkel, ',
'a ', 'vagyunk ', 'a ',... |
2018/02/25 | 2,061 | 7,989 | <issue_start>username_0: I'm developing an app in Groovy.
I'm using the helpful "AST" tag `@Slf4j` - which adds a new property to your class, `log`. I have configured this to be a `ch.qos.logback.classic.Logger`.
Now I want to test (using Spock) that an `error` level message is logged. NB the `start` method calls the... |
2018/02/25 | 703 | 2,229 | <issue_start>username_0: I have a form, and I want to be able to edit any part of that form by double clicking it. So going from this:
```html
| Name | Email | Phone |
| --- | --- | --- |
| <NAME> | <EMAIL> | +12345678 |
```
How can I by double-clicking an element, transform it to an input element?
For example: if ... |
2018/02/25 | 722 | 2,393 | <issue_start>username_0: I'm trying to use a code to compare the image's path that is displaying to the relative path independent of the url, but .pathname isn't working
```
change images
var img=document.getElementById('img').src;
function change(){
if(img.pathname='img1.png'){
var next='img2.png';
document.g... |
2018/02/25 | 893 | 1,555 | <issue_start>username_0: I looked through the numpy documentation, but I don't know the exact terminology of the thing I want to do. I want to do the following:
```
a=np.array([[0,1,2],
[3,4,5],
[6,7,8],
[,9,10,11]])
b=np.sparse_tiles(a,(1,2),dtype=a.dtype)
b
array([[0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,1,0,0,2],
[0,0,0,0,0... |
2018/02/25 | 766 | 1,525 | <issue_start>username_0: I have a data frame that looks like this:
[](https://i.stack.imgur.com/4dCkK.jpg)
How can I make a new data frame that contains only the minimum 'Time' values for a user on the same date?
So I want to have a data frame with ... |
2018/02/25 | 854 | 2,020 | <issue_start>username_0: I'm trying to get familiarized with for loops right now for school and and learning the syntax right now. I have a couple questions. If I am going to initialize variables in the loop how can I ask the user for them to input the variable values before they are in the for loop? Here is the code I... |
2018/02/25 | 906 | 2,439 | <issue_start>username_0: I'm looking to generate all possible binary vectors of length `n` in R. What is the best way (preferably both computationally efficient and readable code) to do this?<issue_comment>username_1: Inspired by [this question](https://stackoverflow.com/questions/27826508/create-all-possible-combiatio... |
2018/02/25 | 1,227 | 3,759 | <issue_start>username_0: I am quite new to working with GUI in Java. I was trying several things, for example, adding a new entry to a JComboBox or changing a JButtons caption using the following commands in the run method:
pwSelection.addItem("Name 1");
dec\_btn.setText("Example");
protected JComboBox pwSelection =... |
2018/02/25 | 934 | 2,490 | <issue_start>username_0: ```
$statement = $pdo->prepare("UPDATE config SET (name, value) VALUES(:name, :value) WHERE id = 1");
```
Hello, i need your Help, i know her is a syntax error but i dont know what is the syntax error.
Can you Help<issue_comment>username_1: Inspired by [this question](https://stackoverflow.c... |
2018/02/25 | 1,193 | 4,553 | <issue_start>username_0: I'm using a WKWebView with a content-editable div as the core of a rich-text editor, and would like to modify the top toolbar above the keyboard—the one that contains the autocorrect suggestions and formatting buttons. (Not sure if this counts as an input accessory view or not).
I've found a f... |
2018/02/25 | 1,081 | 4,089 | <issue_start>username_0: Suppose i have the following array:
```
In [1]: k
Out[1]:
array([[0],
[1],
[2],
[7],
[4],
[5],
[6]])
```
I would like to check whether each row of k is smaller than the next.
I tried the following but it did not work:
```
In [2]: k[:,0]
```
What... |
2018/02/25 | 1,039 | 3,062 | <issue_start>username_0: This might be a fundamental misunderstanding on my part, but I would expect `pandas.Series.str` to convert the `pandas.Series` values into strings.
However, when I do the following, numeric values in the series are converted to `np.nan`:
```
df = pd.DataFrame({'a': ['foo ', 'bar', 42]})
df... |
2018/02/25 | 1,001 | 3,383 | <issue_start>username_0: Running on Google Cloud platform / Container Engine - How do I set it up to point to this Ingress in the following?
I have installed Nginx-ingress on Kubernetes with Helm and it works for the `default backend - 404`.
I want to be able to use different http uri path, like `/v1`, `/v2` and othe... |
2018/02/25 | 885 | 2,627 | <issue_start>username_0: 'm currently writing a C program that prompts a user to enter five numbers and to display the maximum number. So here's what i came up with
```
int max_num(float num_arr[])
// this is a number array
{
int max = 0;
for (int k = 0; k <= 4; k++)
{
max = num_arr[0];
... |
2018/02/25 | 725 | 2,193 | <issue_start>username_0: I have two classes:
```
#include
#include
#include
#include
#include
#include
#include
using namespace std;
enum class Programm{Koch, Normal, Bunt, Fein};
class KleidSt {
private:
string bezeichnung;
int gewicht;
Programm Pflegehinweis;
public:
KleidSt(string bezeichnung, int gew... |
2018/02/25 | 754 | 3,379 | <issue_start>username_0: I want to have more control over the logging in and out, via custom controller and login page.
My SecurityConfiguration code currently looks like this:
```
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfiguration extends WebSecuri... |
2018/02/25 | 1,359 | 4,261 | <issue_start>username_0: Consider the code below:
```
q)tab:flip `items`sales`prices!(`nut`bolt`cam`cog;6 8 0 3;10 20 15 20)
q)tab
items sales prices
------------------
nut 6 10
bolt 8 20
cam 0 15
cog 3 20
```
I would like to duplicate the prices column. I can write a query like this:
```
q)u... |
2018/02/25 | 998 | 3,572 | <issue_start>username_0: I'm having trouble getting Firebase Firestore to work with the basic create-react-app boilerplate. Does anyone have a working sample?
The [Get Started](https://firebase.google.com/docs/firestore/quickstart) doc only explains how to set it up with `require` statements, whereas I'd like to use E... |
2018/02/25 | 1,351 | 5,027 | <issue_start>username_0: I am working on a user structure where a user can have parents and children that consist of user objects. I have been trying to get the following to work in multiple different ways in SQLAlchemy and Flask.
Here is an example of how I want to structure this:
```
UserTable
id | name
---+-----
1... |
2018/02/25 | 1,022 | 3,154 | <issue_start>username_0: So I just got started with the win32 graphics since I wanted to work on an UI for an app I'm making. I basically wanted to draw a border on it, but for some reason the line is only drawn on the top and the left side. If anyone knows what's up, it'll be helpful.
code:
```
bool bRet = false;
HP... |
2018/02/25 | 936 | 3,031 | <issue_start>username_0: Before you mark my question as duplicate, i have tried solutions in other post but didnt work. This what i have
```
Clientes Cliente1 = new Clientes(1,PinturasCliente1,ColoresCliente1);
Clientes Cli= new Clientes(1,PinturasCliente1,ColoresCliente1);
ArrayList ListaClientes = new ArrayList();
A... |
2018/02/25 | 767 | 3,047 | <issue_start>username_0: I am using Kotlin and am trying to throw an Exception on a specific method invocation but always get the following error
```
Checked exception is invalid for this method!
Invalid: exceptions.ServiceException
```
This is the test
```
val client : IClient = Mockito.spy(Client(Cnf("https://:re... |
2018/02/25 | 581 | 1,805 | <issue_start>username_0: In Elixir, I have a list of nested maps, each with the same basic structure - for example:
```
nested_map_list = [
%{foo: %{test: "Hi"}},
%{bar: %{test: "Hello"}},
%{baz: %{test: "Hey"}}
]
```
So they each have a different key in the upper level, but the same key in the nested ma... |
2018/02/25 | 404 | 1,516 | <issue_start>username_0: I am really disappointed about how much time I have spent trying to find out how to import data from google storage into a datalab project in jupyter. I have just been using floydhub and colabratory and these are so much more straight forward. Why does colabratory and datalab have a different A... |
2018/02/25 | 566 | 1,967 | <issue_start>username_0: I'm using the new Azure ML Workbench and set of model management services doing a regular Python (not Pyspark) project. I have a conda\_dependencies.yml file which looks like this:
```
name: project_environment
channels:
- conda-forge
dependencies:
# The python interpreter version.
# Cu... |
2018/02/25 | 933 | 3,272 | <issue_start>username_0: When I went through **Pipes** documentation I noticed that I can't make `@IsInt()` validation for **application/x-www-form-urlencoded** request correctly, cause all values which I passed I receive as string values.
My request data looks like this
[.
Do I miss anything?<issue_comment>username_1: Heap pop is indeed `O(logn)` complexity.
What you are missing is that pop from a heap is **not** like "removing the first e... |
2018/02/25 | 976 | 3,278 | <issue_start>username_0: I have this function to check if a string contains three or more lowercase letters.
```
def lowerCaseValid(word):
lowCharList = ['abcdefghijklmnopqrstuvwxyz']
i = 0
flag = 0
while i <= len(word):
j = 0
while j <= len(lowCharList):
if lowCharList[j] == word[i]:
flag ... |
2018/02/25 | 261 | 850 | <issue_start>username_0: I was having a problem with the strings.Builder type in GO.
Attempted to run the example code verbatim and GO still responds with:
>
> undefined: strings.Builder
>
>
>
Any clues as to what the problem can be, there's been not other problems at all.
```
package main
import (
"fmt"
... |
2018/02/25 | 528 | 1,534 | <issue_start>username_0: Im using Angular 5 with typescript 2.7.1.
In typescript i have a custom type
```
arr: {id: string; name: string; }[];
```
and i want to push an element to the array, and have tried the following:
```
this.arr.push({id: "text", name: "text"})
```
ERROR TypeError: Cannot read property 'pus... |
2018/02/25 | 1,710 | 4,796 | <issue_start>username_0: I'm trying to load getorgchart using loadFromJSON, but I'm getting the following message: "Cannot read property 'children' of undefined". Here is my code:
```
var peopleElement = document.getElementById("people");
var orgChart = new getOrgChart(peopleElement, {
primaryFields: [... |
2018/02/25 | 343 | 1,193 | <issue_start>username_0: I have a custom mvc app which has an index controller and an index model.The url for controllers in this app is $url[0]. The system is designed to redirect to index when the value for controller($url[0] is empty. e.g., When the url is `http://localhost/Test/` The system should automatically red... |
2018/02/25 | 1,434 | 5,762 | <issue_start>username_0: After going through Java documentation I understand that a field declared with 'static' keyword is class variable (or static field) and similarly when using 'static' during method declaration, is a static method (or class method). Class variable and Class methods are reference by class name its... |
2018/02/25 | 654 | 2,352 | <issue_start>username_0: this function working good but it's a little bit slow
**html**
```
| | | |
| --- | --- | --- |
| 10 | | 0 |
```
**javascript**
```
function CountItemTotal() {
$("span#ItemTotal")
.each(function () {
$(this).text(
+$(this)
... |
2018/02/25 | 480 | 1,702 | <issue_start>username_0: If `item['business_name']` is equal to this `[]` or `None`. I want to delete it from query results.
Instead it outputs this which is what i don't want, i only want query results that have a business name
>
> `'business_name': [],`
>
>
>
this is what i have so far
```
class Item(scrapy.I... |
2018/02/25 | 562 | 1,680 | <issue_start>username_0: I'm seeking to configure the best model for measuring implicit feedback given my nested dictionary of unique users and the number of plays per artist listened to. I've tried a few values but they appear only cosmetic, and not measurable.
Sample data:
```
users ... |
2018/02/25 | 936 | 3,440 | <issue_start>username_0: I am following [this](https://isaacchanghau.github.io/2017/06/27/Hadoop-Installation-on-Mac-OS-X/) tutorial to install Hadoop in my computer. After finishing the installation, when I try to launch Hadoop using this command `./start-dfs.sh`, it returns me the following:
```
U:sbin U$ ./start-d... |
2018/02/25 | 877 | 2,585 | <issue_start>username_0: How can I round an integer *down* to the nearest multiple of 3 using PHP? And have <3 be 0.
For example:
4 becomes 3
10 becomes 9
9 becomes 9
8 becomes 6
And so on...<issue_comment>username_1: Assuming `$x` is your input:
```
print $x-$x%3;
```
Upvotes: 2 <issue_comment>username_... |
2018/02/25 | 388 | 1,760 | <issue_start>username_0: Is it possible to exclude one or more properties of a table when created in the store or an entry is saved in the indexeddb?
E.g. the following table description (Typescript) has four properties where only the first three shall be used for creation and adding new entries:
```
interface IConta... |
2018/02/25 | 515 | 2,175 | <issue_start>username_0: I have the app below (simplified example). Basically I would like that, when I turn on the app, if the reactive value is equal to `""` than I do not want that the `activeButton` appears on the UI. At the moment is appearing but without label. How can I do in this case? Thank you for your help!
... |
2018/02/25 | 624 | 2,582 | <issue_start>username_0: I'm solving a problem where I have levels in a binary tree. I'm given a level, then a position.
The second level is `[True, False]`.
The third level is `[True, False, False, True]`.
The fourth `[True, False, False, True, False, True, True, False]`, and so on.
To solve the problem, I may ne... |
2018/02/25 | 760 | 2,122 | <issue_start>username_0: I'm trying to do boolean indexing with a couple conditions using Pandas. My original DataFrame is called `df`. If I perform the below, I get the expected result:
```
temp = df[df["bin"] == 3]
temp = temp[(~temp["Def"])]
temp = temp[temp["days since"] > 7]
temp.head()
```
However, if I do thi... |
2018/02/25 | 600 | 2,078 | <issue_start>username_0: I need to delete some controls in TableLayoutPanel. The code below works well for Buttons:
```
private void RemoveButtons()
{
for (int i = TablePanel.Controls.Count - 1; i >= 0; i--)
{
if (TablePanel.Controls[i] is Button)
TablePanel.Controls[i].Dispose();
}
}
... |
2018/02/25 | 392 | 1,513 | <issue_start>username_0: Is there a way create a tiled background using a repeating image without it stretching and changing size?
I have a pattern which I am using as a background. However I want this to display consistently throughout the site. Currently the pattern repeats correctly, but stretches depending on the ... |
2018/02/25 | 548 | 2,164 | <issue_start>username_0: Occasionally, when I go to connect to my Azure SQL Server through either Power BI or SSMS, I get the following error:
>
> A connection was successfully established with the server, but then an
> error occurred during the pre-login handshake. (provider: TCP
> Provider, error: 0 - The semapho... |
2018/02/25 | 354 | 1,414 | <issue_start>username_0: What is the most elegant way to set all the values in an already defined array to `true` or `false`? I am thinking of not using a `for` loop.
I am currently using the idea of reinitializing the array with only `TRUE` values and I am curious if better methods exist.<issue_comment>username_1: Er... |
2018/02/25 | 1,152 | 4,827 | <issue_start>username_0: Am developing a mini app in Symfony 3.4. Am putting together an authentication process using Guard. I have created a class called LoginFormAuthenticator which extends AbstractFormLoginAuthenticator.
Receiving error:
>
> *Cannot autowire service "app.security.login\_form\_authenticator": argu... |
2018/02/25 | 302 | 1,144 | <issue_start>username_0: I want to shorten the function, but I can not figure out how to do it.
String too long. How to fix this code?
```
def get_closest_bar(data, user_latitude, user_longitude):
return min(
data['features'],
key=lambda x: sqrt((x['geometry']['coordinates'][1] - user_latitude)**2... |
2018/02/25 | 1,305 | 4,054 | <issue_start>username_0: I have a class called `foo_t` that has a member called `bar` which could be any one of the types `std::string`, `int`, `std::vector`, etc. I would like to be able to ask `foo_t` which type `bar` has been assigned to. I decided to use `std::variant`.
I've written a solution, but I'm not sure if... |
2018/02/25 | 661 | 2,347 | <issue_start>username_0: This code inside async function, does not give the expected result:
```
var result = await $.when( $.get('/api/1'), $.get('/api/2') );
```
with one request, result will be the output I expect (the response text).
However, with these two requests, the returned `result` is an array which does... |
2018/02/25 | 848 | 2,990 | <issue_start>username_0: I'm in a beginner Python class and my instructor wrote pseudocode for us to follow. I've followed it to a T (I feel) and have been getting bugs no matter how I try changing the program. I'd rather have my mistake quickly pointed out than spend more time mucking about. This is written in Python ... |
2018/02/25 | 625 | 2,632 | <issue_start>username_0: I have implemented the strategy pattern inside the class to perform an execution according to the input. It works fine and is called by a simple way.
```
public class MyObject {
private final Object input;
private final Strategy strategy;
public MyObject(final Object input, final Strategy st... |
2018/02/25 | 552 | 1,922 | <issue_start>username_0: I can use the `if (-e $file)` in perl script to tell if a file exists in linux or not.
I can run `p4 fstat $file` in linux to tell if a file exists in perforce depot.
But how do I use perl script to check if a file is in perforce depot?<issue_comment>username_1: You can run a command from... |
2018/02/25 | 1,325 | 4,456 | <issue_start>username_0: I would like to have a table which some of rows include another tables. My `html` file is as:
**HTML: Updated after answers**
```
Cell that spans two tables:
---------------------------
| | |
| --- | --- |
| Name: | Rows including tables |
| Telephone: | row1 of first table |
|
-
+
... |
2018/02/25 | 2,181 | 6,571 | <issue_start>username_0: I'm using PostgreSQL 9.5 and flyway 5.0.7
Everything worked fine for the previous 6 migrations but now it blocks for the latest
I have the following error :
```
22:27:45.230 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Flyway Community Edition 5.0.7 by Boxfuse
22:27:45.408 [INFO ] o.f.c.i.u.l.slf4j.... |
2018/02/25 | 1,123 | 3,637 | <issue_start>username_0: I am new to Azure Functions but am attempting to call a c# file and method from the function. The "Run.csx" file itself is saying it is inaccessible due to the security level.
Azure run file:
```
using System;
public static void Run(TimerInfo myTimer, TraceWriter log)
{
Integration.Run.Impor... |
2018/02/25 | 1,137 | 2,700 | <issue_start>username_0: Why does `.astype('timedelta64[D]')` fail to cast the `ndarray` in the following example?
```
df = pd.DataFrame(pd.date_range('2017-01-01', periods=5, freq='W'), columns=['Val'])
df['Base'] = pd.datetime(2015, 1, 1)
df['Days'] = (df['Val'] - df['Base']).astype('timedelta64[D]') # Success
df['F... |
2018/02/25 | 364 | 1,082 | <issue_start>username_0: I would like to remove from my images their sRGB profile if they have one. the problem i don't know how to identify that an image have a sRGB profile. What the good way to do ?<issue_comment>username_1: In Imagemagick, use
```
convert image.suffix -format "%[profiles]\n" info:
```
or
```
co... |
2018/02/25 | 524 | 1,699 | <issue_start>username_0: I am facing a behavior that I really don't understand.
If you go on the webpage: **<https://www.edel-optics.fr/Lunettes-de-soleil.html#ful_iPageNumber=1>** and inspect the code you will realize that it's the same html content as on **<https://www.edel-optics.fr/Lunettes-de-soleil.html#ful_iPag... |
2018/02/25 | 562 | 1,748 | <issue_start>username_0: I am trying to code a calculator in AngularJS but it isn't working.
Here is the html:
```
MIAGE Calculator
Op. 1
Op. 2
Résultat
+
-
\*
/
Mémoriser
Charger la mémoire
En mémoire
var app = angular.module("monApp",[]);
app.controller("myCtrl", function ($scope){
$scope.... |
2018/02/25 | 395 | 1,431 | <issue_start>username_0: So, I was experimenting with Git for the first time and I decided to add a commit message. I used this code:
```
git commit
```
....which led me to a commenting screen of some sort. I put in my comment, hit enter, and absolutely nothing happened. The terminal isn't accepting any commands, a... |
2018/02/25 | 671 | 1,923 | <issue_start>username_0: I am now working on a calculation shown below. I want to update the values of each element based on their adjacent elements. I am now using two for loops, but it shows the calculation is very slow since there are several outer iterations. I want to know whether there is any way can speed up thi... |
2018/02/25 | 397 | 1,337 | <issue_start>username_0: I'm using visual studio code for practicing rust programs.
I'm getting the below warning always.
`warning: RLS could not set RUST_SRC_PATH for Racer because it could not read the Rust sysroot.`
[](https://i.stack.imgur.com/ZeC8q.png)... |
2018/02/25 | 1,492 | 4,178 | <issue_start>username_0: I am having nested list of strings as:
```
A = [["A","B","C"],["A","B"]]
```
I am trying to join the strings in sublist to get a single list of strings as:
```
B = [['ABC'],['AB']]
```
OR,
```
B = ['ABC','AB']
```
I tried using `''.join(A)` and `''.join(str(v) for v in A)` but they did... |
2018/02/25 | 1,319 | 4,822 | <issue_start>username_0: My switch statement coresponds to an array. The only values in the array are 1-6. I am sure of that. But for some reason the default value is always selected no mater what the value in the array is. Can someone tell me why this is happening?
The variables in the switch statement declared.
``... |
2018/02/25 | 577 | 2,002 | <issue_start>username_0: I'm trying to create a python program to check if a given number "n" is prime or not. I've first created a program that lists the divisors of n:
```
import math
def factors(n):
i = 2
factlist = []
while i <= n:
if n% i == 0:
factlist.append(i)
i = i + 1
return factlist
facto... |
2018/02/25 | 463 | 1,701 | <issue_start>username_0: [For performance reason](https://reactjs.org/docs/reconciliation.html#keys) and to avoid `Warning: Each child in an array or iterator should have a unique "key" prop` key should be added to state.
It is unclear if `key` attribute should be added to DOM. For example should I add `key` to `React... |
2018/02/25 | 1,099 | 4,291 | <issue_start>username_0: My API computes some data in its own thread:
```
/*** API is running in its own thread ***/
class API {
public:
std::shared_ptr retrieveData() { return mData; }
private:
std::shared\_ptr mData;
std::mutex mDataMutex;
void run () {
std::thread t([](){
while (!exitApi) {
mDataMutex.l... |
2018/02/25 | 497 | 1,504 | <issue_start>username_0: Is there an elegant way to shorten this part of code:
```
adhesiveCoord = array(adhesiveCoord)
adhesiveCoord = adhesiveCoord[:,0]
adhesiveCoord = list(map(int, adhesiveCoord))
```
Using Python 3.6 and Numpy
Thanks for help.<issue_comment>username_1: Yeah, this is a great place for [list-com... |
2018/02/25 | 1,056 | 3,835 | <issue_start>username_0: The following code calls `console.log` prints "hello":
```
console.log.call(console, "hello")
```
However, the code below throws TypeError:
```
x = console.log.call
x(console, "hello")
```
throws:
```
Uncaught TypeError: x is not a function
at :1:1
```
Can anyone explain this weird... |
2018/02/25 | 579 | 2,017 | <issue_start>username_0: Probably something very straightforward, but I have a recursive function, that returns either the element in an array that is a majority, or returns "None" if there is no majority.
```
if (count > size_of_input / 2) {
return maj1;
} else if (count2 > size_of_input/2) {
return maj2;
} e... |