date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/02/27
834
2,298
<issue_start>username_0: I have this code : ``` %global nb_usag; %global usager_entr; %let nb_usag=0; %syslput nb_usag=&nb_usag; %let usager_entr=u; PROC SQL noprint ; select count(distinct no_usager_entr) into :nb_usag from &lib..INSCRITS_USA_1 ; quit; data _null_; if &nb_usag > 0 then do; ca...
2018/02/27
930
4,097
<issue_start>username_0: In want to check whether two items collide in space. For that purpose both items are represented by some simplified geometric shapes - for simplicity lets assume these shapes can only be circles, polygons and lines. The items can be represented by any of these shapes and the collision-detection...
2018/02/27
784
3,232
<issue_start>username_0: I tried to code Counting Sort algorithm with additional array, but somehow 1 element from randomly generated array doesn't print out. ``` import random import time start_time = time.clock() N = random.randint(3,12) list1 = []*N for i in range (1,N+1): ...
2018/02/27
491
1,770
<issue_start>username_0: I am using mysql-node: <https://github.com/mysqljs/mysql> but I am a little confused about default sanitization, `Mysql.Escape()` vs `Mysql.EscapeId()` and the use of `?` vs `??`. The docs says? **Default Sanitization** > > When you pass an Object to .escape() or .query(), .escapeId() is us...
2018/02/27
1,048
3,270
<issue_start>username_0: I am using `knitr::kable()` to render tables as part of an **R Markdown** document (that itself is part of a **bookdown** project). In particular, the booktabs option (through setting the `booktabs` argument to equal `TRUE`) renders the table in a nice-looking way. However, I'd like for there n...
2018/02/27
1,433
3,539
<issue_start>username_0: I have a xy-grid with two vector fields `u` and `v`. I represent vector fields as `Array{Float64, 3}` with dimensions `nx` × `ny` × `2`. I would like to have dot product `u.v` as a scalar field (`Array{Float64,2}` with dimensions `nx`×`ny`). What is the best way to achieve that? It would be pe...
2018/02/27
738
2,537
<issue_start>username_0: So, I've been learning C# and I need to remove everything after the ":" character. I've used a StreamReader to read the text file, but then I can't use the Split function, then I tried it by using an int function to import it, but then again I can't use the Split function? What I want this t...
2018/02/27
611
2,217
<issue_start>username_0: I have a `ListGroup` with `ListGroupItems` that get populated by some data. Part of that data is a description, which obviously varies in length. ``` { signalConstants[this.props.signalType].map((signal, i) => ( {signal.name} {signal.description} )) } ``` Sometimes that description...
2018/02/27
325
1,284
<issue_start>username_0: In objective-c, how can I assign an action to the event of someone pressing on one of the UITableViewCells that have been instantiated in a UITableView controller? Basically, the overall action I'm trying to achieve is for a user to be able to click a UITableViewCell, which then opens up a new ...
2018/02/27
384
1,403
<issue_start>username_0: I was working on updating some contents on my website and suddenly it keeps redirect to www.example.com/core/install.php and gives me this message: "Drupal already installed" . I don't know what is the reason because it was working fine.<issue_comment>username_1: Check the mysql value of max\_a...
2018/02/27
601
1,722
<issue_start>username_0: Im trying to iterate through the array and in each iteration change the element index for example start 1 0 0 0, then next iteration 0 1 0 0, then next iteration 0 0 1 0 , and for last 0 0 0 1. ``` public static void main(String[] args) { int [] b = {0,0,0,0}; for(int i = 0; i < b.l...
2018/02/27
462
1,425
<issue_start>username_0: I am fetching videos from the facebook graph api(24\*7) using nodejs. My code is working fine but after every 3 or 4 days it stops working and gives the following error: (Ignore the I'm in loop statements) [![Error file](https://i.stack.imgur.com/owPXi.png)](https://i.stack.imgur.com/owPXi.png...
2018/02/27
594
2,247
<issue_start>username_0: The following code adds every Pivot Field into the Pivot Table's Value Field. I want this to happen for my database, but my Excel keeps crashing when I run this. I tried stepping through the code to see where it stops, and it's crashing at `.Orientaton = xlDataField` after adding 29 Pivot Field...
2018/02/27
561
1,991
<issue_start>username_0: I want to create a java servlet that runs an .exe application in the server but as an asynchronous process and returns to the client a hash or token to indentify the process so the client can ask later if the process has finished. For example: * A user writes in the web browser something lik...
2018/02/27
1,229
4,365
<issue_start>username_0: I am trying to understand Python in general as I just switched over from using VBA. I interested in the possible ways you could approach this single issue. I already went around it by just going to the link directly, but I need to understand and apply here. ``` from selenium import webdriver ...
2018/02/27
443
1,479
<issue_start>username_0: I have the following map: ``` Map myMap; ``` But I need to convert it to the following: ``` Map myMap; ``` My best feeble attempt which doesn't even compile is: ``` myMap.keySet().stream().map(k -> k.name()).collect(Collectors.toMap(k, v) ```<issue_comment>username_1: You need to stream...
2018/02/27
1,345
4,430
<issue_start>username_0: I need to deserialize a `json` object using [`Jackson`](https://www.google.co.il/search?safe=strict&ei=6qyVWr2YIY-QkwW-jLXABA&q=jackson%20java&oq=jackson%20java&gs_l=psy-ab.3..35i39k1j0l5j0i20i263k1j0l3.12597.13249.0.13496.5.5.0.0.0.0.154.512.0j4.4.0....0...1c.1.64.psy-ab..1.4.509...0i67k1.0.LV...
2018/02/27
572
2,098
<issue_start>username_0: I need the coordiantes(lat/long) details for all the cities in US. Is there any package/function? There is `map_data()`from `gglpot2` package for **states** and **counties**. For states there is `map_data("state")` and for counties there is `map_data("county")` that has all the required coord...
2018/02/27
571
2,162
<issue_start>username_0: Hello All, I was wondering if someone could help me with making a number triangle in Java that looks like the one below using nested while loops. Would someone be able to help me out? 4 56 789 1234 56789 I have a variable 'i' on the outer loop determining how many rows the t...
2018/02/27
1,449
5,401
<issue_start>username_0: During our migration to Team Drives, we had a folder that was migrated twice. The first time was interrupted, and we now have thousands of duplicate folders with nothing in them. I would like to delete or at least remove any folders on a specific team drive that are completely empty. I found an...
2018/02/27
691
2,387
<issue_start>username_0: I want to return a string every time something is typed in the input field. In other words, with every keystroke, I want to see in the console it being typed out. So typing out stack in the input, I want to see: ``` s st sta stac stack ``` My initial code was: ```js $("#input").on('input', ...
2018/02/27
373
1,487
<issue_start>username_0: The Toast below is throwing and error. Any thoughts on what might be wrong. Everything else works fine. ``` @Override public void onBindViewHolder(ViewHolder holder, final int position) { final CopListdata coplistdata ; holder.coplistdata=copitems.get(position); holder.foodite...
2018/02/27
495
1,235
<issue_start>username_0: I have the following data. ``` > dat # A tibble: 12 x 2 id name 1 1 a 2 1 b 3 1 a 4 2 a 5 2 b 6 2 c 7 2 b 8 3 a 9 3 b 10 3 c 11 3 d 12 3 d ``` I would like to filter only by the following list ``` set <- NULL set$names <- c("a","b","c") ``` The ids selected ...
2018/02/27
816
2,370
<issue_start>username_0: I am trying to arrange a tibble based on a certain column (but setting the column based on a name dynamically set by a variable). Below is the code I currently am trying but am getting an error. The second paste of code works (where I have hard coded in the column name of symbol which I want t...
2018/02/27
721
2,712
<issue_start>username_0: How do you define a function that is within an object? ``` var CustomerDB = {customers:[], addresses:[], stores:[], insertData, addCustomer} CustomerDB.insertData = function (objData){ objData.forEach(function(element){ if (element.type == "customer"){ CustomerDB.addCustomer(e...
2018/02/27
899
3,147
<issue_start>username_0: Though my configuration looks good, my `python:3` image does not seem to have the expected `DJANGO_SECRET_KEY` set, at least at the point that the `Dockerfile` attempts to run migrations ``` $ docker-compose config services: api: build: context: /Users/ben/Projects/falcon/falcon-ba...
2018/02/27
778
1,951
<issue_start>username_0: I've got a lot of records like: ``` { "id": "1000", "lastSeen": "2018-02-26T18:49:21.863Z" } { "id": "1000", "lastSeen": "2017-02-26T18:49:21.863Z" } { "id": "2000", "lastSeen": "2018-02-26T18:49:21.863Z" } { "id": "2000", "lastSeen": "2017-02-26T18:49:21.863Z" } ``` ...
2018/02/27
996
3,144
<issue_start>username_0: I want to know an easy way of checking if a string is a mathematical expression. As an example, Google (and other search engines) use this when you search. **PS**: I don't necessarily want to check stuff like `sin`, `cos`, etc. Example: `2+2` should return `true` but `letters+somethingelse` s...
2018/02/27
1,161
3,780
<issue_start>username_0: I have the error `MethodNotAllowedHttpException` when I submit form data using `ajax`. **HTML** ``` // Form $('#loginForm').submit(function () { initLogin($('#email').val(),$('#password').val()); }); ``` **JavaScript** ``` function initLogin(email, password) { $.ajax( { ...
2018/02/27
525
2,086
<issue_start>username_0: I have radio button in my navbar and I want to store its value for one session or I can say it automatically retains the same value as user visits different pages of website but resets when browser or tab is closed. What I found is sessionStorage and I tried it but unfortunately its not working...
2018/02/27
338
1,066
<issue_start>username_0: Given I have a column "Name" from "train" dataset, I want to extract the title from it, adding it to the new created column "Title". [![enter image description here](https://i.stack.imgur.com/7GcVm.png)](https://i.stack.imgur.com/7GcVm.png) I thought about using `re.search("([A-Za-z]+)\.")`...
2018/02/27
933
2,869
<issue_start>username_0: I need to issue unix commands from an R session. I'm on Windows R2 2012 server using RStudio 1.1.383 and R 3.4.3. The `shell()` function looks to be the right one for me but when I specify the path to my bash shell (from Git for Windows install) the command fails with error code 127. ``` she...
2018/02/27
718
2,874
<issue_start>username_0: I have a personal side project that is effectively a small "evolution simulator". This simulator has objects of type `Critter`. The properties of a `Critter` all have default values, i.e.: ``` public Rules.Size Size { get; set; } = Rules.Size.Medium; //average size ``` The class has multiple...
2018/02/27
4,107
14,647
<issue_start>username_0: I have searched and searched for an answer to this but can't find anything I actually "get". I am very very new to c++ and can't get my head around the use of double, triple pointers etc.. What is the point of them? Can anyone enlighten me<issue_comment>username_1: The use is to have a pointe...
2018/02/27
1,100
3,375
<issue_start>username_0: I have this assignment: > > Write a program checkerboard3x3.cpp that asks the user to input width and >height and prints a checkerboard of 3-by-3 squares. (It should work even if >the input dimensions are not a multiple of three.) > > > *Example 1:* ``` Input width: 16 Input height: 11...
2018/02/27
893
3,164
<issue_start>username_0: if I have: ``` fdata = open(pathf, "r").read().splitlines() ``` Will the file automatically close after getting the data? If not how can I close it since fdata is not a handle? Thank you<issue_comment>username_1: Use ``` with open(pathf, "r") as r: fdata = r.read().splitlines() # as so...
2018/02/27
1,000
3,836
<issue_start>username_0: I'm trying to build GAS projects locally using [clasp](https://github.com/google/clasp). Any locally-installed IDE is a huge improvement over Google's Script Editor, so the tool looks very promising. Unfortunately, the autocomplete feature for GAS services doesn't seem to be included in the pa...
2018/02/27
777
2,967
<issue_start>username_0: Am trying to use `$document.on("dialog-ready", function() { .. }` for touch UI dialog customization. Where as i can see the **dialog-ready** event fires before the dialog content is fully loaded which gives me a unavailability of tags for traversal of dialog html. 1. Is there any event listen...
2018/02/27
904
3,292
<issue_start>username_0: I currently have a Reactive Form which is built in the following way: ``` this.formGroup = this.formBuilder.group({ email: this.formBuilder.control({value: null, disabled: true}, [emailValidator, Validators.required]), username: this.formBuilder.control('', [Validators.required]) }); ...
2018/02/27
794
2,870
<issue_start>username_0: Solved adding `if (line.isEmpty()) continue;` --------------------------------------------- I need to read data from my text file and add this data into my ArrayList. I see through debugger that the `String[] words` size is 1 which is `""`. That is why I get an exception : ``` Exception in t...
2018/02/27
1,224
4,292
<issue_start>username_0: I am using different libraries like pandas and numpy for generating a dataframe, which eventually generate a graph. Now, I need to show this graph into a simple webpage which is in HTML. **Note: I am also willing to take 2-3 input from user in HTML page then pass that data to my python file....
2018/02/27
1,107
3,305
<issue_start>username_0: I am currently making a web application that behaves identically to the link below. My goal is to make it so when a slider is clicked, the psuedo element of .slider:before (The white part that slides across) has an image I want to add in the middle of it and text (very small). So before, nothin...
2018/02/27
418
1,388
<issue_start>username_0: I found this example of drawing a rectangle in objective-c cocoa ``` NSRect r = NSMakeRect(10, 10, 50, 60); NSBezierPath *bp = [NSBezierPath bezierPathWithRect:r]; NSColor *color = [NSColor blueColor]; [color set]; [bp stroke]; ``` However, where should I specify ***which*** NSView to draw o...
2018/02/27
1,578
6,243
<issue_start>username_0: I have an application whose backend is built on Java 8. Recently I've been seeing that the application restarts by itself, because of OOM. I got to know its because of OOM, by looking at the exit status of the Docker Container. There was no `Xmx` and `Xms` values configured for the system and a...
2018/02/27
1,012
3,696
<issue_start>username_0: I need to compare the most recent entered value from one table with the most recent limit entered into another table. Then I want to return a single response which shows whether the limit has been exceeded. I'm somewhat new to SQL, but this is what I did to get the most recent values in each ta...
2018/02/27
414
1,411
<issue_start>username_0: This is pretty basic but I'm not having any luck finding anything in the Rails documentation. There is a view helper method (Ruby code, *not* HAML) that returns ``` link_to(user_controlled_text, destination, options) ``` and I need to wrap an HTML element (namely ) around the `user_controll...
2018/02/27
2,215
6,446
<issue_start>username_0: I want to sample 140 numbers between 1000 to 100000 such that the sum of these 140 numbers is around 2 million (2000000): ``` sample(1000:100000,140) ``` such that: ``` sum(sample(1000:100000,140)) = 2000000 ``` Any pointers how I can achieve this?<issue_comment>username_1: Here are some ...
2018/02/27
1,054
3,750
<issue_start>username_0: I just got done browsing the keyboard shortcuts for RStudio and I can't find one for `View()`. Does this exist in any form? I'd like to highlight any data frame in my source pane and hit `Ctrl`+`X`+`Y`+`Z` or whatever to see the spreadsheet view of my data frame in RStudio. I often create dat...
2018/02/27
959
3,797
<issue_start>username_0: I find myself doing this repetitive code a lot, when I have different kinds of cells. Is there a way to DRY it up? Or is it as good as it could be. ``` override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { switch...
2018/02/27
769
2,394
<issue_start>username_0: I'm attempting to import the most recent .csv from my working directory into R. Adamant this method was working previously but appears to no longer be. Each day a .csv file is outputted to my designated folder, from where I import it into RStudio for manipulation. There are 2 files in this fol...
2018/02/27
244
894
<issue_start>username_0: I am new to Lua and I am trying to learn it. Recently I came across below line of code which I believe is extracting some value from the table. `local context = context_proto[{{1, batch_size}, {1, source_l*imgH}}]` I have not seen this particular approach to read the table before. I would hig...
2018/02/27
802
2,867
<issue_start>username_0: I found the answer to how to do it natively here but Im running Unity. [How to take picture with camera using ARCore](https://stackoverflow.com/questions/48191513/how-to-take-picture-with-camera-using-arcore) I'm not sure how to access the Unity surface renderer thread to be able to drop in t...
2018/02/27
858
2,785
<issue_start>username_0: I have an array of objects with one property being an array of values without keys and I am attempting to filter through and check for matching values within the nested array. Here is an example of one object: ``` [ 0: { fiber_phases: ["45", "46"], id: 1, label: "3200 to 3299 1...
2018/02/27
1,236
3,810
<issue_start>username_0: I would like to extract the number of attendances (i.e., COUNT()) of "Coaches" at "Shows" happening during two separate months: March and April. I managed to create a query that collects that number over only one of the months. In addition, via slightly modifying the query, the numbers over the...
2018/02/27
715
2,714
<issue_start>username_0: I am trying to reduce the following code to one single line: ``` while not is_ok: pass else: print('a') time.sleep(0.5) ``` I tried this: ``` while not is_ok: pass; else: print('a') time.sleep(0.5) ``` But it's wrong. Any ideas? **Clarification**: I am using multithreading. The...
2018/02/27
909
2,991
<issue_start>username_0: I'm using `CMAKE_EXPORT_COMPILE_COMMANDS` variable of `cmake` to obtain a json compilation database that I can then parse to identify the options that are given to the compiler for each source file. Now, the project I'm working on has several targets, and there are several occurrences of the so...
2018/02/27
751
2,457
<issue_start>username_0: I kept getting this issue after installing this package below <https://github.com/vinkla/instagram> into my Laravel 5.1 project. ![2018-02-27 at 1 55 36 pm](https://user-images.githubusercontent.com/11523064/36748618-5fbc6ecc-1bc6-11e8-88cc-58f7f30c333c.png) I followed everything in the ins...
2018/02/27
3,347
7,521
<issue_start>username_0: How to create the following rainbow effect using CSS? i.e. top rounded border with solid rainbow color stops (without inserting html). [![enter image description here](https://i.stack.imgur.com/GSBTz.png)](https://i.stack.imgur.com/GSBTz.png) Colors are: `#c4e17f. #f7fdca, #fad071, #f0766b, ...
2018/02/27
1,832
6,612
<issue_start>username_0: Im trying to build a temperature monitor using pyqt5 on a raspberry pi 3 with ds18b20 sensors attached. I am pretty new to python and pyqt5. The Gui file (frameless.py) was developed with QT 4 designer. The Gui should serve as a basic example for a more enviromental sensors (e.g pH EC etc.) to...
2018/02/27
840
3,722
<issue_start>username_0: I noticed every node in a cluster has an external IP assigned to it. That seems to be the default behavior of Google Kubernetes Engine. I thought the nodes in my cluster should be reachable from the local network only (through its virtual IPs), but I could even connect directly to a mongo serv...
2018/02/27
1,187
3,200
<issue_start>username_0: I have a problem with my deployed app on Heroku ! I use my back end with an API made in node ! It works fine locally and but when i deploy the app, i have this message "Invalid Host Header". When i remove the proxy line in my Package.json, it works but automatically i don't have access to my AP...
2018/02/27
631
2,084
<issue_start>username_0: Problem: On an english Windows 10 using slovenian keyboard layout, all command line interfaces seem to have a problem with displaying (printing) UTF-8 characters, namely č, š and ž, which are replaced with ?. (I assume all UTF-8 specific characters, since ć and đ also do not work. ) Tested ...
2018/02/27
622
1,591
<issue_start>username_0: I have a small matrix, say ``` x <- matrix(1:10, nrow = 5) # values 1:10 across 5 rows and 2 columns ``` The result is ``` [,1] [,2] [1,] 1 6 [2,] 2 7 [3,] 3 8 [4,] 4 9 [5,] 5 10 ``` What I want to be able to do now is duplicate random rows in x; for exam...
2018/02/27
273
843
<issue_start>username_0: I am trying to run a query on a DB2 database that is included in an INNER JOIN that will show everything that is older than 1 year. Here is the code I am running: ``` month(T4.BIRTH_DT) > (SELECT CURRENT DATE - (DAY(CURRENT DATE) DAYS) - 11 MONTH + 1 DAY from SYSIBM.SYSDUMMY1 ) ``` But I ge...
2018/02/27
795
3,112
<issue_start>username_0: Initially I created an application that I completely rewrite in a second version. It is a complete different Visual studio solution. Now I would like that its Setup installer uninstall the previous version but because it was not created using the same solution, the automatic uninstallation of p...
2018/02/27
661
2,234
<issue_start>username_0: Is there a way to know which element has failed the `any` built-in function? I was trying to solve [Euler 5](https://projecteuler.net/problem=5) and I want to find for which numbers my product isn't evenly divisible. Using the for loop it's easy to figure it out, but is it possible with `any` ...
2018/02/27
528
1,879
<issue_start>username_0: I have two tables: `users` and `location`. The columns in `users` are: `id`, `name`, and `location_id`. The columns in `location` are `id` and `city`. There is a relation between the two tables (one to many) between `users.location_id` and `location.id`. I want to show users that have the sa...
2018/02/27
697
2,518
<issue_start>username_0: I am running to of the following programs. Importantly, imagine that there is `mymodule.py` file in the directory where both these programs are located. *The first*: ``` exec('''import sys import os os.chdir('/') sys.path = [] import mymodule''', {}) ``` *The second*: ``` import mymodule ...
2018/02/27
1,058
3,427
<issue_start>username_0: I've got a dataframe here ``` Row dist1 dist2 dist3 variable value Smallest Group 0 0 40 101 dist2 40 Smallest SmallestGroup 1 0 40 101 dist3 101 SecondSmallest SecondSmallestGroup 2 1 30 100 dist2 30 Smallest SmallestGroup ...
2018/02/27
332
1,301
<issue_start>username_0: Hello I have a problem with jquery datetimepicker. I would like to display the calendar at the beginning of the week on Monday (now it's Sunday). I used `firstDay`, but it does nothing. Here is my code: ``` jQuery(document).ready(function () { 'use strict'; jQuery.datetimepicker.setLocal...
2018/02/27
413
1,669
<issue_start>username_0: I integrated Firebase for Unity, it worked well; but I have problems understanding custom parameters. I am using Firebase' s level\_up event(it is not related but works for my purpose) and I added custom parameters to it like: ``` Parameter(string levelfailedornot, int currentlevel) ``` S...
2018/02/27
697
2,477
<issue_start>username_0: I am trying to print the string representations of a list of expressions a long with their evaluations. **Input** ``` def info(): return [ __name__, type(__name__), inspect.currentframe(), inspect.getframeinfo(inspect.currentframe()) ] #my attempt for a in map(str, i...
2018/02/27
648
2,176
<issue_start>username_0: I have this in my views.py ``` def read_file(request): f = open('path/text.txt', 'r') file_contents = f.read() print (file_contents) f.close() return render(request, "index.html", context) ``` Urls.py: ``` from django.conf.urls import url from . import views urlpatterns...
2018/02/27
905
2,200
<issue_start>username_0: I have a `defaultdict(list)` of: ``` d_int = defaultdict(type, {0: [1,2,3,4,5], 1: [6,7,8,9,10], 2: [11,12,13,14,15]}) ``` Is there a pythonic way to save each n element in each list into a new array so I have something like this?: ``` a = [1,6,11] b = [2,7,12] c = [3,8,13] d = [4,9,14] e =...
2018/02/27
945
2,432
<issue_start>username_0: Need to find the popular names, which are grouped by sex ``` bnames_decade = bnames_decade.groupby(['sex','name'])['births'].sum().sort_values(ascending=False) ``` this shows ``` F Emma 121375 Sophia 117352 Olivia 111691 M Noah 110280 Mason ...
2018/02/27
1,088
3,356
<issue_start>username_0: I am trying to find an id or string within a `List` returned from a method in a different class. The solution below does not work. I have initialized the class, then called the method, and am trying to get the id. ``` public class RiskService { private readonly Resource _matt = new Resourc...
2018/02/27
625
2,172
<issue_start>username_0: Being new to angular 2 I am confused with this colon operator `:` like why and when should it be used? What does `hero:Hero` statement mean in: ``` onSelect(hero: Hero): void { this.selectedHero = hero; } ``` Thank you.<issue_comment>username_1: Here 'hero' is a variable of type class 'H...
2018/02/27
855
2,739
<issue_start>username_0: I'm have a problem with FT232. I'm writing in Delphi. I need to read ChipID from several FT232. I downloaded the file FTChipID.pas from <http://www.ftdichip.com/Support/SoftwareExamples/FTDIChip-ID.htm> This is fragment my code: ``` procedure TForm1.CheckComID; var myChipID: array[0..10] ...
2018/02/27
507
1,732
<issue_start>username_0: It seems that the 'SwarmSVM' package used to have a kmeans.predict function, but no longer does. I would like to divide a dataframe to training+testing subsets to train a model and then test it. I am currently only able to use the 'kmeans' function to create clusters, but I can't figure out w...
2018/02/27
553
1,936
<issue_start>username_0: I'm very new in this and I have just add new component using command. The component is created successfully. app.module.ts ``` import { LoginComponent } from './login/login.component'; @NgModule({ declarations: [ AppComponent, LoginComponent ], imports: [ FormsModule, ...
2018/02/27
347
1,176
<issue_start>username_0: With following code I managed to convert a sound file stored in R.raw folder to string. ``` InputStream inputStream = this.getResources().openRawResource(R.raw.bell_1); byte[] bell_sound = new byte[0]; try { bell_sound = new byte[inputStream.available()]; } catch (IOExcept...
2018/02/27
1,602
6,731
<issue_start>username_0: I am using spring-data-redis for caching data in my spring boot app. I am using Mongo as my primary data source and Redis as a cache. When I hit the API for the first time, it fetches record from Mongo and saves it in Cache, and returns MyObject correctly to the client. But when I hit the API s...
2018/02/27
748
2,244
<issue_start>username_0: I was doing an algorithm where Im given x and y solution, and I need to find if possible, quadratic formula for that solutions. What I actually mean is: If Im given output: ``` f(1) = 1 f(2) = 5 f(3) = 13 f(4) = 25 ``` So, the function should return `1,5,13,25` Function that gives that outp...
2018/02/27
1,017
3,357
<issue_start>username_0: I am writing in Python, sometimes calling certain aspects of maxscript and I have gotten most of the basics to work. However, I still don't understand FPValues. I don't even understand while looking through the examples and the max help site how to get anything meaningful out of them. For examp...
2018/02/27
767
2,462
<issue_start>username_0: We can implementing pagination in C#, ASP.NET in ActionResult function like this ``` public ActionResult Index(int? page) { Entities db = new Entities(); return View(db.myTable.ToList().ToPagedList(page ?? 1,8 )); } ``` how to implementing pagination in JsonResult function that sendi...
2018/02/27
2,031
6,441
<issue_start>username_0: Suppose I have two files `a.rst` and `b.rst` in the same folder, and `a.rst` looks like this ``` .. _foo: http://stackoverflow.com `foo`_ is a website ``` It seems using `foo` in `b.rst` is not allowed. Is there a way to define hyperlinks and use them in multiple files? > > Followup > > ...
2018/02/27
1,028
2,684
<issue_start>username_0: I want to add total fields to this DataFrame: ``` df_test = pd.DataFrame([ {'id':1,'cat1a':3,'cat1b':2, 'cat2a':4,'cat2b':3}, {'id':2,'cat1a':7,'cat1b':5, 'cat2a':9,'cat2b':6} ]) ``` This code almost works: ``` def add_total(therecord): t1 = therecord['cat1a'] + therecord['...
2018/02/27
1,112
3,657
<issue_start>username_0: I'm trying to complete a Java lab exercise that asks to display the volumes of objects (cylinders) in an array. Whenever I try to print the array the output always seems to be the last object in the array, when I'd like them all to print. **Here is my code for Cylinder.java:** ``` public cla...
2018/02/27
479
1,423
<issue_start>username_0: I am experimenting with Flutter and need to make a plugin package for Android and iOS, and have started with Android. The Android Java code I need to communicate with uses a byte array (byte[]) both as input and as return type for some of its methods. What does this map to in Dart?<issue_commen...
2018/02/27
760
2,852
<issue_start>username_0: I have a spring boot app (1.5.10.RELEASE) that logs great when running as a standalone application in Eclipse IDE. I am using spring config and the properties file says this: ``` logging.level.com.myco.impl=DEBUG logging.path=/log/myService ``` When I run as a standalone application, I see e...
2018/02/27
719
2,317
<issue_start>username_0: I am newbie in BeautifulSoup4 and learning it very intensively. The problem is with the next piece of code(I found it in documentation on the page **<https://www.crummy.com/software/BeautifulSoup/bs4/doc/>**, article about function definition): ``` def has_class_but_no_id(tag): return t...
2018/02/27
516
1,703
<issue_start>username_0: I set id attribute the following way: ``` Element node = document.createElement("something"); node.setAttribute("id", "1"); node.setIdAttribute("id", true); ``` Then I check if this is really id attribute: ``` node.getAttributeNode("id").isId()); ``` returns true But when I try to get th...
2018/02/27
467
1,477
<issue_start>username_0: I need to insert records into a SQL Server table. The client send ids I need to insert into a specific column in the table: ``` (2,4,123,1357,1234,5657,753); ``` Using [this](https://stackoverflow.com/a/10581814/500105) function I'm splitting the comma delimited string, but not sure how to i...
2018/02/27
373
1,192
<issue_start>username_0: What I basically need is a regex to only get the domain and port `lb.geo.pirlpool.eu:8002` in both of the following: ``` -epool stratum+tcp:\/\/lb.geo.pirlpool.eu:8002 -epool lb.geo.pirlpool.eu:8002 ``` I managed to get everything before with the following regex: `(\-epool (.*:\\\/\\\/)?)` ...
2018/02/27
400
1,400
<issue_start>username_0: I am using SelectPDF to generate pdfs from a cshtml template. My PDF generates locally, but when on production I get an error. Stack trace: at SelectPdf.HtmlToImage.?(String A\_0, String A\_1, String A\_2, ?[]& A\_3, ?& A\_4)\r\n at SelectPdf.HtmlToPdf.?(String A\_0, String A\_1, String A\_2,...
2018/02/27
356
1,000
<issue_start>username_0: I have a bootstrap dropdown with a select box which has a few options that I want there. It looks fine until I click on it, the drop-down closes. How can I keep the drop-down open if I click on the select box? [Here's a bootply.](https://www.bootply.com/95FU2GksH4)<issue_comment>username_1: Yo...
2018/02/27
871
3,571
<issue_start>username_0: I'm trying to add unique columns on a pivot table created via a `ManyToMany` association. I found this [page of the documentation](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-uniqueconstraint) explaining how to generate a databa...
2018/02/27
2,161
8,827
<issue_start>username_0: I am using **Spring Boot 2.X** with **Hibernate 5** to connect two different MySQL databases (Bar and Foo) *on different servers*. I am trying to list all the information of an entity (own attributes and `@OneToMany` and `@ManyToOne` relations) from a method in a REST Controller. I have follo...
2018/02/27
1,307
5,186
<issue_start>username_0: I have a simple recyclerview with items (tips) and a loading spinner at the bottom. here's how the item count and item view type methods look: ``` @Override public int getItemViewType(int position) { if (position == getItemCount() - 1) { // last position return LOADING_FOOTER_VI...
2018/02/27
1,308
5,129
<issue_start>username_0: I'm trying to figure out what I'm doing wrong using this [Ant Tree component](https://ant.design/components/tree/). I have two components, the PageAdmin I do a get call to get information about what nodes in the tree that should be marked as selected. I receive the data from the server and put ...