date stringlengths 10 10 | nb_tokens int64 60 629k | text_size int64 234 1.02M | content stringlengths 234 1.02M |
|---|---|---|---|
2018/03/18 | 283 | 893 | <issue_start>username_0: Is there a simple regular expression that would insert a character, say a colon :, every n characters, say 2, from right to left in a string?
For example...
059 -> 0:59
14598 -> 1:45:98
340001 -> 34:00:01<issue_comment>username_1: If your environment is supporting [lookarounds](https://www.... |
2018/03/18 | 1,063 | 4,366 | <issue_start>username_0: I am trying to determine what the difference is between a changestream:
<https://docs.mongodb.com/manual/changeStreams>
<https://docs.mongodb.com/manual/reference/method/db.collection.watch/>
which looks like so:
```
const changeStream = collection.watch();
changeStream.next(function(err, nex... |
2018/03/18 | 562 | 2,008 | <issue_start>username_0: ```
function addProperty(object, property) {
// add the property to the object with a value of null
// return the object
// note: the property name is NOT 'property'. The name is the value of the argument called property (a string)
}
```
I got a little stuck on an only home work questi... |
2018/03/18 | 440 | 1,520 | <issue_start>username_0: I'm reading lines from a file and I might have a comment anywhere throughout it of any size.
```
while (fgets(line, 100, myFile))
{
// skip and print comment
if (line[0] == '#') printf("Comment is = %s", line);
else {...}
}
```
T... |
2018/03/18 | 788 | 3,150 | <issue_start>username_0: I've been running through a few tutorials for Java, they all say to make a new variable when calling classes. Why is this? I've tested some code and it works without doing this.
I've been using python for quite a while now so I'm used to using a dynamic language.
Please see some code I've been... |
2018/03/18 | 829 | 3,054 | <issue_start>username_0: Let's say I have 4 apps, "Uber Clone" for iOS and Android and "Uber Driver Clone" for iOS and Android. I am using the same Firebase project for all 4 since they share the same database.
When it comes to Facebook Auth though, I can only add a single Facebook app to Firebase. And for every Face... |
2018/03/18 | 835 | 3,094 | <issue_start>username_0: ```
int filter(int m, int readfd, int writefd)
```
I have a function named filter that takes three arguments: the filter value m, a file descriptor readfd from which integers are received, and a file descriptor writefd to which integers are written. Its purpose is to remove (filter) any integ... |
2018/03/18 | 959 | 3,550 | <issue_start>username_0: Some websites detect my operating system architecture automatically and I don't know how they get the value (eg. 32-bit / 64-bit OS). So they can use the value for the following case:
Example of the case:
If I want to download something for Example 'Google Chrome', the Google Chrome Download ... |
2018/03/18 | 1,013 | 3,637 | <issue_start>username_0: I have nodejs code running inside a pod. From inside the pod I want to find the zone of the node where this pod is running. What is the best way do do that? Do I need extra permissions?<issue_comment>username_1: You can use `failure-domain.beta.kubernetes.io/region` and `failure-domain.beta.kub... |
2018/03/18 | 1,315 | 4,620 | <issue_start>username_0: Can someone help me figure out the problem i'm new on JSF. I have built a Spring WebMVC App with Primefaces. This app contains a list of nodes which can be dragged into the spreadSheet (I m working with SpreadJS). Behind each node there is a model and a bean. Evey node has a name and an input t... |
2018/03/18 | 290 | 1,100 | <issue_start>username_0: When I add a foreign key to a table that already has data, what does each of these database management systems do?
Do they analyze each value of the column to confirm it is a value from the referenced table primary key ?
Or do they have some other optimized mechanism ? And if that's the case,... |
2018/03/18 | 575 | 1,972 | <issue_start>username_0: I want to compare the interval of two datetimes to see if the interval is in the past, in the future or now.
```
$current_time = new DateTime();
$datetime1 = new DateTime('2018-03-17 18:25:00');
$datetime2 = new DateTime('2018-03-17 20:00:00');
if($current_time >= $datetime1 && $current_time... |
2018/03/18 | 817 | 3,206 | <issue_start>username_0: I try to install Hybris on ubuntu. But I get the following error :
```
[java] WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
[java] Please consult the Reference Guide. To override this
check, start with argument '-force'
```
when I typ... |
2018/03/18 | 1,331 | 4,631 | <issue_start>username_0: I am trying to toggle a font awesome icon based on a boolean value but it seems that the font-awesome icon remains on the screen after it is drawn:
<https://jsfiddle.net/50wL7mdz/200312/>
HTML:
```

```
JS:
```
new Vue({
el: '#app',
data: {
marked: false
}
})
```
Am I doing ... |
2018/03/18 | 1,602 | 5,408 | <issue_start>username_0: I have this hash that contains some information:
```
my %hash = (
key_1 => {
year => 2000,
month => 02,
},
key_2 => {
year => 2000,
month => 02,
},
key_3 => {
year => 2000,
month => 03,
},
key_4 => {
year =... |
2018/03/18 | 1,795 | 6,283 | <issue_start>username_0: so this is a tag on from my previous stackoverflow post:
[Django updateView saving another instance instead of updating](https://stackoverflow.com/questions/49341267/django-updateview-saving-another-instance-instead-of-updating?noredirect=1#comment85682686_49341267)
and i think i've narrowed ... |
2018/03/18 | 1,507 | 5,761 | <issue_start>username_0: I am trying to relate my Picture Model to the User Model by `belongsTo` and `hasMany` methods.
---
Heres the code written in `Picture.php` model file:
```
php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Picture extends Model{
public function user()
{
return $thi... |
2018/03/18 | 2,665 | 8,300 | <issue_start>username_0: I'm currently trying to learn Swift and haven't gotten very far yet, so forgive me if this is an easy problem; I've been working on it for hours now and haven't been able to figure it out.
I have a `Codable` class called `Person`. On this class I have a `Date` property called `birthdate`. So i... |
2018/03/18 | 920 | 3,044 | <issue_start>username_0: Let's figure a simple sum app. two inputs, `a` and `b` and a `c` result.
we have this markup
```
{{v3}}
```
and this Vue script
```
var vm = new Vue ({
el: "#app",
data: {
a:0,
b:0,
},
computed: {
c:function(){
return this.a + th... |
2018/03/18 | 2,199 | 9,673 | <issue_start>username_0: I am trying to follow a YouTube tutorial and learn Swift by making a simple card game. After completing the tutorial I wanted to add some features of my own such as resetting the score and cards once the app is opened. When I say opened I mean either entering the foreground or launching the app... |
2018/03/18 | 510 | 2,221 | <issue_start>username_0: I have a web service that I want to send some information but I don't care about the response from that server. I just want to give the server the information and it does whatever it wants with it.
How could I do that in iOS with objective-C? I'm using at the moment a background thread web cal... |
2018/03/18 | 559 | 2,325 | <issue_start>username_0: So I am trying to make a quote system for a chat bot, and I'm having trouble with storing them. I have decided to move away from using a database because of how small scale it is, but I want to be able to constantly add to the file, is there any way I am able to find how many "variables" alread... |
2018/03/18 | 5,696 | 15,919 | <issue_start>username_0: How I can know what is the problem when there is no stack trace? Can I enable some option?
I just created small project with spring initializer and this is what I'm getting
Updated log(With debug flag)
```
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\... |
2018/03/18 | 969 | 3,964 | <issue_start>username_0: I want to save my data in table order by time that they insert, but in SQL Server they will order by primary key.
What can I do ?<issue_comment>username_1: You would have to make the date/time the primary key then, which is a bad idea. If the table has an auto-incrementing primary key then it ... |
2018/03/18 | 418 | 1,297 | <issue_start>username_0: I'm studying how to use mongoDB.
I want to update a certain field of a document but it overwrites the whole document. How can I update only the field in a document I want to modify?
```
db.products.find({_id: 1})
{
"_id" : 1.0,
"name" : "aaa",
"category" : "toy",
"price" : 10... |
2018/03/18 | 740 | 2,445 | <issue_start>username_0: I have spent hours trying to figure this out, so I apologize if it's an easy fix.
I would like to make this program more user-friendly. Everything works currently, but the sentinel requires I enter "0" for both miles drive and gas used. I would like the sentinel to end the program after I ent... |
2018/03/18 | 600 | 2,171 | <issue_start>username_0: My assignment is essentially to ask the user "how many numbers do you want to enter" then if the user, for example, enters 2 number it says which is the highest number. What I'm having trouble with is comparing those numbers since they are in a loop.
```
cout<<"how many #s do you want to enter... |
2018/03/18 | 394 | 1,125 | <issue_start>username_0: Using xpath, how can I get all anchor tags except the ones in italics from the second paragraph? (Question and example has been simplified. Imagine a regular HTML page with multiple and ).
```
[A](a.html)
**[B](b.html)**
*[C](c.html)*
**[E](e.html)**
[F](f.html)
*[G](g.html)*
```
Sh... |
2018/03/18 | 684 | 2,236 | <issue_start>username_0: I would like to find all subsets of a sorted string, disregarding order and which characters are next to each other. I think the best way for this to be explained is though an example. The results should also be from longest to shortest.
These are the results for `bell`.
```
bell
bel
bll
ell
... |
2018/03/18 | 1,472 | 3,932 | <issue_start>username_0: I am trying to write C code that will have an effect equivalent to the following assembly code:
```
addq %rsi, %rdi
imulq %rdx, %rdi
movq %rdi, %rax
sarq $15, %rax
salq $31, %rax
andq %rdi, %rax
ret
```
With a function prototype
long decode(long x, long y, long z)
Parameters x, y, and z ar... |
2018/03/18 | 552 | 1,955 | <issue_start>username_0: CustomerID, is unique.
What result is given with this question?
```
SELECT personalnumber,
Amount = Count(CustomerID),
FROM Customer
GROUP BY personalnumber
HAVING Count(CustomerID) > 100
```
What does it mean that
having count(CustomerID) > 100?? Is it that the CustomerID has... |
2018/03/18 | 775 | 2,758 | <issue_start>username_0: I have created a network using high level tf APIs such as tf.estimator.
Training and evaluating work fine and produce an output. However when predicting on new data, `get_inputs()` requires `label_data` and `batch_size`.
The error is: `TypeError: get_inputs() missing 2 required positional arg... |
2018/03/18 | 1,264 | 3,383 | <issue_start>username_0: I am using MPLAB to perform an operation on PIC kit 14f458.
Now I want to create a code to pass the different amount of voltage supply LED through the Microcontroller using a button. When button pressed the first time I should get waveform with 10% DC, for second and third time, 50% and 95% re... |
2018/03/18 | 634 | 2,551 | <issue_start>username_0: I would like to generate random terms based on some sort of "context" and I was wondering if this is possible using quickcheck. Basically I would like to have an additional data type passed around so that the arbitrary function can generate terms based on the additional parameter... Is this pos... |
2018/03/18 | 329 | 798 | <issue_start>username_0: I need to get the following equation echoed to the command line, and also saved into a variable. So far I have failed to do either.
5^0.16
What I have tried.
```
echo 'e(l(5)*.16)' | bc -l
```
as well as
```
echo 'e(l(5)*.16)' | bc -l | read wcEXP
```<issue_comment>username_1: How about
... |
2018/03/18 | 743 | 1,945 | <issue_start>username_0: how to fix padding behavior for element with more than 100% width? indent on the right side of table collapses
```css
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
padding: 30px;
}
table {
border-collapse: collapse;
width: 150%;
}
th, td {
border: 1px s... |
2018/03/18 | 2,197 | 3,376 | <issue_start>username_0: I have the following script:
```
curl -s -S 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-NBT&tickInterval=thirtyMin&_=1521347400000' | jq -r '.result|.[] |[.T,.O,.H,.L,.C,.V,.BV] | @tsv | tostring | gsub("\t";",") | "(\(.))"'
```
This is the output:
```
(2018-03-17T18:30... |
2018/03/18 | 1,762 | 3,649 | <issue_start>username_0: If you just use something like this:
```
\(
\left[
\begin{matrix}
0 & 1 & 5 & 2 \\
1 & -7 & 1 & 0 \\
0 & 0 & 1 & 3
\end{matrix}
\right]
\)
```
the negative signs don't line up.
[.
I'm pretty sure it doesn't matter, but I want to use it with an `AppBar` and a `Drawer`.<issue_comment>username_1: This is the css for bootstrap con... |
2018/03/18 | 5,892 | 17,709 | <issue_start>username_0: I'm trying to get a countdown timer to work on my web page, but its not working, and I can't figure out why. I don't know if its because I linked it wrong in my HTML or if its because I missed something in my code. Any help would be appreciate.
```js
"use strict";
setInterval(function() { ..... |
2018/03/18 | 1,051 | 3,906 | <issue_start>username_0: I have 2 components and a service. BehaviorSubject in the service class has default values and also it pulls in data from an API. The first component gets the latest data which is pulled from the API, but the second component only displays the default values. What could be wrong in my code. Plz... |
2018/03/18 | 504 | 1,478 | <issue_start>username_0: ```
A B C D E F G H
1 Y Y Y X
2 X X
3 Y Y
4 X X
5 Y Y Y X
Count the number of empty rows (from Columns A to E) and put result here. Answer should be 2 from example above.
```
Hi Folks,
I'm struggling to find th... |
2018/03/18 | 615 | 2,291 | <issue_start>username_0: Do you have any idea how to fix this? The Windows Power Shell returns the following when I type in "flutter doctor":
>
> `The term 'flutter' is not recognized as the name of a cmdlet,
> function, script file, or operable program.
>
>
> Check the spelling of the
> name, or if a path was i... |
2018/03/18 | 1,036 | 3,406 | <issue_start>username_0: Currently, I imported the following data frame from Excel into pandas and I want to delete duplicate values based in the values of two columns.
```
# Python 3.5.2
# Pandas library version 0.22
import pandas as pd
# Save the Excel workbook in a variable
current_workbook = pd.ExcelFile('C:\\... |
2018/03/18 | 582 | 1,695 | <issue_start>username_0: I'm trying to grab the username from this JSON in PHP:
```
["{\"account\":{\"username\":\"test\",\"password\":\"hey\",\"info\":{\"ip\":\"172.16.17.32\",\"proxyMethod\":\"TOR\",\"time\":\"2018-03-17 05:32:58\"}}}"]
```
The JSON is stored in a file. While I have the code down to grab the JS... |
2018/03/18 | 870 | 2,637 | <issue_start>username_0: There are two maps with same structure say map1 and map2 having structure as `Map`.
Map 1 contains following items:
`("i1", True),("i2", True), ("i3", False), ("i4", True)`
Map 2 contains following items:
`("i1", True),("i2", False), ("i3", True), ("i5", True)`
I want two kinds of ... |
2018/03/18 | 1,100 | 4,039 | <issue_start>username_0: I'm just starting to learn how to use Hibernate and I'm not be able to figure out how to properly annotate a list when it's referencing an interface.
This is my case, I have a class MarketOrderImpl that implements MarketOrder like so...
```
@Entity
public final class MarketOrderImpl implemen... |
2018/03/18 | 200 | 772 | <issue_start>username_0: I want to make a gallery system in laravel 5.5. So that every time i upload photos it shows in a different album with 1st photo and title that i uploaded. And after clicking to that album shows the other photos of that album. How can i do it?<issue_comment>username_1: Manke two database named g... |
2018/03/18 | 792 | 3,198 | <issue_start>username_0: I have a multiprocessing program where I'm unable to work with global variables. I have a program which starts like this:-
```
from multiprocessing import Process ,Pool
print ("Initializing")
someList = []
...
...
...
```
Which means I have someList variables which get initialized before my... |
2018/03/18 | 1,282 | 3,866 | <issue_start>username_0: So I wrote this code to remove the vowels from any string given.
it should work fine. And it actually does. Just not for all strings
which is weird why it would work for some strings and not for others
here's the code:
```
vowels = ["a", "e", "i", "o", "u"]
def anti_vowel(text):
text1 = lis... |
2018/03/18 | 1,084 | 3,275 | <issue_start>username_0: I've just started learning R, and was wondering, say I have the dataset quake, and I want to generate the probability histogram of quakes near Fiji, would the code simply be `hist(quakes$lat,freq=F)`?<issue_comment>username_1: You don't have to convert the string to a list. Refer to this answer... |
2018/03/18 | 762 | 2,296 | <issue_start>username_0: data in database
```
fieldA : 'aaaaa',
fieldB : {
en : 'aaaaaaaaaa',
de : 'bbbbbbbbbb'
}
```
new data
```
val = {
fieldA : 'aaaaa11',
fieldB : {
en : 'aaaaa1111'
}
}
```
i tried this code
```
Model.findOneAndUpdate({fieldA : val.fieldA},{ $set : val})
... |
2018/03/18 | 585 | 1,901 | <issue_start>username_0: i have the following
```
Directory: C:\TWS API\source\pythonclient
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/17/2018 9:38 PM ibapi
d----- 3/17/2018 9:38 PM tests
-a--... |
2018/03/18 | 459 | 1,545 | <issue_start>username_0: I have a Pandas DataFrame with two relevant columns. I need to check column A (a list of names) against itself, and if two (or more) values are similar enough to each other, I sum the values in column B for those rows.
To check similarity, I'm using the FuzzyWuzzy package that accepts two strin... |
2018/03/18 | 803 | 2,554 | <issue_start>username_0: Trying to take an integer and return it from the function as an descending integer.
I did it first like this:
```
def Descending_Order(num):
n = str(num)
return(int(n[::-1]))
```
Because the tests only had numbers that were in descending order; kinda cheezy but hey it worked.. Now I... |
2018/03/18 | 715 | 2,358 | <issue_start>username_0: The method I have is supposed to return a String [] so i used toArray method. But I get error regarding object cannot be converted to strings. I have initialized the list as String as well and am unable to figure out the error that I am getting. Everywhere I read, they say initialize as String ... |
2018/03/18 | 2,137 | 6,508 | <issue_start>username_0: I have two list object A and B like this:
```
A=[
{item:1, value:"ex1"},
{item:2, value:"ex1"},
{item:3, value:"ex1"},
{item:4, value:"ex1"}]
B=[{item:1, value:"ex2"},
{item:4, value:"ex2"},
{item:2, value:"ex3"},
{item:5, value:"ex3"}]
```
How can i do to make B to have sa... |
2018/03/18 | 1,972 | 6,201 | <issue_start>username_0: Sorry I'm finding it difficult to word the issue I'm having correctly..
I have an array called `feedCounter` and an array called `postFeed`. I want to display the length of `feedCounter` and when a user clicks on it `postFeed` becomes equal to `feedCounter`, but when `feedCounter` gets a new ... |
2018/03/18 | 1,913 | 5,894 | <issue_start>username_0: I cannot figure out how to apply background color to the cell in OpenTBS.
I've tried Word's syntax but it did not work.
```
[row.cell.val][row.cell.bg;att=w:shd#w:fill]
```
Code in PHP (simplified)
```
$rs = [
// ...
'cell' => [
'val' => 5,
'bg' => 'efefef',
... |
2018/03/18 | 1,176 | 4,117 | <issue_start>username_0: My requirement is something like this.
1. I am rendering a question paper from an object using v-for.
2. Once the user **select an answer for a question**, the **question number (index) has to be v-model** with that answer. How can I achieve this? this is my code.
```js
Question {{index}}
=... |
2018/03/18 | 3,557 | 9,781 | <issue_start>username_0: I'm trying to understand assembly in x86 more. I have a mystery function here that I know returns an `int` and takes an `int` argument.
So it looks like `int mystery(int n){}`. I can't figure out the function in C however. The assembly is:
```
mov %edi, %eax
lea 0x0(,%rdi, 8), %edi
sub %ea... |
2018/03/18 | 515 | 1,281 | <issue_start>username_0: I select an input on cell L10 using a drop down list.
The values of the list are AH11, AH12, AH13, AH14, AH15 and AH16
Base on this selection, I want to auto populate the value in another cell.
I used the following formula in my target cell
```
=IF(OR(L10="AH11",L10="AH12"),"6",IF(OR(L10="A... |
2018/03/18 | 1,654 | 5,268 | <issue_start>username_0: I have a float for totalPoints which is being automatically increased by the Timer, but after totalPoints reaches certain number, it doesn't seem to increase no more. I did not put any limits so I'm not sure why is it happening.
So, totalPoints stops increasing when it reaches "2097152" value.... |
2018/03/18 | 1,464 | 3,456 | <issue_start>username_0: I'm trying to come up with a function that does the following to a `data.frame` outputting a new `data.frame` with the same names:
**1-** Creates a `seq(min(target), max(target), .1)`.
**2-** Takes the *mean of all other* variables.
For example, if `q` is our `data.frame`, and `jen` is the `... |
2018/03/18 | 937 | 3,310 | <issue_start>username_0: I've just started with Jekyll and have been working through tutorials. I wanted to try one of the supported gem-based themes instead of the default Minima theme. Running on `localhost:4000` ...
No matter what I do, my site renders using the Minima theme. I've read elsewhere about pages *not re... |
2018/03/18 | 302 | 954 | <issue_start>username_0: I can say - (if key = 'Left') or (if key = 'Right'), but for some reason i can't say - (if key = 'Enter'). Why isn't this working? Can I not use the enter key for getKey in graphics.py?<issue_comment>username_1: The key value comes from the `_onkey` event listener:
```
def _onKey(self, evnt):... |
2018/03/18 | 650 | 2,336 | <issue_start>username_0: I understand the whole process of dialogflow and I have a working deployed bot with 2 different intents. How do I actually get the response from the bot when a user answers questions? (I set the bot on fulfillment to go to my domain). Using rails 5 app and it's deployed with Heroku.
Thanks!<is... |
2018/03/18 | 570 | 1,894 | <issue_start>username_0: I have a content column in my table data and it is varchar type. I wonder is there a way to just show part of the content if it has long text like 2000 characters. I just don't want to see everything displayed in my row unless I want to click on it. Partial texts in option is checked by default... |
2018/03/18 | 302 | 1,124 | <issue_start>username_0: I am trying to create an Android calculator which uses strings in Kotlin. I do not know how to delete a comma (or the negative) if it already contains one.
Here is my code which adds the comma correctly but doesn't delete it if the user clicks again:
```kotlin
if (!buClickValue.contains("."))... |
2018/03/18 | 1,151 | 3,401 | <issue_start>username_0: Is there any way to replace range of numbers wih single numbers in a character string? Number can range from n-n, most probably around 1-15, 4-10 ist also possible.
the range could be indicated with a) -
```
a <- "I would like to buy 1-3 cats"
```
or with a word b) for example: to, bis, jus... |
2018/03/18 | 979 | 2,937 | <issue_start>username_0: I want to design an API that serves all the files in my django media directory in response to a GET request-- what should my app's view.py look like?<issue_comment>username_1: This is, in fact, a little tricky, unless someone has already written a package that does this (that I'm not aware of).... |
2018/03/18 | 1,036 | 3,081 | <issue_start>username_0: ```
int main() {
char *p[] = {"hello", "goodbye"};
char **a;
a = malloc(4 * 8);
}
```
I want a to have double the slots of p. How would I successfully do that without manually putting in numbers. All IK is the size of p should be there and x 2 for the double. How would I get the 8?<i... |
2018/03/18 | 1,036 | 3,869 | <issue_start>username_0: I want to ensure that a password a user enters is at least 7 characters long and has at least one uppercase letter, one lowercase letter, one number, and one symbol.
The code seems to pass through the if loop until the symbol argument where it gets stuck.
```
puts "Please enter your desired p... |
2018/03/18 | 827 | 3,351 | <issue_start>username_0: Write a public static method named q1 that takes no parameters and has return type boolean. This method will attempt to open a file named "location.txt" and returns true if the file exists and contains the String "statistical" as a sub-String on any line, and false if "statistical" is not found... |
2018/03/18 | 799 | 3,342 | <issue_start>username_0: I usually set all my auto layout code in the updateCOnstratins method of my view controller for the constraints of all the subclasses defining the view. Then in the subviews I place my constraints in the updateConstraints methods there. This makes me have a property of every single view in my c... |
2018/03/18 | 1,039 | 3,480 | <issue_start>username_0: I am new to programming and trying to grasp the concepts. What I am trying to accomplish:
1. Loop through first table to get a string to search for
2. Then find the first instance of that string in a second table (if it exists)
3. Then insert/copy a row (from the first table) into the second ... |
2018/03/18 | 768 | 1,756 | <issue_start>username_0: I have a string:
```
key = "41521"
```
And I want to convert it into an array like this:
```
array = [41, 15, 52, 21]
```
I went about it like so:
```
array = []
array << key[0..1].to_i
array << key[1..2].to_i
array << key[2..3].to_i
array << key[3..4].to_i
```
What would be a better ... |
2018/03/18 | 1,021 | 2,306 | <issue_start>username_0: I am trying to write a python 3 code for following function:
I have a list named Config,
```
Config = [[32, 31, 33, 34], [32, 42, 13, 33], [32, 42, 34, 44], [42, 42, 43, 44]]
```
This list has 4 sublists.
Now I want to get a new list from Config as follows (without first and fourth subli... |
2018/03/18 | 753 | 2,855 | <issue_start>username_0: I am new to RxJS and I am trying to subscribe to an observable function in two different and I am wondering if there is a way to trigger a call from one of the functions can also change the outcome in the second file.
I have an action creator and authGuard subscribe to my loginService and I am... |
2018/03/18 | 646 | 2,330 | <issue_start>username_0: ```
from sys import argv
def prime():
for i in range(2,num):
if num % i == 0:
print(f"{num} can be divisible by {i}.")
checker = False
num = int(input("Enter the number you want to check is prime: "))
checker = True
if num < 2:
print(f"{num} is a prime number.... |
2018/03/18 | 578 | 2,130 | <issue_start>username_0: I am trying to insert a data object via web API to the database. when I using the Postmen, POST request is the success. but in angular 5 app post request indicates 500 Internal saver error. here is my source code.
player.service.ts
```
@Injectable()
export class PlayerService {
private _... |
2018/03/18 | 2,105 | 8,084 | <issue_start>username_0: I am trying to validate multiple groups of radio buttons with pureJS. Basically my client has a group of around 50 questions, and each one has 4 radio buttons that can be used to pick 1 of 4 answers.
They do not want to use jQuery, but pureJS, I have gotten the following to work when there is ... |
2018/03/18 | 620 | 2,183 | <issue_start>username_0: I am in the process of moving my NodeJS backend over to Python3.6.
In NodeJS I was able to use the aws SDK to get items between two dates like so :
```
```
var now = moment().tz("Pacific/Auckland").format()
var yesterday = moment().add(-24,"Hours").tz("Pacific/Auckland").format()
var docClie... |
2018/03/18 | 484 | 1,692 | <issue_start>username_0: I need a simple python program that looks for a string in a list and if it doesn't find it generates the next one in **alphabetical DESCENDING ORDER**
.By that, I meant if it does not find **'abz'** it will generate **ac** deleting the last char when it reaches *'z'*.
Another example:
I have ... |
2018/03/18 | 815 | 2,292 | <issue_start>username_0: I am just learning about mutexess. I thought the following program would return a total of 1000, but I am getting varied results, so I assume I am doing something wrong...
```
package main
import (
"fmt"
"sync"
)
var total int
var locker sync.RWMutex
func add() {
for x := 1; x <... |
2018/03/18 | 3,738 | 6,920 | <issue_start>username_0: I am trying to determine the number of times that x or y individuals (represented by a unique number each) are dominant to each other. I have used count to summarize the data:
```
Dominance1<-count(Dominance, c('Dominant', 'Subordinate'))
```
And the data look like this:
```
> Dominan... |
2018/03/18 | 548 | 1,959 | <issue_start>username_0: I'd like to use a selector to grey out an icon when it is not enabled. It seems that something like this should work (with a white background):
```
android:alpha="0.5"
android:alpha="1"
```
But it results in a java.lang.NumberFormatException during run time. I also tried "0.5f". Same err... |
2018/03/18 | 1,131 | 3,794 | <issue_start>username_0: It gives me an error of "Trying to get property of non-object" can you help me? It works normally on my offline server but if I upload it on my liveserver it gives an error
I if I dd my controller gives result.
```
Collection {#287 ▼
#items: array:3 [▼
0 => Branch {#297 ▼
#connec... |
2018/03/18 | 603 | 2,051 | <issue_start>username_0: How do I read a line of text printed on a pad in ncurses? I am trying to use the `ncurses` function `winchnstr`. I am confused about how to use `chtype*` in the function. I understand that `chtype` is a `long int`, but when I use `chtype` in my code I get a segment fault. In the below example t... |
2018/03/18 | 1,563 | 5,947 | <issue_start>username_0: What's the equivalent of `document.querySelectorAll('.classname')` in React? I understand I should use Refs, but how dow I observe multiple Refs `onScroll`?
I usually use a function like the one below to check the viewport position of multiple elements in the page, and trigger different css an... |
2018/03/18 | 894 | 3,465 | <issue_start>username_0: I have used the and tags to create collapsible menus with buttons to open certain elements on the page, but when I click a button it closes the collapsed menu. How can I keep that collapsed menu opened after clicking a button within that menu?
I have used the `onclick="closeAll()"` to close ... |
2018/03/18 | 844 | 3,358 | <issue_start>username_0: When trying to make the assertion "Does the current url equal homepage url?", should the current url logic be put directly into the test method. Like so, `let currentUrl = browser.getCurrentUrl();` or can this logic be put into a page object like a home page.
To me it feels uncomfortable to as... |
2018/03/18 | 1,081 | 4,569 | <issue_start>username_0: I have an Android Studio based application written in Java. I works fine
and does not cause Android Studio to complain about anything:
```
public class MainActivity extends AppCompatActivity {
static Context maincActivityContext;
@Override
protected void onCreate(Bundle savedInstanceSt... |
2018/03/18 | 628 | 2,077 | <issue_start>username_0: Below is a small part of my raw json file, if a user is in game the game field appears in the json if there not in game the json removes the game field. I am trying to count how many users are in game by counting the game fields
>
> Raw json
>
>
>
```
"members": [
{
"username": ... |
2018/03/18 | 938 | 3,444 | <issue_start>username_0: Based on my limited searching, it seems GraphQL can only support equal filtering. So,
Is it possible to do Github GraphQL searching with the filtering conditions of,
* stars > 10
* forks > 3
* total commit >= 5
* total issues >= 1
* open issues <= 60
* size > 2k
* score > 5
* last update is... |
2018/03/18 | 1,806 | 7,117 | <issue_start>username_0: I want to capture mouse events for the child window,but the problem is Mouse events are not passed to this child window....
After finding information on the Internet, I found that I need to customize the button.But I still did not get any respond after doing this.
Can anyone tell me what else ... |
2018/03/18 | 564 | 1,787 | <issue_start>username_0: I want to know how to i sort the items i have in my listbox from a txt file by the lowest number to the highest?
```
private void Form1_Load(object sender, EventArgs e)
{
try
{
try
{
string[] lines = System.IO.File.ReadAllLines("fil... |
2018/03/18 | 1,195 | 3,692 | <issue_start>username_0: I'm trying to execute a query via bash with `bq` command. The query works when executed via web UI as well as via app script @ script.google.com. However, when executed as a simple bash (or just via the cmd prompt) I keep receiving a `"Syntax error: Unexpected keyword THEN at [1:393]"`. Col 393... |
2018/03/18 | 959 | 3,043 | <issue_start>username_0: I am trying to learn Fortran programming language, as a test I wrote a simple program like this:
```
!Fortran Program
program first
print *, "Hello World"
end program first
```
Then I threw this code file in to mac terminal and run `gfortran first.f95` which then gave me an output of `a.out`... |
2018/03/18 | 641 | 2,341 | <issue_start>username_0: I am developing a search engine for our college using Django-Haystack-Solr. I want auto-suggestion and spell check feature. So I used `auto_query()` and `spelling_suggestion()` method.
This is my `views.py` file. As of now, it is only static script not taking any form input from actual user.
... |