date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/03/10
1,867
6,999
<issue_start>username_0: For a project I need to build some kind of auction platform using PHP for the backend. I am currently trying to upload images using PHP and then storing the url in the "Item" table in my sql database. I followed this [tutorial](https://www.w3schools.com/php/php_file_upload.asp) for image upload...
2018/03/10
598
2,096
<issue_start>username_0: I am running a C code that needs the number of steps in an MD trajectory file. It first calls a function which gets the number of steps. The function call is ``` int steps=get_steps(argv[2]); ``` and the function itself (in a separate header file) is ``` int get_steps(char* f){ print...
2018/03/10
267
880
<issue_start>username_0: In Swift you can ignore the loop constant by using `_` like so: ``` for _ in 0...10 { //loop logic here } ``` Is there an equivalent in Kotlin?<issue_comment>username_1: You can just use a forEach loop, and don't use `it` inside the closure: ``` (1..10).forEach { println("hello") } `...
2018/03/10
507
1,950
<issue_start>username_0: I'm iterating through an array of URLs in order to display images in my tableview cells. For some reason the images will not display until the cell is selected. Only one image will show at a time, so when I select on one cell to display the image, it will disappear again once I select another c...
2018/03/10
457
1,647
<issue_start>username_0: I am a beginner Swift/Xcode user, and during one of my build/runs I got an alert saying: > > **App installation failed** > > > The maximum number of apps for free development profiles has been reached. > > > I only have 3 projects, each only has one product except for one that has 3 (iO...
2018/03/10
1,111
4,269
<issue_start>username_0: How can I have more different pages on one HTML page? But see only one page at time? for example I have two different paragraphs: News and Contact - how can i see at the beggining only news and then click on button to see contact and hide news?<issue_comment>username_1: So basically all you hav...
2018/03/10
5,895
12,188
<issue_start>username_0: So I have a spring boot application build with Gradle. It's working just fine when build and run locally, however, I can't make it run on Heroku. Here are the logs: ``` 2018-03-10T22:24:19.561282+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=53342 $JAVA_OPTS -jar build...
2018/03/10
296
1,178
<issue_start>username_0: I am trying to store the actual response from a Promise to a variable ``` let token; let tokenPromise = new Promise(function(resolve, reject) { fetch(tokenUrl, options) .then(res => { if (res.ok) { return res.json() } else { ...
2018/03/10
1,027
3,435
<issue_start>username_0: I am sending an email and so far I have this code: ``` \Yii::$app->mailer->htmlLayout = "layouts/create-user"; $message = \Yii::$app->mailer->compose ( 'layouts/create-user' , [ 'userData' => 'Hello' ] ); $message->setFrom ( [ '<EMAIL>' => 'Admin DOC-Plus' ] ); $message->setTo ( '<EMAIL>' ); $...
2018/03/10
440
1,428
<issue_start>username_0: I'm creating an online text editor. I need to be able to get the users text from the textarea's tag, manipulate this text and bind it back to the textarea, but with HTML in it. Example: ``` ``` Where `someText` is set to: ``` someText: '**bold**.. not bold' ``` and should display like: ...
2018/03/10
1,593
5,895
<issue_start>username_0: I am getting the following error. > > ***The model item passed into the dictionary is of type 'Vidly.ViewModels.CustomersViewModel', but this dictionary requires a model item of type 'Vidly.ViewModels.RandomMovieViewModel'.*** > > > Which makes no sense! There is nothing to do with 'Vidly...
2018/03/10
674
2,567
<issue_start>username_0: Thanks all. I am using an a payment api that I supply with a callback URL so that I receive data to notify my system and update payment as "paid". The api posts raw json data when successful with details of the transaction which I save in a realfile.php. realfile.php is as below: ``` php $po...
2018/03/10
726
2,367
<issue_start>username_0: I'm trying to build a bot which automatically sends a message whenever there is an update in the latest news using python. Following is what I did. ``` companies = { "name_1": { "rss": "name_1 rss link", "link": "name_1 link" } } import feedparser as fp import time, te...
2018/03/10
497
1,706
<issue_start>username_0: I have a plane behind a text mesh 3d that i use to make the text more visible. The plane is supposed to be slitghtly transparent but when i give it a transparent shader it starts acting like the pane is in front of the text when it actually is not. How can i fix this? [![enter image descriptio...
2018/03/10
3,326
10,478
<issue_start>username_0: I am trying to setup Recaptcha in my rails 5 application as it's described in the documentation but it fails. I use this gem: [recaptcha (4.6.6)](https://github.com/ambethia/recaptcha), `ruby 2.5.0` and `rails 5.1.4` In view form: ``` <%= flash[:recaptcha_error] %> <%= recaptcha_tags %> ```...
2018/03/10
847
3,269
<issue_start>username_0: I'm trying to retrieve some extended file attributes (mp3 files to be precise) listed in the "Details" tab, section "Media" with PowerShell. There are additional attributes like `bitrate`, `genre`, `album`, etc. Sadly `Get-ItemProperty -Path $pathtofile | Format-List` does not return those. ...
2018/03/10
461
1,536
<issue_start>username_0: I have a search input in my wordpress site, which I want to display different placeholdes each time the page been refreshed. So I will have an array of the different values, the function that will loop randomly through the array, and I think my problem is with the result. I'm using a plugin for...
2018/03/10
535
1,899
<issue_start>username_0: I am currently stuck with a simple problem. I have a service called `UserService` that aims to be an API layer. I would like to call its method `getProfile()` in this way: * If it is the first time that method is called, it will make a request to my API to retrieve the profile, it will be sav...
2018/03/10
634
2,038
<issue_start>username_0: I'm referring to the leetcode question: [Kth Smallest Element in a Sorted Matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/description/) There are two well-known solutions to the problem. One using Heap/PriorityQueue and other is using Binary Search. The Binary Sea...
2018/03/10
926
3,046
<issue_start>username_0: I am fairly new to Jenkins and Docker, and I am hitting a problem trying to get a docker image of maven to build my project. My Jenkins script is fairly straightforward atm: ``` pipeline { agent { docker { image 'maven:3-alpine' args '-v /root/.m2:/root/.m2' } } ...
2018/03/10
1,179
4,541
<issue_start>username_0: Why does a function called after my promise execute before the promise's callback? I read this in MDN, but didn't understand it > > "Callbacks will never be called before the completion of the current > run of the JavaScript event loop." > > > I thought it meant that if I have any oth...
2018/03/10
317
1,188
<issue_start>username_0: I have a Python file in `/Users/homedir/...` and I want it to access a `csv` file on an external hard drive. Does anyone know how to do this? I only need reading permission.<issue_comment>username_1: External drives can be found under **/Volumes** on macOS. If you provide the full path and hav...
2018/03/10
1,621
5,503
<issue_start>username_0: I would like to synchronise a dygraph and a DateRangeInput inside a Shiny App. The code bellow works fine : I can simultaneously use the zoom option And the daterange but I can't use the dyRangeSelector because of a "ping pong" Effect : ``` library(xts) library(shiny) library(dygraphs) library...
2018/03/10
1,467
5,429
<issue_start>username_0: I'm learning fragments communication with each other. However, I have encountered a problem and I do not know how to solve it. I have tons tons of researches on google and didn't found anything so i hope you can help me . This is my code : Activity : ``` public class NextActivity extend...
2018/03/10
474
1,408
<issue_start>username_0: I have a dataset in R with two columns labelled x and y each with over 1000 values. I need to find `sum((xi^2-xbar^2)(yi-ybar))/sum((xi-xbar)^4)` for a linear regression problem. All I can think to use is: ``` sum(((data$x)^2-mean(data$x)^2)(data$y-mean(data$y)))/sum((data$x-mean(data$x))^4) ...
2018/03/10
1,218
3,161
<issue_start>username_0: I have a pretty naive way to compare a subset of two objects’ properties with each other. It gets hard to read when there are many properties in the subset. What could be some alternatives? ``` const obj1 = {a: 22, b: 33, c: 44}; const obj2 = {a: 22, b: 34, c: 44}; JSON.stringify([obj1.a, obj...
2018/03/10
582
2,296
<issue_start>username_0: I'm trying to insert the innerHTML for the `div` container **ed**. But I cannot get it after the React has render it. I understand that it's the problem with the stages of render, because I get `null` for this `div` container. What is I'm making the wrong? ``` class Test extends React.Componen...
2018/03/10
2,118
7,387
<issue_start>username_0: I am trying to load an SQLAlchemy in a pandas DataFrame. When I do: ``` df = pd.DataFrame(LPRRank.query.all()) ``` I get ``` >>> df 0 1 ... ... ``` But, what I want is each column in the database to be a column in the dataframe: ``` 0 <NAME> 1 18 1 <NAME> 2 1...
2018/03/10
1,127
4,167
<issue_start>username_0: I have an html file already, and i have a java file that contain methods returning integers. i want to print those integers in the html, is it possible to transfer the data from java to html and what is the simplest way?<issue_comment>username_1: Simply add an `__init__` method in your model ...
2018/03/10
1,315
4,387
<issue_start>username_0: How do I make it so that when I go through with error validation on my post form, it doesn't only send back the default values from the database, but if I were to edit the values and hit submit, it would save the data I tried to update with. I'm stuck where I can only do one or the other. ```h...
2018/03/10
438
1,815
<issue_start>username_0: SonarLint flags as blockers some variables in my code base. Ones like `public static final String INVALID_PASSWORD = "<PASSWORD>.";` SonarLint thinks that the variable might contain a hard coded password, which is a security risk. But in this case, the variable does not contain a password, it ...
2018/03/10
303
1,493
<issue_start>username_0: Should the instance variables be private or protected in java abstract class? Simple question. I am trying to get more insight into the concept of abstraction in java. Thanks!<issue_comment>username_1: As a rule of thumb, go for non-final private variables. If your design calls for giving deri...
2018/03/10
1,141
2,830
<issue_start>username_0: I have one pd including two categorical columns with 150 categories. May be a value in column `A` is not appeared in Column `B`. For example ``` a = pd.DataFrame({'A':list('bbaba'), 'B':list('cccaa')}) a['A'] = a['A'].astype('category') a['B'] = a['B'].astype('category') ``` The output is ...
2018/03/10
885
2,302
<issue_start>username_0: How do I do this in python? The first function you will write should be called ‘wordSalad’. Your function should take four (4) arguments, all strings. The function should return one (1) string formatted as follows: ‘I love and with and .’ Example Test Case: wordSalad(‘Bob’, ‘Joe’, ‘lemonade’...
2018/03/10
921
3,006
<issue_start>username_0: I'm trying to parse a subset of a webpage with regex for just fun. It was fun till I encountered with the following problem. I have a paragraph like below; ``` foo: 1, 2, 3, 4 and 5. bar: 1, 2 and 3. ``` What I am trying to do is, get the numbers in the first line of the paragraph starting w...
2018/03/10
1,005
3,002
<issue_start>username_0: I can see numerous posts around this topic but none that specifically solves the problem I have. I have a string that has text and numbers. I need to split the string into 2 columns when it first sees a number. **Example**: ``` Ballyvic Boru5/6 First Drift2/1 Sizing Cusimanoin15/2 ``` **Be...
2018/03/10
1,572
4,910
<issue_start>username_0: I need to sort lines from file, saved as UTF-8. These lines can start with cyrillic or latin characters. My code works wrong on cyrillic one. ``` sub sort_by_default { my @sorted_lines = sort { $a <=> $b || fc( $a) cmp fc($b) } @_; } ```<issue_comment>usern...
2018/03/10
1,333
4,827
<issue_start>username_0: On the checkout page in Woocommerce there is an "I accept terms and conditions" checkbox. The "terms and conditions" is a link, but Woocommerce captures the click event on the link, and instead opens a small popup(?) with the Terms and conditions page. I would like to disable the script, and h...
2018/03/10
1,296
4,689
<issue_start>username_0: For a project, I'm trying to highlight the logical fallacy of circular reasoning and have precious few lines of code later to be inserted into a separate webpage. I am trying to create a simple process of clicking the displayed text to switch back and forth between the two questions. I've trie...
2018/03/10
675
2,586
<issue_start>username_0: I write code that runs in high throughput production environments expected to handle a variety of input from multiple users. In this environment, I often need to join (with dplyr) two multi-column dataframes with join columns of mismatched types which produces this error. "Can't join on ... bec...
2018/03/10
731
2,721
<issue_start>username_0: I have post-receive hook with install command: ``` pip install -r requirements.txt ``` After I call `git push live master` hook calls `pip install` command but on remote server installing started on system python2.7 instead of python3.6.4 which I specified as global in pyenv. I guess .bashrc...
2018/03/10
615
2,236
<issue_start>username_0: I'm trying to assign a default user role to newly registered accounts. I'm using the flask-user plugin(<http://flask-user.readthedocs.io/en/latest/index.html>). In the flask-user documentation they use this code to manually assign a user role to a new account: ``` if not User.query.filter(User...
2018/03/10
720
2,056
<issue_start>username_0: I have a dataset with 2 factors, each with 2 levels. I want to make a grouped bar graph with 4 different colours. The data looks like this: ``` TrialType Group yvar TP C 1 TP E 2 TA C 3 TA E 4 ``` I use this to make the bar graph using ``` g...
2018/03/10
646
2,053
<issue_start>username_0: I am trying to make a program then open it by using this code. ``` //Make the file std::ifstream src(a, std::ios::binary); std::ofstream dst(b, std::ios::binary); dst << src.rdbuf(); //Execute it Execute((LPCTSTR)b.c_str()); ``` Function Execute: ``` bool Execute(LPCTSTR Process) { STAR...
2018/03/10
585
2,174
<issue_start>username_0: I'm modelling a database schema that has the requirement of including multi-user account functionality: > > A multiple user account enables multiple users to login to the same > account in order to do the job according to their permission level. > This means that it is possible to maintain ...
2018/03/10
1,037
3,017
<issue_start>username_0: I have a file that has 50 million records and I have a list of indexes that I need to drop from the file. If I want to use pandas dataframe to read the file - I can run into memory issues (if I have limited memory). Let's say I do this: ``` df = pd.read_csv('input_file') df = df.drop(df.index[...
2018/03/10
750
2,026
<issue_start>username_0: I have tried the code below: the purpose is to generate a dictionary where each key has a list as a value. The first iteration goes well and generates the item as I want it, but the second loop, the nested for loop, doesn't generate the list as expected. Please help me with this simple code. ...
2018/03/11
3,886
15,190
<issue_start>username_0: I'm trying to create a form that authenticates a username and password that exists in a `MySQL` database (using `UwAmp`) It has a database called `users` and a table called `userdetails` that has 2 columns `Username` and `Password` both contain `user` and `pass` respectively as data. I know I'...
2018/03/11
593
1,854
<issue_start>username_0: I'm wanting to order files in a directory based on date of creation (or at least, last modified). I have this code: ``` FOR /R "directory" %%F IN (*.filetype) DO echo "command" "%%F" > "another\directory\%%~nF.tsv" ``` ...which runs a for loop on files in no particular order (alphabetically...
2018/03/11
424
1,244
<issue_start>username_0: I have 3 RDDs: * 1st one is of form ((a,b),c). * 2nd one is of form (b,d). * 3rd one is of form (a,e). How can I perform join in scala over these RDDs such that my final output is of the form `((a,b),c,d,e)`?<issue_comment>username_1: ``` FOR /F "delims=" %%F IN ('dir /o-d /tc /b /s "director...
2018/03/11
1,531
5,669
<issue_start>username_0: This may seem a simple example but I am stuck. I am watching a tutorial where we see a contact form that has its own get route to render a view that contains the already said contact form. ``` $app->get('/contact',function (Request $request, Response $response){ return $this->view->render(...
2018/03/11
1,129
4,691
<issue_start>username_0: I'm using firebase storage for an app so that I can store images I want to be displayed in a popup window. Right now I can reference the image but I'm unable to get the `URL` for the image using `getDownloadURL()`. I've tried everything but can't seem to get the URL and only get errors in the...
2018/03/11
1,006
3,489
<issue_start>username_0: I'm facing memory issues running structured stream with aggregation and partitioning in Spark 2.2.0: ```scala session .readStream() .schema(inputSchema) .option(OPTION_KEY_DELIMITER, OPTION_VALUE_DELIMITER_TAB) .option(OPTION_KEY_QUOTE, OPTION_VALUE_QUOTATION_OFF) .csv("s3...
2018/03/11
866
2,972
<issue_start>username_0: Is it possible to get a twitter account's username from an instance of the Twitter REST client? Specifically, I would like to get the name for the twitter account associated with the client's access tokens and secrets. I searched through the [twitter gem documentation on rubydoc](http://www.r...
2018/03/11
914
2,757
<issue_start>username_0: I'm facing a dead end here.. I have collected a huge amount of data and I have isolated only the information that I'm interested in, into a 500K x 2 array of pairs. 1st column contains an ID of, let's say, an Access Point. 2nd column contains a string. There might be multiple occurrences of...
2018/03/11
1,083
3,508
<issue_start>username_0: This is my first time using such forum. I have exactly the same question as here: [How to release an object and clear memory in VBA](https://stackoverflow.com/questions/31655418/how-to-release-an-object-and-clear-memory-in-vba) In this thread, the question was unfortunately not solved... With...
2018/03/11
1,257
4,852
<issue_start>username_0: I want to create a Manager that holds multiple objects and has to be used in order to actually create the objects. The objects hold their information in a smart pointer. this is how I implemented it: ``` struct Object { std::shared_ptr number; }; struct Manager { std::vector objects; O...
2018/03/11
4,784
17,157
<issue_start>username_0: I'm so stuck. I'm learning `C` and have this question: How can I use an array of strings as a lookup table? I have a list of 'keys: ``` "A", "A#", "B", "Bb", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#" ``` And each will refer to a specific int 'value' (which isn't unique). e.g. `"A" ...
2018/03/11
5,403
19,338
<issue_start>username_0: I am updating an Access 2013 table through VBA. My task requires certain records to be added to the table during a loop and subsequently records to be read from the (updated) table. I am finding that my code works as expected provided I run through the code line by line in debug mode. However, ...
2018/03/11
1,981
6,515
<issue_start>username_0: I have JS array with strings, for example: ``` var strArray = [ "q", "w", "w", "e", "i", "u", "r"]; ``` I need to compare for duplicate strings inside array, and if duplicate string exists, there should be alert box pointing to that string. I was trying to compare it with `for` loop, but I ...
2018/03/11
1,031
3,662
<issue_start>username_0: I creating an itinerary generation app where the user is required to enter the dates of his/her trip. The only problem is, using UIDatePicker the dates are always given as the current time for a given day/month/year. In a separate file I've extended Date class to try and write a simple method...
2018/03/11
506
2,137
<issue_start>username_0: I am trying to read parts of a text file with the format ``` <NAME> 72 160 ``` The first line being the name (string), and the second and third lines being height and weight (both ints). However, I cannot find a way to store each of these into their own variables, instead I can only figure o...
2018/03/11
385
1,379
<issue_start>username_0: i have this code: the idea is to print the list of the 10 random numbers and then add 6 to each item on the list and finally print new list with the new numbers after the additions: I've tried several modification but all of them are failing, any ideas?? ``` var myArray = []; appendItem(myArra...
2018/03/11
279
1,046
<issue_start>username_0: I need to extract number from string 'iama5559348number'. Answer should do non capturing and expected output is 5559348. I am trying by doing this way `print(re.search(r'([^(.*)]?[0-9]*)','iama5559348number'))`but I am getting only only first letter<issue_comment>username_1: Reading and parsin...
2018/03/11
1,925
6,557
<issue_start>username_0: I copied configuration of maven shade plugin straight from apache maven documentation <https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html> This is my current set up: ``` org.apache.maven.plugins maven-shade-plugin 3.1.0 shade com.my.app.MainClass ...
2018/03/11
612
2,633
<issue_start>username_0: I use SpringIntegration-filter for validate my WS message. I implement Validators for validating and if WS message is valid, they returns true. But if WS messages are invalid, they throws a MyValidationException. Is there a way for handle this exceptions with usage of SpringIntegration-filter?...
2018/03/11
601
2,255
<issue_start>username_0: Numerous examples, on stackoverflow and elsewhere, show setInterval calling a function by name, followed by interval parameter. As in, it makes sense that the following would work: ``` function sayHi() { window.alert('hello')} window.setInterval(sayHi, 1000) ``` Also tried (though thi...
2018/03/11
635
2,416
<issue_start>username_0: I have a simple asp.net core web api application (using the default web api template in Visual Studio 2017) using nlog for logging message to console in JSON format. * ASP.NET Core 2: 2.0.5 * NLog version: 4.5.0-rc07 * NLog.Web.AspNetCore: 4.5.0-rc03 Here is the NLog configuration file: ```x...
2018/03/11
586
2,060
<issue_start>username_0: If I load the PHP variable $text with the following HTML code: ``` $text = '' ; $text .= '' ; $text .= '' ; $text .= ' ' ; $text .= '' ; $text .= '' ; $text .= ' hello ' ; $txt .= '' ; $text .= '' ; ``` What function do I use to have $text render as a new web-page?<issue_co...
2018/03/11
1,299
5,364
<issue_start>username_0: I'm a beginner in Swift and tried to build an app where an array saves the items in a tableView by Core Data. That works. But what won't work is to delete the right row by swiping. It is deleted the right row first. But when I go back to the app, it is the row above the initial selected row de...
2018/03/11
948
3,658
<issue_start>username_0: I have an rx chain that calls an API through Retrofit. I subscribe to my API service, with standard rx `subscribe({...})` method and pass a lambda to it. Unfortunately when my call is finally completed, all the code I have added to be executed inside lambda is totally ignored. AndroidStudio sug...
2018/03/11
713
2,397
<issue_start>username_0: I have table called `PRODUCTDATA` which has the following data: [![enter image description here](https://i.stack.imgur.com/o0MJa.png)](https://i.stack.imgur.com/o0MJa.png) To get the `prodctunits` from `PRODUCTDATA` table from `ET`, P1 and ML column values that can be present in any of the co...
2018/03/11
1,328
4,009
<issue_start>username_0: I have these settings in the file `config/log.js` ``` let {transports: transp, createLogger} = require('winston'); let commonSettings = { colorize: false, maxsize: 10000000, maxfiles: 10, timestamp: true }; let settings = [{ filename: 'logs/warn.log', level: 'warn' }]; ...
2018/03/11
336
1,180
<issue_start>username_0: I was solving a C++ test question at [crossover.com](https://www.crossover.com) and there is a question which asks output of this: ``` for(unsigned char i=0;i<128;i++)printf("hello world"); ``` The [reference](http://en.cppreference.com/w/cpp/language/for) shows only one or two semicolons. I...
2018/03/11
1,389
4,784
<issue_start>username_0: Sometimes when I startup VSCode and I save an JS file, everything gets messed up. example ======= From: [![enter image description here](https://i.stack.imgur.com/qw6vU.png)](https://i.stack.imgur.com/qw6vU.png) To: [![enter image description here](https://i.stack.imgur.com/fOR2B.png)](https:...
2018/03/11
608
2,083
<issue_start>username_0: The following code seeks to highlight which button has been pressed. The issue is that, while when one presses "No" and it, as expected, turns Red, the "Yes" button's background color seems to be black and not blue. ``` this.state = { color: { box1: 'blue', ...
2018/03/11
1,009
3,037
<issue_start>username_0: how can I create a button animation like this using css? [what I want to achieve](https://i.stack.imgur.com/WDFf5.png) I want to display only first letter of button, and when hover it expands and shows rest of letters. maybe something like: ``` hello ``` and css: ``` button { width: 4...
2018/03/11
602
2,039
<issue_start>username_0: I have an XML document containing a number of XML Processing Instructions which are of the form: ``` cpdoc something? ``` I am trying to match them in awk with the pattern ``` /^\<\?cpdoc/ ``` but it's not returning anything. If I remove the `^` anchor, it works (but I have other similar ...
2018/03/11
649
2,089
<issue_start>username_0: I am in need of some help, please? I can successfully do a MySQL query using: IP\_Address/fund\_list.php?Id\_Number=555666 With this below: ``` $ID = $_GET['Id_Number']; $sql = "SELECT * FROM fund_list WHERE Number = ".$ID; ``` --- Now I want to use 2 different things in my web call. Like...
2018/03/11
1,322
4,937
<issue_start>username_0: In angular, how do I detect if a certain element is in view? For example, I have the following: ``` Test ``` Is there a way to detect when this div is in view? Thanks.<issue_comment>username_1: Based off this [answer](https://stackoverflow.com/a/22480938/3367818), adapted to Angular: Temp...
2018/03/11
602
1,394
<issue_start>username_0: I want to group list digits by their value and calculate sum of each group. Basically, it looks this way: input: ``` list = [0,1,1,0,0,0,1,0,1,1,1,1,0] ``` OUT (which i want to get): ``` newList = [0,2,0,1,0,4,0] ``` Any ideas how to acheive this in Python? Thanks<issue_comment>username...
2018/03/11
1,520
5,687
<issue_start>username_0: It is possible to find a child if we know its type and name (if specified) like this: ``` QPushButton *button = parentWidget->findChild("button1"); ``` However each `QObject` has `metaObject()` function property which returns `QMetaObject*`. In its turn `QMetaObject` has function `className(...
2018/03/11
1,416
5,298
<issue_start>username_0: Is there any way to use `react-semantic-ui`'s to have a sticky sidebar? One way to achieve the sticky behavior is to just skip and not use , but then I can't use 's `dimmed` prop. Other than the method I stated above, I found no other method that's not too hacky.<issue_comment>username_1: `f...
2018/03/11
1,246
3,762
<issue_start>username_0: I'm using pyplot.savefig to save a matplotlib figure as a .png and this code works: ``` pyplot.savefig('tempfile.png', bbox_inches='tight', pad_inches=0.0) i = wx.Image('tempfile.png', 'image/png', -1) i.Resize(size=(500,500), pos=(0,0), red=255, green=255, blue=255) png = i.ConvertToBitmap() ...
2018/03/11
2,079
7,680
<issue_start>username_0: I have been going through Google's Machine Learning Crash Course, and am at the "First steps with TensorFlow" section. I wanted to run the examples on my machine, and keep getting an error that says: ``` ValueError: Could not find trained model in model_dir: C:\Users\Username\AppData \Local\T...
2018/03/11
909
3,046
<issue_start>username_0: i have a problem with my React app: *cannot read property 'enqueueSetState' of undefined* i have 2 components: ``` import React, { Component } from 'react'; import Display from '../Display/Display.js'; class Button extends Component { clicked(e){ Display.prototype.clicked(e); }; rende...
2018/03/11
517
1,940
<issue_start>username_0: I only have one activity and everything else is a fragment. However, I don't want to have a single toolbar in my main activity to modify in my fragments since only a few of the views will actually have a toolbar. This is the fragment's XML: ``` ... ... ``` OnCreateView: ``` @Override ...
2018/03/11
311
1,102
<issue_start>username_0: In my Express JS app, I am using **ejs view engine**, I want to pass variable to javascript file on client side. This is my render: ``` return res.render('data/show', { data: data }); ``` This is working for me: ``` var data = <%- JSON.stringify(data) %>; console.log(data); ``` Bu...
2018/03/11
817
2,334
<issue_start>username_0: Alright so If I have an int like this (used to store a line of ASM) ``` int example = 0x38600000; //0x38600000 = li r3, 0 ``` How would I split this int into 4 seperate sections? I've come up with this ``` int example = 0x38600000; char splitINT[4]; for(int i = 0; i < 4; i++) { splitIN...
2018/03/11
783
2,797
<issue_start>username_0: I am solving a question on [LeetCode.com](https://leetcode.com/problems/subarray-product-less-than-k/description/): > > Given a vector `nums` of positive integers, count and print the number of (contiguous) subarrays where the product of all the elements in the subarray is less than k. > > ...
2018/03/11
349
1,448
<issue_start>username_0: I have an STM32F446 processor (Cortex M4 with FPU, havard architecture) and I planned to build a "mini computer" (screen, keyboard) with it. Is it possible to programm **assembler** on the device itself and let it programm/flash itself with that code or execute that code without the help of ex...
2018/03/11
468
1,605
<issue_start>username_0: I am maintaining a legacy site that was on a CMS 10 years ago. I found the following bit of code that apparently stripes tables for readability. ``` .content tr.odd { color: #6e6e6e; background-color: #ffffff; } .content tr.even { color: #6e6e6e; background-color: #f...
2018/03/11
482
1,786
<issue_start>username_0: so I'm currently trying to read user input into a char array, but every single example I've looked at defines the size of the array upon its initialization. What I'm looking for, essentially, is a way to read user input (perhaps with getline, as I would want to read user input as a string) and ...
2018/03/11
643
2,243
<issue_start>username_0: I'm trying to iterate through all the files in a directory and rename them from the prefix ABC to XYZ using the command below ``` while read file; do mv \"$file\" \"$(echo $file | sed -e s/ABC/XYZ/g)\" ; done < <(ls -1) ``` When I throw an echo in front of the `mv`, everything looks like it ...
2018/03/11
984
3,306
<issue_start>username_0: I'm trying to use Pug as a templating engine for sending transactional emails. I want to compile them during the build step, then just require/import the function in my code (to avoid compiling online). I'm using the Pug CLI to compile the templates. `pug ./src/emails/pug --client --pretty --...
2018/03/11
469
1,756
<issue_start>username_0: What is difference between private and public claims on jwt? I'm confused with the difference between those two claims. From what I understand they are both custom claims. So what is the difference?<issue_comment>username_1: Public claims ------------- Custom claim names that are required to ...
2018/03/11
1,001
3,439
<issue_start>username_0: I'm taking a class on databases and I'm doing an assignment on functional dependencies. As an example of taking given dependencies and deriving other non-trivial dependencies using Armstrong's Axioms, the TA wrote this and I can't wrap my head around it. Considering the relation R(c,p,h,s,e,n)...
2018/03/11
1,066
3,034
<issue_start>username_0: Here is the given list. ``` Pets = [{'f1': {'dogs': 2, 'cats': 3, 'fish': 1}, 'f2': {'dogs': 3, 'cats': 2}}, {'f1': {'dogs': 5, 'cats': 2, 'fish': 3}}] ``` I need to use the map and reduce function so that I can have a final result of ``` {'dogs': 10, 'cats': 7, 'fish'...
2018/03/11
834
2,880
<issue_start>username_0: I am trying to queue a bunch of asynchronous calls to fire in parallel. However, the promises I am queuing have additional data that I want to keep along with the promise value. My question is: how can I pass an object or array, which contains a promise, and have the promises resolve to a valu...
2018/03/11
1,256
4,658
<issue_start>username_0: I want to use Java 8's stream api for the following exercise: * Given a `List persons` * `Person` is a simple POJO with a name (string) and age (int) property * Construct the following String `Names=[joe,diana,thomas]&Ages=[34,52,19]` What I can easily do with streams is the following: ``` S...