date stringlengths 10 10 | nb_tokens int64 60 629k | text_size int64 234 1.02M | content stringlengths 234 1.02M |
|---|---|---|---|
2018/03/11 | 712 | 2,283 | <issue_start>username_0: So basically, I have two tables:
>
> 1. ITEM\_MASTER - srno(Primary Key), name(Unique Key)
> 2. SELL\_RECORD - bill\_no(Primary Key), name(Foreign key to ITEM\_MASTER)
>
>
>
Now, if I want to update the name in ITEM\_MASTER, the foreign key will conflict.
what i did was:
```
//adding a... |
2018/03/11 | 817 | 2,159 | <issue_start>username_0: I have a dataframe that looks like this:
```
x <- c(1,2,1,1,4,NA,NA,NA,NA,NA)
y <- c(21,22,23,21,21,NA,NA,NA,NA,NA)
z <- c(NA,NA,NA,NA,NA,1,2,3,4,5)
dat <- data.frame(x,y,z)
```
I want to count how many times a value from x occurs in z and then
take the value of y that corresponds to tha... |
2018/03/11 | 787 | 2,316 | <issue_start>username_0: I'm reading some codes and I saw this
```
router.post('/', (req, res) => {
const {author, message} = req.body;
if (author === undefined) {
res.status(400);
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify({ message: 'Every message requires an author' ... |
2018/03/11 | 575 | 1,517 | <issue_start>username_0: What is the most popular product purchased in north east?
```
Product(product_id, p_description)
Customer(cusid,fname,lname,state,zipcode)
Purchase(purchase_id,cusid,product_id,purchasetimestamp,quantity ,price)
```<issue_comment>username_1: You can use base R's `table`:
```
dat$x <- factor(... |
2018/03/11 | 745 | 3,144 | <issue_start>username_0: In [this](https://carpben.github.io/Choose-My-Next-Destination/) simple Create-React-App application , I have a simple, static, Header component. For readability the header is held in a separate component. When using : Dveloper Tools - React - and selecting heighlight updates, I'm surprised to ... |
2018/03/11 | 2,022 | 8,396 | <issue_start>username_0: For user code, there are a couple of options for correctly closing multiple resources:
1. try-with-resources
=====================
```
try (
A a = new A();
B b = new B();
C c = new C()
) {
// ...
}
```
Apart from being nice and short, it is also correct.
* It will correctly close ... |
2018/03/11 | 1,233 | 3,669 | <issue_start>username_0: So for example I have:
```css
table {
border: 1px solid #ddd;
width: 100%;
}
td {
text-align: right;
}
.special {
font-size: 24px;
}
```
```html
| |
| --- |
| 1 |
| |
| --- |
| 2 |
| |
| --- |
| 3 |
| |
| --- |
| 4 |
| |
| --- |
| 5 |
```
However for the 5th tab... |
2018/03/11 | 613 | 2,063 | <issue_start>username_0: Right now I have multiple rows from mysql printing off the following in php:
```
while($row=mysql_fetch_array($result)){
echo "";}
```
I am able to retrieve only the most recent value of button dd.
```
function myFunctions() {
var name = document.getElementById("dd").value;
```
There ... |
2018/03/11 | 1,208 | 3,156 | <issue_start>username_0: I have a pandas column like so:
```
index colA
1 10.2
2 10.8
3 11.6
4 10.7
5 9.5
6 6.2
7 12.9
8 10.6
9 6.4
10 20.5
```
I want to search the current row value and find matches from previous rows that are close. For example index4 (10.7) would return a ma... |
2018/03/11 | 1,281 | 4,577 | <issue_start>username_0: >
> E/AndroidRuntime: FATAL EXCEPTION: main
>
>
> Process: za.co.riggaroo.motioncamera, PID: 17583
> kotlin.TypeCastException: null cannot be cast to non-null type kotlin.Boolean
> at za.co.riggaroo.motioncamera.MainActivity$setupArmSystemToggle$2.onDataChange(MainActivity.kt:42)
> at com... |
2018/03/11 | 594 | 2,239 | <issue_start>username_0: It is common that I want to judge an `int` is assigned or not.
Example code below:
```
int a;
// some pre-codes...
if (a is not assgined) ... not assigned operation
else ... assigned operation
// I tried to do that with code below:
if (a == NULL) ... not assigned operation
else ... assigned ... |
2018/03/11 | 2,060 | 6,838 | <issue_start>username_0: I have a query
```
select sum(salary)
from employees
where email in ('BERNST','DAUSTIN','VPATABAL')
and department_id in (90,60)
and manager_id in (103,102);
```
So, I want to write the above query with the permutation combination of each IN's values like
the query should total of 12 que... |
2018/03/11 | 1,220 | 3,953 | <issue_start>username_0: Let's say I opened a file called file1.mp3 in a PyQt5 app using the file dialog and assigned it to a variable like this:
```
song = QFileDialog.getOpenFileName(self, "Open Song", "~", "Sound Files (*.mp3 *.ogg *.wav *.m4a)")
print(song[0])
url = QUrl.fromLocalFile(song[0])
self.playlist.addMed... |
2018/03/11 | 2,988 | 10,634 | <issue_start>username_0: Will you please help me with this problem.
I'm inserting values to my Sqlite database.
How can I check or view the inserted data.
Is there is any tool or other techniques to show the data ?<issue_comment>username_1: **If You Want to Show a data on `Log` try below code :**
```
for (Contact c... |
2018/03/11 | 371 | 1,142 | <issue_start>username_0: **Consider the below table T1**
FLOOR...ANIMAL...COLOUR
1...Cat...Black
1...Dog...Black
1...Cat...White
2...Dog...White
2...Dog...Brown
3...Cow...Brown
3...Dog...White
3...Cat...Black
**Now, I with query: Select \* from T1 where animal='cat'; got this Table T2**
Table T2
FLOOR...ANI... |
2018/03/11 | 536 | 2,006 | <issue_start>username_0: Workspace.Part.Script:16: attempt to index local 'screengui' (a nil value)
```
wait(2) -- Testing to make sure assets loaded
script.Parent.Touched:connect(function(hit)
if not hit or not hit.Parent then return end
local human = hit.Parent:findFirstChild("Humanoid")
if human and hu... |
2018/03/11 | 306 | 1,144 | <issue_start>username_0: I'm creating a token based rest api in php for e-commerce application.
**Scenario :**
Any visitor can add items to cart without logging in. These items are stored in the mysql database, cart table, with user\_id value which defaults to 1. // As user is not logged in.
**Problem :**
After the ... |
2018/03/11 | 433 | 1,606 | <issue_start>username_0: This URL rewriting lines work fine **till the query string line**, and after the query string any of them not work.
```
ReWriteEngine On
ReWriteRule ^home?$ /mysite/index.php
ReWriteRule ^gallery?$ /mysite/gallery.php
ReWriteRule ^([a-z0-9]+)?$ /mysite/owner.php?name=$1
ReWriteRule ^about?$ /m... |
2018/03/11 | 1,465 | 4,204 | <issue_start>username_0: I have a table that has 100's of entries for over 1000 different products, each identified by a unique UID.
```
ID UID MANY COLUMNS CREATED AT
1 dqwdwnboofrzrqww1 ... 2018-02-11 23:00:43
2 dqwdwnboofrzrqww1 ... 2018-02-12 01:15:30
3 dqwdwn... |
2018/03/11 | 565 | 1,859 | <issue_start>username_0: `The ERROR! starts from line 7` which is `GradeBook::GradeBook(string name)(Type name is not Allowed)`
I Wrote it the same as in the example cant understand why its not working and I am using visual studio 2015 to compile.
```
#include
#include "Header.h"
using namespace std;
int main() { ... |
2018/03/11 | 440 | 1,324 | <issue_start>username_0: I'm trying to select data from mssql table using python(I'm using pycharm).
One of the fields contains arabic letters, but the result of the select is '???????' Instead of the arabic letters. How do I get the arabic words correctly?
Im using pymssql. Im creating a connection and a cursor, and ... |
2018/03/11 | 365 | 973 | <issue_start>username_0: In a Udacity's GCD course there was a small quiz:
```
let q = DispatchQueue.global(qos: .userInteractive)
q.async { () -> Void in
print("tic")
}
print("tac")
```
Which will be printed first?
The correct answer is: `tac`, then `tic`. Seems logical.
But, why is it so only when I create a... |
2018/03/11 | 563 | 2,324 | <issue_start>username_0: Currently I develop a project which was earlier supported by someone else and they used Hibernate. I want to use Spring JDBC template in this project because I'm unfamiliar with Hibernate.
Can one use both of them? Will be there conflicts if you use them both?<issue_comment>username_1: It's co... |
2018/03/11 | 1,107 | 4,318 | <issue_start>username_0: I want to use the `WeakReference` approach to not leak memory with my `AsyncTask`. I found examples online and on Stackoverflow, but they only get the reference in `onPostExecute` and I am unsure how to correctly use it in all 3 of the UI methods.
My current approach is like this, but I have no... |
2018/03/11 | 775 | 3,019 | <issue_start>username_0: I have 3 Spark queries saved in List - sqlQueries. The first 2 of them creates global temporary views and third one executes on those temporary views and fetches some output.
I am able to run a single query using this -
```
val resultDF = spark.sql(sql)
```
Then I add partition information... |
2018/03/11 | 1,387 | 4,847 | <issue_start>username_0: The code below is being used to add two complex numbers using operator overloading but I do not understand the argument and the body of the plus operator. Can anyone please explain this?
```
complex operator+(complex a2) // why this argument is used please explain
{
complex a; //what ... |
2018/03/11 | 594 | 2,118 | <issue_start>username_0: How to configure kafka for TLS communication using `PEM` encoded files in java client. All the documentation I see out there talks about creating and using java `KeyStore` and `trustStore`.
<https://kafka.apache.org/10/javadoc/index.html?org/apache/kafka/clients/producer/KafkaProducer.html> ,... |
2018/03/11 | 851 | 2,496 | <issue_start>username_0: Here is the code which made me post this question.
```
// int integer;
// int fraction;
// double arg = 110.1;
this.integer = (int)(arg);
this.fraction = (int)((arg - this.integer) * 100);
```
The variable `integer` is getting `110`. That's OK.
The variable `fraction` is getting `9`, howe... |
2018/03/11 | 624 | 2,192 | <issue_start>username_0: This question was asked zillion times, but it always has kind of unique solution. I understand why it's happening and how to fix it, but my fix is ugly and I'm probably missing something.
```
use std::collections::HashMap;
fn main() {
let mut s = Trololo { data: HashMap::new() };
s.do... |
2018/03/11 | 687 | 2,775 | <issue_start>username_0: How do I convert numbers to its equivalent alphabet character and convert alphabet character to its numeric values from a string (except 0, 0 should stay 0 for obvious reasons)
So basically if there is a string
```
string content="D93AK0F5I";
```
How can I convert it to ?
```
string new_co... |
2018/03/11 | 1,342 | 4,862 | <issue_start>username_0: I received this crash report in my Google Play Console which I myself never experience and unable to reproduce.
```
java.lang.IllegalArgumentException:
at android.text.method.WordIterator.checkOffsetIsValid (WordIterator.java:380)
at android.text.method.WordIterator.isBoundary (WordIterat... |
2018/03/11 | 510 | 2,233 | <issue_start>username_0: I have been trying to download a program off of a website and then run said program. When I run it I get the following exception. I am new to C# so please use simple language.
System.ComponentModel.Win32Exception: 'The process cannot access the file because it is being used by another process'... |
2018/03/11 | 1,040 | 3,198 | <issue_start>username_0: Looks like I seem to have some fundamental gaps in my understanding of how images are represented in numpy arrays.
```
img = np.ones([100,100,3], dtype=np.uint8)*255
plt.imshow(img)
```
The above code creates a "white" 3 channel image.
Each pixel has the value [255,255,255]
Understood.
... |
2018/03/11 | 1,032 | 3,901 | <issue_start>username_0: First, I'm relatively new to the react world having coded largely APIs for the majority of my career. I'm building a react application for a non-profit and I'm just trying to get off of the ground.
I've added a header class as follows:
```
import './header.css';
import * as React from 'react'... |
2018/03/11 | 398 | 1,446 | <issue_start>username_0: When overriding `ModelAdmin.save_model()`, I want to be able to run some calculations between the object's new values vs its old ones. Is there any way that I can get the "old object" with all its previous data before the change?
For example, if I have an `Object` with `obj.name` = "foo" that ... |
2018/03/11 | 513 | 1,980 | <issue_start>username_0: I have started learning Multi Threading in Java. I am writing program for creating Thread.
```
public class CreateThread extends Thread{
public static void main(String[] args) {
**Thread t1 = new Thread();
t1.start()**; // This does not call run method
... |
2018/03/11 | 1,037 | 3,569 | <issue_start>username_0: My code doesn't seem to be able to find a text file I created. The `.txt` file is in the same folder as the `.py-file` named `trivia.txt`. It's from the Python programming for the absolute beginner. I get the following error:
```
>>>
Unable to open the file trivia.txt Ending program
[Errno 2... |
2018/03/11 | 821 | 3,002 | <issue_start>username_0: It seems like the width is always the width of the input we're typing in. Is there no way to make it larger? I have a very small input and can't read the dropdown items. I'm also limited in form space so can't make the input larger.
```
```<issue_comment>username_1: mat-autocomplete styles a... |
2018/03/11 | 1,026 | 4,255 | <issue_start>username_0: In our application we have a requirement that user should be logged in for a certain amount of time which is configurable by system admin, say 10 minutes. We have another requirement that the when user navigates to different parts of the app, this time should be refreshed and set back to that c... |
2018/03/11 | 514 | 1,856 | <issue_start>username_0: I have my main home template, that I would like to extend one of two sets of headers from but I am getting an error that seems to indicate the else does not work in this statement. I also tried changing to an elif for when user is not logged in and the elif was shown as undefined. These are the... |
2018/03/11 | 690 | 2,688 | <issue_start>username_0: How to efficiently post a document to MongoDB without checking if it is already in the collection. Currently, in my JAVA code, I am checking for the existence of document first and then if it is not where I post it. It seems this is very slow because for every document I am placing two queries.... |
2018/03/11 | 711 | 2,716 | <issue_start>username_0: I'm trying to execute the php code dynamically using the filename as the query string like `index.php?q=script1`. What I've done so far, works but only when I use include for the passed file in the main index.
```
php
include("class.php");
if (!empty($_GET['q'])) {
$sp = $_G... |
2018/03/11 | 1,400 | 5,390 | <issue_start>username_0: Can anyone help with this situation? I want to show history in a recycleview in a fragment from firebase database. But doesn't show. What went wrong i can not figure out. The app works fine but showing nothing in recyclerview.
My history class
```
public class History {
public String Date;
p... |
2018/03/11 | 1,190 | 4,559 | <issue_start>username_0: I have a payment form as follows
```
${flash.message}
Secure Checkout
===============
Pay
function sendPaymentDataToAnet() {
var authData = {};
authData.clientKey = "valid key";
authData.apiLoginID = "valid id";
var cardData = {};
cardData.cardNumber = document.getElementById("ca... |
2018/03/11 | 705 | 2,337 | <issue_start>username_0: When I am passing an ArrayList to TreeSet constructor, I am getting the following error:
```
Exception in thread "main" java.lang.ClassCastException: [I cannot be cast to java.lang.Comparable
at java.util.TreeMap.compare(TreeMap.java:1294)
at java.util.TreeMap.put(TreeMap.java:538)
... |
2018/03/11 | 895 | 2,767 | <issue_start>username_0: ```js
let me={
name:"Shivendra",
age:21
}
let you={
name:"Neha",
age:22
}
let mergeMeAndYou={
...me, ...you
}
console.log(mergeMeAndYou);
```
I am getting the output:`- { name: 'Neha', age: 22 }`
Now I was not expecting this. Can any one explain this result ... |
2018/03/11 | 1,214 | 3,511 | <issue_start>username_0: I am playing around with Vuejs in our project. I have used the same technique in my other project and its working. But here I am not able to assign the data return by the fetch request to a json resource.
When I try to access data returned in then and put it in alert it does gives me the data ... |
2018/03/11 | 1,820 | 3,369 | <issue_start>username_0: I have the following pandas Series:
```
data = {(pd.Timestamp('2016-01-01 00:00:00'), datetime.time(0, 0)): 6.885,
(pd.Timestamp('2016-01-01 00:00:00'), datetime.time(0, 5)): 6.363,
(pd.Timestamp('2016-01-01 00:00:00'), datetime.time(0, 10)): 6.093,
(pd.Timestamp('2016... |
2018/03/11 | 439 | 1,593 | <issue_start>username_0: I am very new to angular 5 I am learning component interaction from the official site it's given
```
ngOnChanges(changes: {[propKey: string]: SimpleChange}) {}
```
And in the life cycle hooks
```
ngOnChanges(changes: SimpleChanges) {}
```
I understand that SimpleChanges is an object tha... |
2018/03/11 | 192 | 683 | <issue_start>username_0: I got the error which is `AttributeError: 'module' object has no attribute 'set_random_seed'` when I tried to run `py-faster-rcnn` with my own `dataset.`
Can anyone help me?<issue_comment>username_1: I encountered this issue in a different project, and it was because I had installed tensorflow ... |
2018/03/11 | 175 | 628 | <issue_start>username_0: I want to fill some list with size N with random variable between LB and UB in python 3.6.
Would you please guide me?<issue_comment>username_1: I encountered this issue in a different project, and it was because I had installed tensorflow 2 instead of 1. You can work around that by replacing:
... |
2018/03/11 | 906 | 2,934 | <issue_start>username_0: I try to write a function to check whether two vectors are equal or not:
```
Compare Vec1 [1, 2, 3] Vec1 [1, 2, 4]
Compare VecS ["a","b", "c"] VecS ["a", "b", "d"]
```
However, on my function I have "almost" identical implementation for both cases,
is there a way to **simplify** my code s... |
2018/03/11 | 654 | 2,116 | <issue_start>username_0: I have a makefile:
```
SOURCES= helloworld.c
ifeq ($(OSNAME), linux)
# Object files needed to create library
OBJECTS=$(SOURCES:%.c=%.o)
endif
# Windows Microsoft C/C++ Optimizing Compiler Version 12
ifeq ($(OSNAME), win32)
OBJECTS=$(SOURCES:%.c=%.obj)
endif
#OBJECTS=$(SOURCES... |
2018/03/11 | 799 | 2,891 | <issue_start>username_0: Hi I am kind of new to android, still learning. And my problem is that, for example I have a method which was created in the MainActivity and I need to call it from another class.
Is it a good practice to get the instance of the MainActivity so that I may be able to call the method in the Main... |
2018/03/11 | 417 | 1,506 | <issue_start>username_0: How to produce messages with headers in Kafka 0.11 using console producer?
I didn't find any description in Kafka document about this.<issue_comment>username_1: **Update**: Since Kafka 3.2, you can produce records with headers using the `kafka-console-producer.sh` tool. For details, see <https... |
2018/03/11 | 664 | 2,338 | <issue_start>username_0: This was the question asked to me in interview :
Input:
```
SQL> select col1,col2 from Hakuna_matata;
COL1 ~ COL2
--------------------------------------------------~
A ~ 2
B ~ 1
C ... |
2018/03/11 | 1,552 | 4,266 | <issue_start>username_0: I use doubly linked list to implement Deque in C++.
Destructor:
```
Deque::~Deque()
{
while (this->left_p)
{
node *temp = this->left_p;
this->left_p = this->left_p->next;
delete temp;
}
this->right_p = NULL;
}
```
when i use `valgrind --leak-check=... |
2018/03/11 | 987 | 3,830 | <issue_start>username_0: I have a file where lies my redux actions and reducers. I calling action from one of my components but I am getting an error saying
```
Error: Given action "GLOBAL_TRIVIA_TAB_CHANGED", reducer "TriviaReducer" returned undefined. To ignore an action, you must explicitly return the previous sta... |
2018/03/11 | 798 | 3,319 | <issue_start>username_0: I have been searching for how the delegate works and I tried to do it in my project. Unfortunately, the delegate method I implement does not get called ever. I am trying to do a slide-out navigation panel. so what I did is that I put two uicontainerviews, one is for slide-out navigation panel a... |
2018/03/11 | 979 | 3,070 | <issue_start>username_0: Below is the code of bootstrap drop-down. After selecting any value from the drop down the tick mark '✓' is also getting selected.
```
* --
✓
* 7
* 8
* 9
* 10
* 11
* 12
* 13
* 14
* 15
```
Unable to select values from the drop down.
Below, is the selenium Java code that i used.
```
List d... |
2018/03/11 | 443 | 1,697 | <issue_start>username_0: I have a button `btnCancel_Click` click event handler with the following
**1. Form**
```
Public Class frmDatabase
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Call modApplicationClose(Me)
End Sub
End Class
```
**2. Module**
```
Modul... |
2018/03/11 | 525 | 1,815 | <issue_start>username_0: How to apply runtime button style in android kotlin?
**My Style (themes.xml):**
```
xml version="1.0" encoding="utf-8"?
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorWhite</item>
<ite... |
2018/03/11 | 521 | 2,072 | <issue_start>username_0: I'm recently learning the part of *I/O buffering* of operating system and according to the book I use,
>
> When a user process issues an I/O request, the OS assigns a buffer in the system portion of main memory to the operation.
>
>
>
I understand how this method is able to avoid the swa... |
2018/03/11 | 483 | 1,675 | <issue_start>username_0: Let's say if i have a list containing:
```
lst = [4,0,8,3,1,5,10]
```
and I'm planning to use a heap structure to help me retrieve the top k largest number where k is a user input.
I understand that heap sort is O(N log N) where we first take O(N) time to place them in a min/max heap and th... |
2018/03/11 | 414 | 1,336 | <issue_start>username_0: I have the following code which generates 5 plots in Rstudio Viewer Pane
```
library(highcharter)
library(tidyverse)
for(i in 1:5){
highchart() %>%
hc_add_series(mpg, "point", hcaes(x = displ, y = cty)) %>%
print()
}
```
How can i delete them with code instead on doing it manua... |
2018/03/11 | 246 | 992 | <issue_start>username_0: I published my first app to AppStore last night.
I just want to know if there is code change in my app,
Should I have to re-build and upload .ipa file to itunes connect again?
(Currently, I do not use CodePush and I build app with exp)
Thanks.<issue_comment>username_1: Yes, you will need to ... |
2018/03/11 | 437 | 1,478 | <issue_start>username_0: I have a class B which implements another class A.
In the class A I need to use variables defined in class B
```
class classA {
methodA() {
console.log(parentClass.variableToRetrieve);
}
}
class classB {
constructor() {
this.variableToRetrieve = 1;
this.... |
2018/03/11 | 291 | 921 | <issue_start>username_0: I have razor view her. But now I want to make it dynamic.
```


```
and i was tried dynamic code:
```
@foreach (var item in slides)
{


}
```
But it did not word. How to ... |
2018/03/11 | 639 | 2,300 | <issue_start>username_0: I have only found `MaxPooling2D` and `AveragePooling2D` in keras with tensorflow backend. Have been looking for `MinimumPooling2D`. This github [link](https://github.com/keras-team/keras/issues/2816) suggests to use something like this for minimum pooling (`pool2d(-x)`)
I get an error while us... |
2018/03/11 | 1,198 | 4,734 | <issue_start>username_0: I tend to write a lot of command line utility programs and was wondering if
there is a standard way of messaging the user in Python. Specifically, I would like to print error and warning messages, as well as other more conversational output in a manner that is consistent with Unix conventions.... |
2018/03/11 | 587 | 2,172 | <issue_start>username_0: I dont know how to ask, but this is what i want, i have a set time.
```
int nyhours = 14;
int mymin = 00;
int mysec = 00;
TimeSpan stime = new TimeSpan(nyhours, mymin, mysec);
TimeSpan timeNow = DateTime.Now.TimeOfDay;
TimeSpan trimmedTimeNow = new TimeSpan(timeNow.Hours, timeNow.Minutes, time... |
2018/03/11 | 594 | 2,423 | <issue_start>username_0: I'm using shared element transition when navigate from activity A to activity B.
My issue - calling of `SupportFinishAfterTransition` in activity B makes `OnActivityResult` called after `OnTransitionEnd` with small interval in activity A. So my UI (`ImageView`) in activity A is "flashing" beca... |
2018/03/11 | 484 | 1,955 | <issue_start>username_0: I have written a python selenium code which automates actions on a website. Once user authenticates the log in, selenium takes over the browser and does its thing. Everything works perfectly fine, however, I notice that the code may fail if user accidentally clicks anything on any links while s... |
2018/03/11 | 1,843 | 5,145 | <issue_start>username_0: What is the problem with this code?
```
#include
#include
#include "time.h"
void createNumb(int RandomNumber) {
srand(time(NULL));
int a, b, c, d;
a = rand() % 10 + 0;
b = rand() % 10 + 0;
c = rand() % 10 + 0;
d = rand() % 10 + 0;
while (b == a) {
b = rand() % 10 + 0;
}
whil... |
2018/03/11 | 388 | 1,027 | <issue_start>username_0: How you do include/print labels for statistical output using R code? For example, calculate Mean, Median and StdDev but label them "Mean" "Median" and "Std Dev"<issue_comment>username_1: This is a broad question, and it depends on what exactly you need, but you can create a named vector with th... |
2018/03/11 | 252 | 833 | <issue_start>username_0: List item
---------
```
* language
< v-if= "tree()"> //which tag I may use or any other process
* home
* about
<>
< v-else> //which tag I may use or any other process
* accounts
* listing
<>
'
```
In the `V-if` which html tag i may use or any other `vue.js` process to work with thi... |
2018/03/11 | 1,301 | 3,811 | <issue_start>username_0: I have two tables. One stores "locations":
```
TABLE location (
ID serial PRIMARY KEY,
name text NOT NULL,
description text NOT NULL
);
```
Each location has many rows of "data":
```
TABLE data(
ID ... |
2018/03/11 | 318 | 1,363 | <issue_start>username_0: ```
SQLiteDatabase db = mDbHelper.getReadableDatabase();
String[] projection = {
HistoryEntry._ID,
HistoryEntry.COLUMN_HISTORY_INPUT,
HistoryEntry.COLUMN_HISTORY_RESULT
};
Cursor cursor = db.query(HistoryEntry.TABLE_NAME,
projection,
... |
2018/03/11 | 640 | 2,514 | <issue_start>username_0: I have a problem with my `AsyncTask`.
I make the ProgressBar visible in `onPreExecute` and invisible in `onPostExecute`. This works properly for 1 call in a row or if I wait before the last one is finished. But when I start multiple of these AsyncTasks in a row, the `onPostExecute` of the last ... |
2018/03/11 | 1,326 | 3,742 | <issue_start>username_0: I have an array of array (`map`) like this one:
```
var map = [
['red', 'blue', 'yellow'],
['car', 'pen', 'table', 'cup', 'pillow'],
['5', '6', '1', '2', '10'],
['15', '2', '2', '3', '20'],
['50', '60', '13', '1', '1']
];
```
I want convert this array in this arrray of ob... |
2018/03/11 | 1,978 | 5,925 | <issue_start>username_0: I have a standard xgboost classification model that has been trained and now predicts a probability score. However, for the purposes of making the user interface simpler, I would like to convert this score to a 5 star rating scheme. I.e. discretizing the score.
What are intelligent ways of de... |
2018/03/11 | 2,005 | 5,871 | <issue_start>username_0: I have an enum:
```
public enum EnumProductConfig
{
Color,
Fold,
Edge,
Hem,
Lift,
Tapes,
Control,
Clips,
Pull,
Val
}
```
The order of above values in enum is not alphabatical which is totally ok with me.
Now, I have a list with one of the property... |
2018/03/11 | 479 | 1,712 | <issue_start>username_0: ```
Console.Write("Enter a limit to the prime numbers you want displayed: ");
userInput = Console.ReadLine();
int newUserInput = Convert.ToInt32(userInput);
if (!int.TryParse(userInput, out newUserInput))
{
Console.WriteLine("\nThe value entered must be a whole number. Please try again: "... |
2018/03/11 | 1,014 | 4,175 | <issue_start>username_0: How does a Java program get the full A1 notation of a Google Sheets `NamedRange`, including its `!` prefix?
To read a range of cells in a sheet, call `Spreadsheets.Values.get(String spreadsheetId, String range)` where `range` is in A1 notation. But when getting a range as a `NamedRange` there ... |
2018/03/11 | 609 | 1,838 | <issue_start>username_0: I am getting an error of date conversion, please help me. Thank you for all.
```
protected void getdate(object sender, EventArgs e)
{
DateTime dt2 = Convert.ToDateTime(txtdate.Text);
DateTime dt3 = dt2.AddDays(9);
txtlastdate.Text = dt3.ToString();
}
```<issue_comment>user... |
2018/03/11 | 684 | 2,215 | <issue_start>username_0: Trying to add EF database first in Class library project but it fails and gives an error
>
> Startup project 'Api.DB.csproj' targets framework '.NETStandard'.
> There is no runtime associated with this framework, and projects
> targeting it cannot be executed directly. To use the Entity Fra... |
2018/03/11 | 417 | 1,499 | <issue_start>username_0: I am retrieving an AngularFireStoreCollection in my Ionic app using following
```
this.analysisProvider.getAllOrders().valueChanges()
.map(ordercoll=>ordercoll)
.pipe(mergeMap(orddoc=>orddoc)).map(ord=>ord.orderdetails).map(res=>res)
.subscribe(val=>{
console.log('res=',val);
})
```
Th... |
2018/03/11 | 394 | 1,208 | <issue_start>username_0: I am confused about python's evaluation of default function arguments. As mentioned in the documentation (<https://docs.python.org/3.6/tutorial/controlflow.html#more-on-defining-functions>)
```
def f(a, L=[]):
L.append(a)
return L
print(f(1))
print(f(2))
print(f(3))
```
results in
... |
2018/03/11 | 264 | 926 | <issue_start>username_0: I have an SVG path (as below) that I want to use as a background in a div, does anyone know how to do this, I've searched the web but cant find any simple examples?
```
```<issue_comment>username_1: you can't define an inline svg as background. You have 2 solutions here :
1 - store the svg ... |
2018/03/11 | 343 | 1,196 | <issue_start>username_0: I have to hide one dive with ✓ (sign in part) & show another div with remove ✓ (sign up part) on my login page.
I used from ng-if & run show part; but I don't know how hide another part at the same time.
```
**Sign in
New User?
Please fill in this form to create an account.
---
**Emai... |
2018/03/11 | 660 | 2,268 | <issue_start>username_0: I have list of strings. At some point I need to check if list contains some string.
For example:
```
public List Headers { get; private set; }
Headers = new List();
Headers.Add("bla1 bla1 ");// pay attention to the whitespace at the end
Headers.Add("bla2 bla2");
Headers.Add("bla3 bla3"... |
2018/03/11 | 1,028 | 3,736 | <issue_start>username_0: I'm writing a macro in Word to remove the highlighting from all hyperlinks highlighted with `wdGray25`. The search for all hyperlinks is done by
```
For Each oLink In ActiveDocument.Hyperlinks
If oLink.Range.HighlightColorIndex = wdGray25 Then
oLink.Range.HighlightColorIndex = wdNoHig... |
2018/03/11 | 1,077 | 3,489 | <issue_start>username_0: I have seen both ways but I do not understand what the difference is and what I should use as "best practice":
```
def custom_function(**kwargs):
foo = kwargs.pop('foo')
bar = kwargs.pop('bar')
...
def custom_function2(**kwargs):
foo = kwargs.get('foo')
bar = kwargs.get('b... |
2018/03/11 | 918 | 3,268 | <issue_start>username_0: I have a endpoint up and running in AWS Sagemaker. However, I'm not sure how to send data to this endpoint and get back a prediction.
The documentation is also not clear on this. Any help would be appreciated.<issue_comment>username_1: The way to call the endpoint is through the invoke-endpoi... |
2018/03/11 | 665 | 1,850 | <issue_start>username_0: In the transport optimization problem of PuLP:
```
from pulp import *
Warehouses = ["A","B"]
# Creates a dictionary for the number of units of supply for each supply node
supply = {"A": 1000,
"B": 4000}
# Creates a list of all demand nodes
Bars = ["1", "2", "3", "4", "5"]
# Creates ... |
2018/03/11 | 792 | 2,004 | <issue_start>username_0: I want to remove part of string from special world using php lang for example :
```
$string1 = "xABCb1/DEF/GHI/GKL";
$string2 = "yABCz/DEF/MNO/PQR";
$string3 = "zABC1112/DEF/STU/VWX";
```
I want to remove all words before from (DEF) and the result looks like this
```
$string1 = "DEF/GHI/GKL... |
2018/03/11 | 1,151 | 3,476 | <issue_start>username_0: I have two arrays `A = [0,1,2]` and `B = [2,1,0]`. How to check if a number in A is present in B?<issue_comment>username_1: **NOTE: `includes` is not ES6, but ES2016** [Mozilla docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Specifications).... |
2018/03/11 | 1,293 | 3,935 | <issue_start>username_0: I am new to PHP and I want to apply If condition to price attribute in magento whenever Price is less than or equals to zero I want a block disappear and show when price attribute is greater than 0 then block should show up
Here is the code
If I have done any thing wrong in the code please let... |
2018/03/11 | 722 | 2,496 | <issue_start>username_0: I am trying to use the library **secrets** on Python 3.5 on Ubuntu 16.04. It does not come with the python installation and I am not able to install it through pip. Is there a way to get it to work on python 3.5?<issue_comment>username_1: The module you are trying to use wasn't part of Python a... |
2018/03/11 | 558 | 1,971 | <issue_start>username_0: i've got started studying Flutter. I'm trying to using MethodChannel and MethodCall to communicate with Android platform. I don't know how to pass arguments to the Android code.
Below is my code.
```
// dart
void _onClick() async {
var parameters = {'image':'starry night'};
await pla... |