date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/02/27
840
2,742
<issue_start>username_0: Tried to update `git` on my Mac system (High Sierra 10.13.3) using ``` brew install git ``` which gives the output ``` $ brew install git ==> Downloading https://homebrew.bintray.com/bottles/git-2.16.2.high_sierra.bottle.tar.gz ##############################################################...
2018/02/27
801
2,530
<issue_start>username_0: [enter image description here](https://i.stack.imgur.com/AwT4f.gif)I have two tables Table 1-qualified players ``` Id_sequence 121 345 765 ``` Table 2 - All enteries related to players Note :there are only 6 game\_ids 1a,1b,1c,2a,2b,2c ``` id_sequence...
2018/02/27
543
2,532
<issue_start>username_0: I am quite eager to learn how C++ or any programming language determines the memory addresses to use for its variables and instructions. Are these hexadecimal values completely random or are they calculated? I do know that instructions are stored in memory contiguously and that there is a progr...
2018/02/27
692
2,983
<issue_start>username_0: I have a simple JS class where in the constructor I initialize dictionary. I have methods to update or delete items from this dictionary. ``` export default class Items { constructor() { this.items = {}; //Code that adds some values to it } save(item) { this...
2018/02/27
619
2,712
<issue_start>username_0: We have a string field for date of birth and now we have to convert it in order to perform the calculations required. However when we are using CAST or CONVERT to convert to perform the calculations it is not working. ``` select distinct(ptr.RecordID) from dbo.PatientRecord as ptr where ptr.CH...
2018/02/27
1,864
3,774
<issue_start>username_0: I am trying to see if I can concatenate an empty array with fixed size with other arrays with the same size: ``` import numpy as np final_array = np.empty([3, 5]) >>>final_array array([[ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.]]) array_1 = np.array([1, 1, 1]) final_array...
2018/02/27
776
2,899
<issue_start>username_0: Hi I am trying to Bind my dropdown list in MVC from a model. Here is my model ``` [Table("FileConfig")] public class FileConfigModel { [Key] [Display(Name = "File Congif ID")] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int FileConfigId { get; set; } .... ...
2018/02/27
1,002
3,225
<issue_start>username_0: I have a class that can parse strings (dates). I want to be able to parse normal as well as wide strings: ``` MyClass x; x.parse("2018-02-27"); x.parse(L"2018-02-27"); ``` Since the code to parse a normal string and a wide string is basically the same, it makes sense to use a template: ``` ...
2018/02/27
940
3,169
<issue_start>username_0: I'm new to programming in VBA or object-oriented programming. I'm trying to get this code to work in the VBA compiler of Arena by Rockwell Automation. I sometimes get `Error 424: 'Object required'`, and after debugging I'm referred to the `XL.Quit` at the end. Sometimes I've got an error relat...
2018/02/27
590
2,141
<issue_start>username_0: I want my Dialogflow bot to send periodic messages through a Cronjob. I would do this by triggering an event through the /query endpoint. However, I am not sure how to get the *sessionId*. If I pass the last *sessionId* used, the response returns successfully, but I get no message in the conver...
2018/02/27
1,070
4,027
<issue_start>username_0: I don't know what is wrong, please advice. Write a recursive function `int ones(int x)`, that returns the number of ones in the binary representation of x. Make your function work independent of the size of an int (16, 32, 64 bits). ``` import java.util.Scanner; public class Recursion1 { ...
2018/02/27
625
2,366
<issue_start>username_0: I am trying to solve a specific variant of the problem mentioned here: Given a string s and a string t, check if s is subsequence of t. I wrote an algorithm that works fine for the above question: ``` def isSubsequence(s, t): """ :type s: str :type t: str :rty...
2018/02/27
1,011
3,972
<issue_start>username_0: Ok, so I have multiple textfiles, each containing well over 500.000 or even 1.000.000 lines. Currently I do something like this: ``` import random def line_function(line): # Do something with given line def random_itteration(filepath): with open(filepath) as f: lines = f.rea...
2018/02/27
4,570
14,823
<issue_start>username_0: I have this simple Rust function: ``` #[no_mangle] pub fn compute(operator: &str, n1: i32, n2: i32) -> i32 { match operator { "SUM" => n1 + n2, "DIFF" => n1 - n2, "MULT" => n1 * n2, "DIV" => n1 / n2, _ => 0 } } ``` I am compiling this to WebAss...
2018/02/27
2,082
7,198
<issue_start>username_0: Using: ====== * jq-1.5-1-a5b5cbe (Ubuntu 17.10) * Compose the queries: <https://jqplay.org/> Goals and conditions: ===================== 1. Replace an child object value with another value, at any depth, having parents objects or arrays, for example: * if .spec.template.spec.containers[**n*...
2018/02/27
1,175
3,611
<issue_start>username_0: My current code: ``` def write_from_dict(users_folder): for key, value in value_dict.items(): # iterate over the dict file_path = os.path.join(users_folder, key + '.txt') with open(file_path, 'w') as f: # open the file for writing for line in value: ...
2018/02/27
1,012
3,877
<issue_start>username_0: How to pass char array[] to function accepting `const char* arg` type and what is the most proper way of doing that? Please ignore the fact that I'm using static 100 buffer in this example: ``` char buff[100]; sprintf_s(buff, sizeof(buff), "%s", unrelated); ``` Then I need to pass the `buff...
2018/02/27
451
1,348
<issue_start>username_0: I have a row with this data: ``` id=1, p1=X, p2=Y, p1f=0, p2f=NULL ``` How to select either p1 or p2 based on which p1f or p2f is 0? I tired: ``` SELECT id, p1, p2, CASE WHEN p1f = 0 THEN id, p1 WHEN p2f = 0 THEN id, p2 ELSE NULL END FROM match ``` Tha...
2018/02/27
322
1,088
<issue_start>username_0: I want to be able to change the color of the form background color when clicked, but instead if i even click inside the form input box it also changes the form background. ``` $('form').on('focus', 'input', function(e) { $(this).addClass('change'); }) ```<issue_comment>username_1: You a...
2018/02/27
1,242
3,112
<issue_start>username_0: I have the following two tables I'd like to combine: ``` > toytable id sid_set 1: 1 a, b, c 2: 2 c, b 3: 3 a 4: 4 d, b > tdf3 value id a b c d 1 1 1 1 0 2 0 1 1 0 3 1 0 0 0 4 0 1 0 1 > class(tdf3) [1] "table" > class(toytable) [1] "data.table" "data.frame" ```...
2018/02/27
582
1,802
<issue_start>username_0: I have a question involving for loops and a points plot. I have to use the measurements table (see below) to create a plot (see picture). My question is how do I use the for loops to obtain the plot? I tried creating an empty plot which can be used to put the data into but don't know whether...
2018/02/27
1,414
4,423
<issue_start>username_0: I am working on WPF application using Infragistics XamDataGrid. I have few columns that I need to sort to work like below. I will have values like -1.00,N,1.73, N, -5.6, N, 7.. I need sort to be like below Asc order > > N > > N > > -5.6 > > -1.00 > > 1.73 > > 7 > > > ...
2018/02/27
1,168
3,180
<issue_start>username_0: Can someone explain to me why below is not working as expected? In the below example, I would expect the `$shortFQDN` variable to be set as `test.com`, but I'm getting back `www.test.com`: ```bsh $fqdn = 'dev.www.test.com' $d3 = $fqdn.Split('.')[-3] #www $d2 = $fqdn.Split('.')[-2] #website $d1...
2018/02/27
1,175
3,577
<issue_start>username_0: We are distributing an app via Google Play. Currently, there are two versions of the app in beta: * Production - com.domain.standard - Points to the production server. * Development - com.domain.evv - Points to the development server. We are finding that users can only have one version instal...
2018/02/27
1,069
3,083
<issue_start>username_0: I am trying to insert a row in sqlite database. Below is the query: ``` SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_MAIN_ID_PK, "NULL"); values.put(KEY_NAME, "name-1" ); long mainTblIn_id = db.insert(TABLE_MAIN, null, valu...
2018/02/27
1,350
3,858
<issue_start>username_0: I'm trying to get my custom buttons to change colors when clicked using only HTML/CSS - I have it written so that the outline should turn green but it isn't working (the buttons are being treated like static boxes?). I'm trying to get something to this effect: [![enter image description here...
2018/02/27
1,128
4,037
<issue_start>username_0: I am trying to find an example of HTTP post request in Typescript but can only find examples that use Angular. Could someone point me in the right direction to find this or post a quick example here of using Post with JSON data to get a response JSON.<issue_comment>username_1: Sending form data...
2018/02/27
1,353
4,707
<issue_start>username_0: the line `for doc in collection.find({'is_timeline_valid': True}):` is giving the Message Length error. How can I get all the collection without the error? I know about the `find().limit()` but I don't know how to use it. Code: ``` from openpyxl import load_workbook import pymongo import os ...
2018/02/27
1,389
4,924
<issue_start>username_0: I have an array of objects generated from database query using MongoDB Aggregation framework. ``` [ { user_type: 'STUDENT', comments : 25 }, { user_type: 'PARENT', comments: 35 }, { user_type: 'TEACHER', comments: 26 }, { user_type: 'PARENT', comments: 41 }, { user_type: 'PRINCIPAL...
2018/02/27
2,484
5,358
<issue_start>username_0: I am trying to take two arrays of hashes that contain the position for IDs, and return the position change. The data are from charts scraped on different dates. If chart 1 from 2018-01-01 contains: ``` [ {:position=>1, :id=>"GBMMV1800001"}, {:position=>2, :id=>"GBMMV1800002"}, {:posi...
2018/02/27
649
2,393
<issue_start>username_0: We use generated object types from a schema via `xcj`. *Hence, not very flexible control over the types' definitions*. We also use JAXB annotations. Then, we use Jackson Faster XML for deserialization of those objects. Unfortunately, when we deserialize abstract classes, we get an exception: ...
2018/02/27
242
985
<issue_start>username_0: Is it possible in UWP to launch file explorer with the current app's "local data folder"? First I'm wondering how to invoke Explore or similar File Exploring Apps from UWP application. Second, I'm wondering how to set the directory of the file explorer to the Current App's Local Data Folder. ...
2018/02/27
978
2,325
<issue_start>username_0: I'm using `if(!(results[count].m._id in usedIdArray))` to determine whether or not an ID value already exists in an array. This if statement is in a for loop that iterates through 21 nodes in `results`. `usedIdArray` is just an array of integers and `results[count].m._id` is a number. `results[...
2018/02/27
1,254
3,589
<issue_start>username_0: I am encountering a problem when creating the following table in SQL: ``` CREATE TABLE observacion ( carretera VARCHAR2(6), sentido VARCHAR2(3), km NUMBER(3,0), fecha DATE, hora TIME, matricula VARCHAR2(7) NOT NULL, vin VARCHAR2(17) NOT NULL, velocidad NUMBER(3,0) NOT NULL, CONSTRAINT PK_obse...
2018/02/27
599
1,956
<issue_start>username_0: error received: OperationalError: near "||": syntax error ``` sql= "Select FirstName || " " || LastName AS Nominative from users" ```<issue_comment>username_1: You can try the following statement. ``` CREATE TABLE observacion ( carretera VARCHAR2(6), sentido VARCHAR2(3), km NUMBER(3,0), ...
2018/02/27
925
3,184
<issue_start>username_0: I am attempting to bundle FreeType with my Mac build of OpenJDK9, but am having trouble with references to libfreetype after building is completed. I am packaging the JDK with my application, and do not want the end user to have to install FreeType in order to get the application to work (the J...
2018/02/27
1,345
3,782
<issue_start>username_0: Given... ``` var a = [{ b: [{ i: 2 }, { i: 3 }] }, { b: [{ i: 4 }, { i: 5 }] }, { b: [{ i: 6 }, { i: 7 }] }]; ``` What is a good way to find the object, for example, with `i = 5` plus the object that contains the array that it's in? So, the result would be two references... ``` var r0 ...
2018/02/27
1,693
6,252
<issue_start>username_0: I'm trying to build an API with EntityFramework and OData v4. ***Issue :*** I need some extra data, `extraProperty`, that are not in my DB to create a new `Item`, but oData won't recognize this as an `Item` if I add some data to my JSON object in my `POST` call. I use EntityFrameWork so, acco...
2018/02/27
328
916
<issue_start>username_0: I kind of need your help on this. I have 2 separate spreadsheets: **Spreadsheet A:** ``` ColA ColB AA1 Want1 AA2 Want2 AA3 Want3 ``` **Spreadsheet B:** ``` ColC ColD AA3 AA1 ... AA2 ... ``` I tried using the following formula (because I need them to fill automatically): ...
2018/02/27
343
1,093
<issue_start>username_0: I have a nested field with two properties: ``` { "rating": 2 "victim": [{ "ip": "...", "instanceId": "...."" }] } ``` I want to aggregate over the rating and get the IP or InstanceId for each document, not both in the bucket list. What i've got so far is: ``` "...
2018/02/27
454
1,388
<issue_start>username_0: I used read\_csv() to import a file into R. Now I wish to convert various character vectors to factors. I used this code and it worked fine. ``` library(readr) library(tibble) activos_dic_2017$DESCRI_RIESGO <- parse_factor(activos_dic_2017$DESCRI_RIESGO, ...
2018/02/27
2,476
6,825
<issue_start>username_0: I understand how to use if in map. For example, `val result = list.map(x => if (x % 2 == 0) x * 2 else x / 2)`. However, I want to use `if` for only part of the arguments. ``` val inputColumns = List( List(1, 2, 3, 4, 5, 6), // first "column" List(4, 6, 5, 7, 12, 15) // second "column...
2018/02/27
584
1,918
<issue_start>username_0: I'm using Rails 5 and have a form with a Google recaptcha. I use the Rails gem for this ``` gem "recaptcha", require: "recaptcha/rails" ``` So I have a simple form with ``` <%= form_for @comment, :html => {:class => "commentsForm"} do |f| %> <%= f.label :description, 'Your Comments' %> ...
2018/02/27
598
1,835
<issue_start>username_0: Could anyone help to explain, why the values in dictionary change when using 'append'. ``` dic1 = {1:[[1],[2]]} for x in dic1.keys(): for tt in dic1[x]: print tt tt = tt + [1] print tt dic1 ``` output: ``` [1] [1, 1] [2] [2, 1] Out[67]: {1: [[1], [2]]} ``` ---...
2018/02/27
493
1,786
<issue_start>username_0: I found a canvas generator website. I would like to copy the canvas to my local environment for experimental purposes. Is there a way to inspect it in chrome and export its drawn content only?<issue_comment>username_1: Canvases are graphics that is the result of a javascript code. These result...
2018/02/27
707
2,579
<issue_start>username_0: I recently read that using private method is bad because they are very memory inefficient because a new copy of the method would be created for each instance. In the example given, how is dispalyIncreasedSalary more efficient than increaseSalary? ``` var Employee = function (name, company, sal...
2018/02/27
527
1,356
<issue_start>username_0: Hi everyone im trying to obtain this: [Problem](https://i.stack.imgur.com/9KZ8E.png) I'm using R to simulate a Markov Chain and the State 4 is an absorbing state, I need that once the client has entered into the state 4 the client has to remain in that state the rest of the time. Thanks for ...
2018/02/27
393
1,702
<issue_start>username_0: Building a CloudFormation stack template, I have a setup constellation where upon instantiation I want to reference either the name of another CloudFormation stack *or* a non-CloudFormation-managed database as a parameter. Is there a way to represent this constellation in my template? I.e. "Pa...
2018/02/27
1,063
3,543
<issue_start>username_0: I'm trying to learn the RISC-V ISA. Is there a way to simulate RISC-V assembly code just like in MARS for the MIPS ISA?<issue_comment>username_1: It sounds like you're looking for an instruction-level RISC-V simulator with an integrated front end that allows you to interactively edit machine co...
2018/02/27
435
1,633
<issue_start>username_0: I want to check that the target element contains a class or not. if not add the class and if yes then remove the class. ``` class Hello extends React.component{ addActiveClass(e){ if(e.target.classList.contains("active")){ //I wanna to add active class to e.target }else{ ...
2018/02/27
865
3,126
<issue_start>username_0: I am a bit confused trying to focus input that was disabled. I have input that is disabled at start. And after clicking a button i want remove disabled attr and focus this input. I removed attribute from the input before focus `this.renderer.removeAttribute(this.elRef.nativeElement, 'disabled...
2018/02/27
844
3,075
<issue_start>username_0: I have a simple python GUI that fills in a grid based on the values in an array, and I want this simple GUI to sit on screen while other functions run. The time for these other functions is indeterminate, so I can't simply call them at some regular interval using after(time, function) ``` def...
2018/02/27
515
1,905
<issue_start>username_0: I am using a theme for my project. I am facing an issues related to append options in a select using jQuery because of theme's javascript. When I append an option to select it doesn't show up although it is added. I found out that this is because a button and div are added above the select a...
2018/02/27
579
1,942
<issue_start>username_0: I have an issue with Feathersjs , integrating with sequalize. If I set the default pagination like below, and there is no sort specified it will generate an error because the SQL statement generated is invalid. Service Created with default of 5: ``` app.use('/manifests', service({ paginate:...
2018/02/27
863
2,818
<issue_start>username_0: I am using Django 1.8 and Python 3.5 This is my urls.py file ``` from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.conf import settings urlpatterns = [ # Examples: url(r'^$', 'mainpage.views.home2', nam...
2018/02/27
580
1,969
<issue_start>username_0: I want to scrape nutrient data from this page: <http://www.mysupermarket.co.uk/tesco-price-comparison/Fruit/Tesco_Gala_Apple_Approx_160g.html>. I tried the following code. ``` import requests, bs4 res = requests.get('http://www.mysupermarket.co.uk/tesco-price-comparison/Fruit/Tesco_Gala_Apple...
2018/02/27
496
1,798
<issue_start>username_0: Is there a way to remove the drop shadow under the app bar (AppBar class) when using a Scaffold widget in Flutter?<issue_comment>username_1: Looking at the `AppBar` constructor, there's an `elevation` property that can be used to set the height of the app bar and hence the amount of shadow cast...
2018/02/27
422
1,473
<issue_start>username_0: I call a web service that returns a json array in case of success: ``` [ {"name":"a"}, {"name":"b"} ] ``` And in case of failure, it returns an object: ``` { "status":"Failed", "describtion":"Error occured" } ``` How to map both response in order to handle them?<issue_comment>userna...
2018/02/27
1,761
4,687
<issue_start>username_0: I am trying to push an app from a docker image hosted in the AWS Elastic Container Registry and am getting 500 error codes from the cloudfoundry API when trying to push. Am i doing something wrong or is there just an issue with the API currently? Any help is appreciated. push command used (rep...
2018/02/27
914
2,961
<issue_start>username_0: I want that on pressing enter in a TextInput widget it should do two things- 1. change the screen (i am using screen manager) 2. and search for the keyword I do know that with on\_text\_validate we can perform either of the tasks by- 1`.root.manager.current='namesomething'` 2.`root.function...
2018/02/27
355
1,394
<issue_start>username_0: On one of the screens on my app I have a sliding bottom panel, and when it slides up I disable an EditText on the screen. I disable it with `totalText.setEnabled(false); totalText.setClickable(false); totalText.setFocusable(false);` and reenable it with `totalText.setEnabled(true); totalTe...
2018/02/27
617
2,336
<issue_start>username_0: I have created a Java calculator, however i need to add code for when the number is divided by zero i set the result to be zero. Everything else is working i just don't know where to add this statement. heres the code: ``` public class Calculator { // Declaration of a long variable to hold th...
2018/02/27
747
2,821
<issue_start>username_0: What would be the way to go if I wanted to inject a non-singleton service into another non-singleton service in Angular? Let's say I have a `ComponentA` which uses a `ServiceA` like this ``` @component({ selector: "componentA", providers: [ServiceA] }) export class ComponentA { construc...
2018/02/27
687
2,716
<issue_start>username_0: Context: primitive chat bot. I have a simple code: ``` private static bool busy; private async void OnTimedEvent(object sender, ElapsedEventArgs e) { if (!busy) { busy = true; //some logic await SomeAsyncCommand(); busy = false; } else { ...
2018/02/27
1,171
4,396
<issue_start>username_0: While I am pretty sure of a simple solution to this issue, the issue here is that the secondVC is in no way or form separate from the firstVC. The secondVC is what you get when you tap on the tableViewCell. The cell you tapped (using the indexPath) I send some data to the secondVC and then you ...
2018/02/27
587
1,942
<issue_start>username_0: I want to execute the following command in my dockerfile: ``` java -jar kafka-connect-cli-1.0.6-all.jar create cassandra-sink-orders < cassandra-sink-distributed-orders.properties ``` This is what I have tried but it gives me error: **Cannot execute cassandra-sink-orders < cassandra-sink-di...
2018/02/27
496
989
<issue_start>username_0: I have a CSV file with a header consisting of two lines: ``` A, A, B, B, B a, b, c, d, e 1, 2, 3, 4, 5 2, 3, 4, 5, 6 ``` I'd like to concatenate the header to this form: ``` A_a, A_b, B_c, B_d, B_e 1, 2, 3, 4, 5 2, 3, 4, 5, 6 ``` How to achieve that in command-line, using ...
2018/02/27
1,459
5,177
<issue_start>username_0: I have a monthly base with almost 373,000 lines. Of these, part has a low value or is blank. I'd like to erase this lines. I have part of this code to delete those that have zero. How to create a code that joins the empty row conditions (column D) in a more agile way. Thanks ``` Sub DelRows...
2018/02/27
3,484
8,804
<issue_start>username_0: So I have been struggling to get a correct legend onto this plot. My end goal is a legend that shows both line colours and point colours. I can get the lines in the legend working ok but was wondering how I also get points too (and includes the shape **and** colour of points)? Any work around o...
2018/02/27
2,273
7,997
<issue_start>username_0: I am using Capybara Selenium to run headless Chrome, which works great, except I cannot figure out how to use remote debugging. When I add `--remote-debugging-port=4444` or `--remote-debugging-port=9222` or `--remote-debugging-port=9521`, Selenium no longer connects to the browser to run the te...
2018/02/27
1,284
3,482
<issue_start>username_0: I have the below dataset which needs to be sorted based on "AcctCode" and "SuperID" as below expected result using lodash. Anyone help me how to sort out in Ascending order based on "AcctCode" and "SuperID" as below I have mentioned the expected result set. I have used \_.orderBy(data), but i...
2018/02/27
604
2,142
<issue_start>username_0: I'm trying to get my express to serve up static files that are in another location: This is the current directory I have: ``` |__client | |__thumbnails.html | |__server |__app.js ``` I tried to just use `app.use(express.static(path.join(__dirname, '..', 'client')));`, but it wouldn't ...
2018/02/27
479
1,614
<issue_start>username_0: i have a php file which have some variables para1 and para2 , i want to send them to a python file . this is my php file: ``` php $para1 = "one"; $para2 = "two"; echo "shell_exec(" /C:/xampp/htdocs/Ai_Edutech_trial_project/eclipse_workspace/Project /check.py '$para1' '$para2'")"; ? ``` and ...
2018/02/27
5,772
22,676
<issue_start>username_0: I have a custom column header where each column's header has `TextBox` which contains name of the column and `ComboBox`, which contains information about the type of the column, e.g. "Date", "Number", etc. I'm trying to bind `ComboBox` and keep its value somewhere, so that when user selects ne...
2018/02/27
978
3,740
<issue_start>username_0: I am creating a JSF application deployed in Tomcat/EE (with CLIENTCERTs). By default, the `jsessionid` (generated with a [SecureRandom](https://lkubaski.wordpress.com/2013/02/16/how-tomcat-and-jetty-generate-the-sessionid/), so it looks safe) was set in the URL, which I disabled for [security r...
2018/02/27
1,096
4,474
<issue_start>username_0: I have created an angular 5 application. Which is using a token based system.Currently I am storing the token in the localstorage.I want the localstorage to be clear when the browser closes. and not clear the localstorage when the browser refreshes.The reason that I didn't use sesionstorage is ...
2018/02/27
578
2,251
<issue_start>username_0: I am trying to send out a maximum of 3 free samples to customers with free shipping. I have created some 0 priced product and set them in "samples" product category. This specific products have option "sold individually" so customers can only have one of each sample. I cannot figure out how ...
2018/02/27
1,187
3,595
<issue_start>username_0: I want to enable/disable branches at compile time depending of whether a function can be called with certain arguments. What has to go in the `if constexpr` condition? I can get the result type via `std::result_of(decltype(add)(A, B))`, but how can I check, whether the result type is valid? (i....
2018/02/27
432
1,656
<issue_start>username_0: I am using Angular 5. An i interact with an API through a service. I have a method that i want to use for posting into the API. The problem is, if i specify the type of the post method to "Candidate" object i get the following warning: ``` src/app/candidates.service.ts(17,12): error TS2558: E...
2018/02/27
869
2,943
<issue_start>username_0: I was trying to make baseball game that counts strike and ball. For example, if random\_number is '835' and user\_input\_number is '853', strike\_count should be 1, ball\_count should be 2. And this function is only for counting strike and ball. But the program does not run the second for loop ...
2018/02/27
2,507
7,076
<issue_start>username_0: I'm working on implementing better text sizing and believe with interpolation I maybe able to update my current text labeling to a much more efficient format. Currently we are creating "static text", essentially we get the ideal text-size for a particular zoom level, then scale it at each zoom ...
2018/02/27
1,538
5,337
<issue_start>username_0: I have a relatively simple dataframe that looks like this (see below). One of the columns, "Book", is a list of strings. My goal is to make new dataframes for each of the three distinct values in "Book". That is to say, a dataframe with every product that appears in International, every produ...
2018/02/27
1,144
3,278
<issue_start>username_0: I am trying to filter a column of a ngx-table I follow the the example but it keeps giving that error "Cannot read property 'toLowerCase' of undefined" here's the template part ``` {{value}} ``` and the function attached to it ``` updateFilter(event) { const val = event.target.value.toLo...
2018/02/27
870
2,495
<issue_start>username_0: ``` #include int main(int argc, char \*\*argv) { int c; FILE \*file; file = fopen(argv[1], "r"); if (file) { while ((c = getc(file)) != EOF) { if (c != 'a') { putchar(c); } } } } ``` Basically, the program just takes in a file as stdin, then removes every a and prints to stdout....
2018/02/27
926
3,906
<issue_start>username_0: I have a web service app in Java and I'm trying to do an export functionality to export some data from the database to an excel file For this I'm using **HttpServletResponse**, but even I set up a filename and a encoding type, the file exported is not using those. I need to set up the name of...
2018/02/27
4,104
10,581
<issue_start>username_0: I'm trying to mix spring boot together with redis. These are the dependencies: <https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent/1.5.10.RELEASE> <https://mvnrepository.com/artifact/org.springframework.data/spring-data-redis/2.0.4.RELEASE> However when I im...
2018/02/27
1,158
4,039
<issue_start>username_0: I have an unassuming nav menu: ``` * [Real Estate & Development](/real-estate) * [New & Expanding Business](/new-business) { … } ``` This menu needs the following visual properties: * Items distributed horizontally within their container by putting equal space between them * Text in ite...
2018/02/27
1,516
4,827
<issue_start>username_0: I've got a table as follows Table1 ``` ID Name Tag ----------------- 1 N1 2.1 2 N2 3.5 3 N1 3.5 4 N3 8.1 ``` I create a new table Table2 with ID and Name (unique constraint) and I want to insert Table1's contents into Table2 avoiding duplicates, in the sense ...
2018/02/27
1,457
4,851
<issue_start>username_0: In my ViewModel I load data in (overrided) `Start` method, like so: ``` public override async void Start() { base.Start(); await ProcessItems(); // or the following (no difference for Start method behavior) await ProcessItems().ConfigureAwait(false); ...
2018/02/27
1,420
4,762
<issue_start>username_0: I am interested in implementing a special variant of a Priority Queue in Java, and I want this priority queue to work with generic types. In Java's collection objects that store objects with some sort of ordering (e.g. PriorityQueue, TreeSet, etc.), it is possible to use classes that implement ...
2018/02/27
1,604
4,235
<issue_start>username_0: I'm having difficulty understanding the semantics of `ByteBuffer` in the following scenario: ``` int sizeOfDouble = 8; int numberOfDoubles = 4; ByteBuffer testBuf = ByteBuffer.allocateDirect(sizeOfDouble*numberOfDoubles); testBuf.putDouble(0, 1.0); testBuf.putDouble(1, 2.0); testBuf.putDouble...
2018/02/27
621
2,018
<issue_start>username_0: I need to hide a div when an input element is empty (the user has not typed anything in). I have tried [this](https://stackoverflow.com/questions/12785622/what-jquery-do-i-need-to-hide-a-div-class-if-an-input-value-is-empty) and [this](https://stackoverflow.com/questions/35858761/show-hide-div-...
2018/02/27
672
2,081
<issue_start>username_0: I'm trying to write a function that does two usages of a count. It's easier to see the code to understand what I'm trying to achieve: ``` $i = 1; while ($jobs->have_posts()) : $jobs->the_post(); $i++; $html_out .= '|'; $html\_out .= ' |'; $html\_out .= ' |'; $html\_out .= ' |'; ...
2018/02/27
688
2,180
<issue_start>username_0: I would like to apply custom percentages to my dataframe rows and last row per each company id should always be zero. I tried with df.apply method but not able to pass multiple parameters. Appreciate if you could let me know in how many ways this problem can be solved? Thank you in advance for ...
2018/02/27
1,205
4,307
<issue_start>username_0: I am trying to figure out if there's a way to combine these 2 queries into a single one. I've run into the limits of what I know and can't figure out if this is possible or not. **This is the 1st query that gets last year sales for each day per location (for one month):** ``` if object_id('...
2018/02/27
646
2,335
<issue_start>username_0: I need to sort the String array into least to greatest order by wordlength. I then need to print out the words next to their value. Example Output: 1: I, U, K 6: Joseph, Delete But I need help sorting the array first. Code: ``` package Objects; import java.io.*; import java.util.*; impor...
2018/02/27
469
1,410
<issue_start>username_0: How can I shorten this expression? ``` if artist != 'Beck' && artist != 'Led Zeppelin' 5.times { puts 'sorry' } end ``` Is there a shorthand check for two logical conditionals against one variable? --- As an aside, this turned into ``` class String def is_not?(*arr) !arr.include?(...
2018/02/27
933
3,521
<issue_start>username_0: Im am trying to get to grips with admin on rest with graphql client. I am using 'aor-graphql-client-graphcool' and an endpoint on launch pad. Debugging the app shows a zero length array assigned to the resource key. The types/queries look ok so I think introspection is working OK. ``` introspe...
2018/02/27
1,003
3,603
<issue_start>username_0: I am using JSON to get data from an `HttpServlet` for data object class definitions that are shared between the servlet and a java client. If I print out the response from the api call I can see that the instance variable is correct. Then when I map it using Jackson object mapper and look at th...
2018/02/27
1,427
4,689
<issue_start>username_0: Been following a Python specialization on Coarsera and figured I'd try something out on my own! First thing I run into before I even began was this: ``` C:\Users\kurts\Python>django-admin startproject Kurtain C:\Users\kurts\Python>cd kurtain C:\Users\kurts\Python\Kurtain>manage.py runserver ...