date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/03/20
531
1,967
<issue_start>username_0: In Haskell, I know that there are tuples `(x1,x2,x3)` and also lists `[x1,x2,x3]` and that tuples are not homogeneous and have a fixed length. On the other hand, lists can be rewritten for example in the form `x1:x2:x3:[]`, which I guess is a function `a ->[a]->[a]`, which makes some sense to ...
2018/03/20
1,333
4,225
<issue_start>username_0: I'm trying to inserting the values of counter into an array called numpay.Unfortunately nothing happens.Where's my mistake?Here's what i tried below. ``` Example-1 function validateForm() { var months=(principal+principal\*interestrate\*0.01)/monthlypayment; var numpay = new Array(month...
2018/03/20
1,720
6,313
<issue_start>username_0: Okay, I did some research and apparently there are a lot of duplicate questions on SO on this topic, to name a few: * [Elegant solution to duplicate, const and non-const, getters?](https://stackoverflow.com/questions/856542/elegant-solution-to-duplicate-const-and-non-const-getters) * [How to a...
2018/03/20
1,484
5,573
<issue_start>username_0: I am trying to create a summary list for people in a downstream application to feed several of my production machines. Each machine is going to have their own tab to request material, and I want all of their requests to be summarized on one tab (called "Core\_Cutter\_List"). So basically I am ...
2018/03/20
388
1,263
<issue_start>username_0: Say I have a function. If I wanted to add it as a method to an object, I would use: ``` let foofunc = function() {} { foo: foofunc } ``` However, what if I want to add it as a getter? You'd think I could do it like this: ``` { get x: foofunc } ``` but my IDE complains, so I assume tha...
2018/03/20
792
3,175
<issue_start>username_0: Building a custom template for the wagtail `StreamField` block I found myself in the situation that I need somehow pass the ID of the current block to the other views. For instance when the URL is clicked in the particular block, the landing page `view` must know exactly in which of the blocks...
2018/03/20
2,337
8,704
<issue_start>username_0: I have a standard field in a form for location, using Google Places API. ``` ``` As a user types, it shows suggestions below. Is there a setting to also fill in the field with the first returned value? This is what it currently looks like: [![enter image description here](https://i.stack...
2018/03/20
1,459
5,539
<issue_start>username_0: Consider these following classes: ``` class A{ } class B extends A{ } ``` As we know this compiles fine: ``` List extends A xx = new ArrayList**(); List extends List<? extends A> xy = new ArrayList>();** ``` But this gives compile time error ``` List extends A yx = new ArrayList extends ...
2018/03/20
529
1,658
<issue_start>username_0: Using the following class, I would like to be able to create an instance of a specified `Foo()` to store and call a function, but how can I transmit the necessary arguments to a function `call` ? ``` template struct Foo { std::function func; Foo(const std::function &funcIn) : func(funcIn) {...
2018/03/20
865
3,360
<issue_start>username_0: I have made a new widget that has two different layout designs in my CSHTML depending on customers needs. All other code is the same, it is only the HTML that is really different. Instead of having two different widgets, I was wondering if I could use parameters in the CSHTML. Then call them in...
2018/03/20
326
1,183
<issue_start>username_0: While running `docker:dind` I can't use `docker login` command and any other docker command. My use case is that I got a Nexus Docker Registry and I'm trying to connect to this registry through GitLab CI. ``` docker run --rm -it docker:stable-dind docker login -u user -p password https://regi...
2018/03/20
1,000
3,670
<issue_start>username_0: If I want project `A` to compile and tests to run but when I place it as a dependency into project `B` then project `A`'s dependencies should not be available to project `B`. For example: 1. Add `org.example.foo` as a dependency into project `A` (not `B`) 2. Add project `A` as a dependency in...
2018/03/20
811
2,502
<issue_start>username_0: I have a function that uses dplyr to summarize a variable. I want to be able to pass the name of the summary function as a parameter. The approach below works (using match.fun). I was wondering if there is a better/simpler approach? ``` exampleFunction <- function(df, var, function_name, ...){...
2018/03/20
917
3,395
<issue_start>username_0: Currently I am working on to deploy the Azure SQL Database by adding multiple IP addresses under Firewall rules using Azure ARM templates. This is the code for adding one IP address under Firewall settings of Azure SQL Server. ``` { "name": "AllowAllMicrosoftAzureIps", "type": "fi...
2018/03/20
2,266
4,746
<issue_start>username_0: I have a csv file with a column containing dates, but the dates are in two different formats: "m/d/y H:M" and "y m d H:M:S". I want to make a new column with these dates all in one format (I don't care which one). I tried the parse\_date\_time function but it would only work for one of the form...
2018/03/20
871
3,255
<issue_start>username_0: I need to get the frames from a local video file so i can process them before the video is played. I already tried using AVAssetReader and VideoOutput. [EDIT] Here is the code i used from [Accesing Individual Frames using AV Player](https://stackoverflow.com/questions/39570745/accesing-individ...
2018/03/20
380
1,490
<issue_start>username_0: I have a baseclass that inherits from Monobehaviour. How do i cast my monobehaviour to the base class when finding it in the hierarchy? ```cs GameManager : MonoBehaviour { public MonoBaseClass MyThing; void Awake() { MyThing = GameObject.Find("Child") as MonoBaseClass; } ...
2018/03/20
1,696
5,995
<issue_start>username_0: Our Rest API takes JSON input from several external parties. They all use "ISO-ish" formats, but the formatting of the time zone offset is slightly different. These are some of the most common formats we see: ``` 2018-01-01T15:56:31.410Z 2018-01-01T15:56:31.41Z 2018-01-01T15:56:31Z 2018-01-01T...
2018/03/20
493
1,654
<issue_start>username_0: I followed this video: <https://www.youtube.com/watch?v=Y2q_b4ugPWk> and got my cmd to recognize python as a path variable. But this only works if I open cmd and powershell as an Admin. How do I get it to work for all users? As Admin: ``` PS C:\windows\system32> python Python 3.6.4 |Anaconda...
2018/03/20
436
1,521
<issue_start>username_0: I have this URL here with my access key, ``` https://api.instagram.com/v1/users/MY_USER_ID/media/recent?access_token=MY_ACCESS_KEY ``` but it only returns 1 item. I have googled for a solution, but can't seem to find one. This was **working** about a **month ago** and now it's broken. I...
2018/03/20
325
1,125
<issue_start>username_0: I need assistance in creating a program that takes a vector of strings and combines it with a vector of numbers. To produce an output of (for example) Apple.1, Orange.1, Peach.1, Apple.2, Orange.2, Peach.2 I currently have ``` rep(paste(c("Apple", "Orange", "Peach"), c(1,2), sep='.') each...
2018/03/20
274
1,012
<issue_start>username_0: I am able to read the messages from activemq using camel context[xml], but i could like to read only no of the messages, for example if queue contains 10 000 messages, we want to read only first 1 000 messages, remaining shouldn't be touched. I am new to the camel<issue_comment>username_1: Wit...
2018/03/20
1,364
4,668
<issue_start>username_0: No matter what I try I keep hitting the "MongoClient opened before fork" warning regarding not forking active mongo connections when trying to use multiprocessing on a mongoengine db. The [standard mongo advice](http://api.mongodb.com/python/current/faq.html#using-pymongo-with-multiprocessing) ...
2018/03/20
594
1,856
<issue_start>username_0: I'm building a line-through header that can span multiple lines. Using the sample code below, is it possible to write my CSS in such a way that the left and right divs are not needed? Where they could be added as pseudo-classes to my header class? [CodePen](https://codepen.io/nickvsg/pen/qordB...
2018/03/20
1,295
4,049
<issue_start>username_0: This is where I am at now: ``` CharList = [] text = "xxxxAAaaaSSSxxx" PasswordSubHT = {"a":"@" , "A":"4" , "S":"5"} for LETTER in text: CharList.append(LETTER) for EL in CharList: if EL in PasswordSubHT: print(text.replace(EL,str(PasswordSubHT[EL]))) ``` This is what I get: ...
2018/03/20
1,158
3,856
<issue_start>username_0: I have an http ohs that redirects requests to weblogic 12c; I would like to introduce error 404 if there was a redirect to a custom page and did not display the default weblogic error. Here is the apache location configuration: ``` WebLogicCluster xxxxxx:xxxx,xxxxxx:xxxx Set...
2018/03/20
988
3,170
<issue_start>username_0: Cross entropy formula: [![enter image description here](https://i.stack.imgur.com/W3xm0.gif)](https://i.stack.imgur.com/W3xm0.gif) But why does the following give `loss = 0.7437` instead of `loss = 0` (since `1*log(1) = 0`)? ```python import torch import torch.nn as nn from torch.autograd im...
2018/03/20
567
2,093
<issue_start>username_0: When developed the app in XCode8 it used to work fine, both in Portrait and Landscape modes. Didn't change anything particular. Now started to developed in Xcode9, Portrait works fine but any View in the App, if switched to Landscape it acts weird. Like in the images , view gets cut off [![...
2018/03/20
818
2,522
<issue_start>username_0: I have the following script: ``` User.includes(:owned_ratings).map{|x| x.owned_ratings.average(:score)} ``` calling `x.owned_ratings.average(:score)` causes n+1 queries: ``` (0.2ms) SELECT AVG("ratings"."score") FROM "ratings" INNER JOIN "video_chats" ON "ratings"."video_chat_id" = "vid...
2018/03/20
611
1,852
<issue_start>username_0: I am using python for C code generation, I want to have a function that prints the following: ``` { .data1="egg", .data2="dog", }, ``` I tried this function: ``` def funky(data1,data2): return """\ { .data1="egg", .data2="dog", },""".format(data1,data2) ``` Calling "`f...
2018/03/20
1,371
5,698
<issue_start>username_0: I have been spending the day learning how Azure Functions work. I have gotten my Azure Function registered with my Azure Active Directory, and have registered this application to be secured by way of my Azure Active Directory provide in my Azure Portal. I have deployed this to Azure and everyt...
2018/03/20
238
831
<issue_start>username_0: In an xml file, how to change all occurrence of *annotation* tag which is in format: ``` ``` to: ``` ``` I couldn't figure out options to do this using xmlstarlet<issue_comment>username_1: The following [xmlstarlet](/questions/tagged/xmlstarlet "show questions tagged 'xmlstarlet'") comman...
2018/03/20
730
2,273
<issue_start>username_0: i am trying to send JSON data to PHP server, but i can understand how can i parse my JSON in PHP and insert values in Mysql database. Here is how looks my JSON data ``` {"reps_list":{"selected_subcategory_id":[0,1,2]}} ``` Here is my PHP code: ``` $reps_list = $_POST['reps_list']; $reps_...
2018/03/20
897
2,935
<issue_start>username_0: Consider this example of solving [Advent of Code 2015 1.2](https://adventofcode.com/2015/day/1). ``` fn main() { // advent of code 1.2 2015 // you are at floor 0 // if instruction is ) go one floor up, else go one floor down // what index has the character that makes you go be...
2018/03/20
1,509
3,514
<issue_start>username_0: Take a look at following code: [typescript playground](https://www.typescriptlang.org/play/#src=interface%20A%20%7B%0D%0A%20%20get()%3A%20number%3B%0D%0A%7D%0D%0A%0D%0Aclass%20Smth1%20%7B%0D%0A%20%20public%20x%3A%20A%20%3D%20%7B%20value%3A%202%2C%20get()%20%7B%20return%20this.value%20%7D%20%7D%...
2018/03/20
1,171
4,908
<issue_start>username_0: I'm getting this to work on my production server, but on localhost `canMakePayment()` returns `null`. I've traced this through the minified Stripe code but hit a wall with function `ko` which just sends an action called `CAN_MAKE_PAYMENT` to some message queue, at which point execution becomes...
2018/03/20
1,888
5,401
<issue_start>username_0: I am using the example from [Here](https://github.com/aws/aws-logging-dotnet#apache-log4net) My log4net configuration looks like this: ``` MY\_Logs us-west-2 ``` my app.config: ``` xml version="1.0" encoding="utf-8"? ``` my awscredentials ``` [default] aws_access_key_id=[my_id] aw...
2018/03/20
1,394
6,165
<issue_start>username_0: I have a class set up to return a customised ObjectMapper. As far as I can find, the correct way to have Spring Boot use this ObjectMapper is to declare it as @Primary, which it is. ```java @Configuration public class MyJacksonConfiguration { @Bean @Primary pub...
2018/03/20
1,075
4,369
<issue_start>username_0: I have the following function: ``` function returnAge(PlayerId){ var data = [ {name : 'jack', isPlayer: true, games:[{id:343, age:12}, {id:3422, age :132}]}, { id :2 , name : 'king'}, {id: 145, name: 'james'} ] let filteredData= data.filter(item=>item.isP...
2018/03/20
723
2,580
<issue_start>username_0: I am currently working on a project with Python3, and was needed to implement such code, where I use an API that passes items with limit count, and need to figure out the latest items that have been added. I'm sure there must be a more pythonic way, but couldn't think of any. Kindly let me kno...
2018/03/20
782
2,591
<issue_start>username_0: I have a multi line strings which contain new line (\n) and non breaking space characters (\u00A0), latter shown for readability: **Sample 1** ``` dog \u00A0cat mat ``` **Sample 2** ``` bat can \u00A0boo ``` I would like to return a java regex match ONLY when the first instan...
2018/03/20
330
1,102
<issue_start>username_0: My requirement as follows: ``` ``` Above is the content in one file contact.xml where i need to get value of the password `qqqTy<PASSWORD>ahLDjHJH6LvQ==`. How can I achive that through an Ansible task?<issue_comment>username_1: You can use <https://docs.ansible.com/ansible/2.4/xml_module.ht...
2018/03/20
427
1,622
<issue_start>username_0: When executing `formBuild.group` I am creating two values ​​that I use only for validations, these two values ​​do not want to save in the database, I would remove them before saving in the database. **profile.component.ts:** `profileForm: FormGroup;` ``` constructor(){ this.profileForm ...
2018/03/20
811
2,527
<issue_start>username_0: I want to pass a bunch of boolean flags to a Windows batch script function. Something like this: ``` 1 SETLOCAL 2 SET _debug=1 3 SET _x64=1 4 5 call :COMPILE %_debug% %_x64% 6 :: call again where %_debug% is now 0 7 :: call again where %_x64% is now 0 8 :: etc... 9 10 :COM...
2018/03/20
1,426
4,716
<issue_start>username_0: For C++ code, doxygen has no insurmountable problem with `\code{.markdown}`. For example ``` //=========================================================================== //! \defgroup markdown_cpp C++ markdown test //! \brief test cpp markdown //! \date 2018 March //! //! \c...
2018/03/20
1,115
3,568
<issue_start>username_0: I am working on Struts 1 to 2 migration application. I have successfully migrated JSP, Action, POJO and XML too. But when I integrated Tiles 3 in my Struts 2 application, suddenly it is showing some bigger font size on web page, compared to Struts 1 + Tiles. I am not getting what exactly happ...
2018/03/20
863
2,637
<issue_start>username_0: SQLFiddle: <http://sqlfiddle.com/#!4/db1bd/49/0> I'm working on a query that returns an object's DN:`(cn=name,ou=folder,dc=hostname,dc=com)` My goal is to return this information in a "prettier" output akin to AD:`(name\folder\hostname.com)` I've accomplished this in a clunky way: ``` REGEX...
2018/03/20
615
1,795
<issue_start>username_0: I want to rename a file present in several subdirectories using bash script. my files are in folders: ./FolderA/ABCD/ABCD\_Something.ctl ./FolderA/EFGH/EFGH\_Something.ctl ./FolderA/WXYZ/WXYZ\_Something.ctl I want to rename all of the .ctl file with the same name (name.ctl). I tried seve...
2018/03/20
575
1,877
<issue_start>username_0: I am Using W3 Total cache plugin for WordPress. My post has one table which updates every minute/hour. But as I do caching, the server does not serves latest version, instead it displays cached copy to the visitor. How can I purge cache every 30 minutes automatically so that it shows latest ver...
2018/03/20
785
2,865
<issue_start>username_0: I have an application which I would like to deploy, compiled for java 1.8.0\_151. However, the user has only 1.8.0\_25. User cannot launch the app because `LocalDateStringConverter` is missing. As written here (<https://docs.oracle.com/javase/8/javafx/api/javafx/util/converter/LocalDateString...
2018/03/20
1,037
3,428
<issue_start>username_0: I tried making a simple "investing game". But for some reason the variable cash still says 1000 after the "investment". I also want to make this game continuous. Like the player can keep playing it and gaining/losing cash. The program is below! Thanks! ``` import sys import random print "INVES...
2018/03/20
915
3,111
<issue_start>username_0: I have installed node-sass and have set it up to recompile every time that the .scss source is changed. Separately I use nodemon to look for changes in my files and restart the server. My package.json script look like this: ``` "watch": "nodemon ./bin/www", "watch-css": "node-sass -w scss -o...
2018/03/20
1,917
5,930
<issue_start>username_0: As known, at the moment PostgreSQL has no method to compare two json values. The comparison like `json = json` doesn't work. But what about casting `json` to `text` before? Then ``` select ('{"x":"a", "y":"b"}')::json::text = ('{"x":"a", "y":"b"}')::json::text ``` returns `true` while ``...
2018/03/20
979
2,954
<issue_start>username_0: I've got some problems with python script. I'm not that good at this language, as I'm doing something for my friend. The code is working but output is straight up weird. Some random things instead of binary numbers. Here's the code: ``` def decToBin(n): wynik = "" while n > 0: ...
2018/03/20
799
2,417
<issue_start>username_0: I have a template of handlebars in which there are multiple div which i need to make clickable. However, in my div the text is dynamic, how will i be able to make whole div clickable. Here is the code ``` {{#each event}} {{#is this.event ../eventName }} ![](/Small/{{this.imageId}}.JPG) ...
2018/03/20
1,351
5,032
<issue_start>username_0: So I have a view -> UITextField & UILabel are the two children, I have multiple views that contain the children. I am using the delegate function below and I assign each of the UITextfields as delegates "textFieldShouldReturn(\_ textField: UITextField) -> Bool". However, they do not seem to cha...
2018/03/20
747
2,468
<issue_start>username_0: is there an easy way to generate Vector Drawable that is a circle with the icon inside from the existing vector drawable? Example: [![existing vector drawable](https://i.stack.imgur.com/X73Vn.png)](https://i.stack.imgur.com/X73Vn.png) [![generated vector drawable, circle with empty icon insid...
2018/03/20
630
2,146
<issue_start>username_0: I have a simple markup with just a body with nothing in it, when I style the body like this: ``` body { width: 200px; height: 200px; background-color: antiquewhite; margin: auto; } ``` In stead of just filling the body the whole screen is filled up with the background-color, ...
2018/03/20
1,134
3,096
<issue_start>username_0: I am using a white background for a Carousel using Bootstrap 4.0 and would like to change the color of the controls. It seems that bootstrap now uses SVG for their carousel icons. This means altering the attributes directly does not work. I am currently using Font Awesome for other elements on...
2018/03/20
308
1,022
<issue_start>username_0: Is it possible to pass command line arguments to a Spring boot app on Azure via the web.config file? Our app is up and running but we need to set the: ``` --spring.profiles.active=local ``` at startup. ``` xml version="1.0" encoding="UTF-8"? ```<issue_comment>username_1: I got a response ...
2018/03/20
352
1,508
<issue_start>username_0: I've got this basic setup, with `interrupt` having been registered from outside as edge-triggered callback for a GPIO pin: ``` public class Foo { private static final Object notifier = new Object(); public static GpioCallback interrupt = pin -> { synchronized (notifier) { notif...
2018/03/20
438
1,334
<issue_start>username_0: I am trying to get the index of the key in the map. I use distance for this. Why is the result always one off? I was expecting "ale" index to be 2 but the answer is 1. ``` #include #include int main(){ std::map my\_map; my\_map.insert(std::make\_pair("apple", 0)); my\_map.insert(std::...
2018/03/20
359
1,227
<issue_start>username_0: I have a dropdown list of car brands and I want to pass the value of the selected car brand to method getCarModelsByBrand(brand). Any help would be much appreciated. ``` Pasirinkite {{brand}} ```<issue_comment>username_1: Use [ngModel](https://angular.io/guide/template-syntax#inside-ngmode...
2018/03/20
1,068
4,205
<issue_start>username_0: I'm trying to display a list of names using an AsyncTask. `doInBackground()` stores all the names found on a database in a String array. ``` public class GetAll extends AsyncTask { public String convertStreamToString(InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDeli...
2018/03/20
534
1,966
<issue_start>username_0: Specifically, I'm trying to delay `a = 1 + 1` for 10 seconds. During this time, I would like the user to be able to input a value. If the user doesn't respond in time, I would `a = 1 + 1` to make `a = 2` which will cause a bomb to go off and kill the user. I tried using Sleep, but that halt...
2018/03/20
1,050
3,492
<issue_start>username_0: I'm trying to pass arguments to a MSI installer: ``` $Servers = @("ServerOne", "ServerTwo", "ServerThree") $InstallerArguments = @( "/i `"$InstallerPath`"", "/quiet", "/log `"$LogFile`"", "EMAILSERVER=`"$Servers[0]`"", "DATABASESERVER=`"$Servers[1]`"", "SHAREPOINTSERVE...
2018/03/20
974
3,191
<issue_start>username_0: I'm using primeng autocomplete input I would that when I focus on the input the blue glow effect get disabled. [![enter image description here](https://i.stack.imgur.com/mtiNF.png)](https://i.stack.imgur.com/mtiNF.png) Here's my html component ``` {{elm.name}} ( ID: {{elm.code}} ) ``` ...
2018/03/20
216
902
<issue_start>username_0: I Want to show splash screen until web-service response comes in the app.<issue_comment>username_1: `launchScreen.storyboard`'s VC stays a fixed time and directs to the `rootViewController` , You can create a view with the same look as the splash above the first VC's view and remove it when res...
2018/03/20
883
3,461
<issue_start>username_0: I have a superclass like this: ``` public abstract class Foo { //some method here public void aMethod() { //some code } } ``` and a 2 child-classes `BarOne` and `BarTwo` which extends `Foo` class. In `BarOne`, everything are normal, but in `BarTwo`, I want to `@De...
2018/03/20
864
2,600
<issue_start>username_0: I have the following dataframe in pandas: ``` df = pd.DataFrame({'field_1' : ['a', 'b', np.nan, 'a', 'c'], 'field_2': ['c', 'b', 'a', np.nan, 'c']}, index=[1,2,3,4,5]) ``` I want to apply the following function on the entire dataframe that replaces each value with something else. For examp...
2018/03/20
358
1,464
<issue_start>username_0: I would like to have a VOIP Gateway server to route/control calls from public site to internal network and vise versa. What I know of is Asterisk and FreeSwitch, can handle this job. But in term of functionality and security, I am confusing either to make a decision between Asterisk or FreeSwit...
2018/03/20
913
2,695
<issue_start>username_0: I have an archive with comma separated string I want to slip every line into 2 arrays: v[i].date and v[i].value. However, when I run the code it shows random values for the arrays. Is there anything I should change? > > Input > > 1761 > > 02/20/18,11403.7 > > 02/19/18,11225.3 > ...
2018/03/20
1,828
6,142
<issue_start>username_0: I have added a "before\_save" to my model to apply some logic to my model before saving. When I use this code, the record is created, then immediately updated (with the incorrect value). If I comment it out, there is no subsequent update when I create a new record. **Model** ``` class Transac...
2018/03/20
3,798
10,427
<issue_start>username_0: right now I'm in the middle at developing an application using Ruby and Mongo. But I got stuck when I deploy the application using gitlab-ci where it seems that mongo server doesn't start at test environment on gitlab runner. Here are my gitlab-ci.yml ``` stages : - test - deploy services: ...
2018/03/20
741
2,712
<issue_start>username_0: I am learning javascript. I used 'this' as below in javascript ``` let person = { name: 'Krishna', age: 35, sayHello() { return 'Hello, my name is ' + this.name; }, sayHi: () => `Hi ${this.name}` }; console.log(person.sayHello()); console.log(person.sayHi()); ``...
2018/03/20
553
1,695
<issue_start>username_0: When running a Corda 3 node, I get the following exception: ``` Exception in thread “main” java.lang.OutOfMemoryError: Java heap space ``` How can I increase the amount of memory available to the node?<issue_comment>username_1: You can run a node with additional memory by running the node's ...
2018/03/20
1,040
3,835
<issue_start>username_0: I believe this is a unique problem, but definitely link me to other answers elsewhere if they exist. I have a convolutional sequential network in Keras, very similar to the one in the [guide to the sequential model (and here is their model):](https://keras.io/getting-started/sequential-model-gu...
2018/03/20
1,406
5,926
<issue_start>username_0: I am trying to add the data from one json string to another in php, but I can't get it to work properly. These are my json strings. json\_A ``` { data: [ { date: "2018032012", p: [ ...
2018/03/20
641
2,646
<issue_start>username_0: I have two classes (Person and Payment) and I struggle with their communication. So can you show me how I can write a method Process which checks if given person exists? Also, I don't understand how I should take information from cmd and call a creatPeople and process methods in the main method...
2018/03/20
637
2,245
<issue_start>username_0: I am implementing this in Python with SQLite 3. I have the following table ‘parts’ with attributes part1, part2, and supplier. ``` part1 part2 supplier a j Foo b g Bar c d Nom a b Bar b k Bar c m Bar c l Foo ``` I want to select `part...
2018/03/20
377
1,195
<issue_start>username_0: I want to search for one string at the beginning of another in Python 3.x so I have ``` for pattern, responses in substrings: match = re.match(pattern, statement) if match: # etc. ``` But if one of substrings is `'no'` this will be found not only if the first word is 'no' but also ...
2018/03/20
2,065
7,261
<issue_start>username_0: I have two meteor call in client events in meteor, where i want to execute one after another. But as i debugged the flow dosen't follow the way i want it to be. **client.js** ``` Meteor.call('methodCall',param1,param2,param3,function (error, result) { if (error) console.log(err...
2018/03/20
618
1,712
<issue_start>username_0: Possibly there's an out-the-box method that will do all this for me! I need to get an array (to put into a select box) in the form i.e. **the expected output**: ``` array: [ "4" => "Siemens" "5" => "Dell" ] ``` Currently I'm doing (using Eloquent): `$array = $this->get(['id','manufactu...
2018/03/20
767
2,436
<issue_start>username_0: I've tried creating a basic registration form (I'm pretty new to PHP). The form works sometimes, but most of the times it's just sending blank entries into the MySQL database. Below is the code: I have the following form: ``` Participant 1 ------------- Year 1st Year 2nd Year 3rd Year ...
2018/03/20
405
1,402
<issue_start>username_0: I'm trying to create a window using glew but I am getting this link error. I also tried compiling the libraries myself, which didn't work either. I also made sure that glew is properly linked. Here's the code that's causing the error: ``` if (configuration.api == API::OpenGL) { static ...
2018/03/20
1,658
4,125
<issue_start>username_0: I want to get sum row values per day and per year, and showing on the same row. The database that the first and second queries get results from from include a table like this (ltg\_data): ``` time lon lat geom 2018-01-30 11:20:21 -105.4333 ...
2018/03/20
1,412
4,143
<issue_start>username_0: Suppose, you're given the following dataframe: ``` a <- data.frame(var = c(",1,2,3,", ",2,3,5,", ",1,3,5,5,")) ``` What I am looking for is to create the variables flag\_1, ..., flag\_7 in a containing the information of how many times the respective values occur. For a, I would expect the f...
2018/03/20
764
2,684
<issue_start>username_0: I'm a bit new to laravel and try to do a simple thing, just trying to select multiple rows with eloquent and tried : ``` php namespace App\Http\Controllers; use Auth; use App\Company; use App\User; use Illuminate\Support\Facades\View; use Model; class BaseController extends Controller { ...
2018/03/20
625
2,185
<issue_start>username_0: I am attempting to select just 2 distinct column to determine the records that are shown in my query. The column userid is capable of owning several houses which mean userid can be present multiple times currently. However, I only care if they specific colors of a house, so I'd like the userid ...
2018/03/20
2,131
6,588
<issue_start>username_0: I'm trying to create an animated plot using `matplotlib`. It works as expected when i'm using integers for the `X` values: ``` #!/usr/bin/env python import os import random import numpy as np from datetime import datetime as dt, timedelta from collections import deque import matplotlib.pyplot...
2018/03/20
899
3,910
<issue_start>username_0: What is meant by Activation function in Machine learning. I go through with most of the articles and videos, everyone states or compare that with neural network. I'am a newbie to machine learning and not that much familiar with deep learning and neural networks. So, can any one explain me what ...
2018/03/20
1,200
3,739
<issue_start>username_0: In a child-parent table, I need to aggregate all parents for each child. I can readily get children per parent in a CTE query, but can't figure how to reverse it ([sqfiddle here](http://sqlfiddle.com/#!17/bb52c/1)). Given this: ``` CREATE TABLE rel( child integer, parent integer ); INSERT...
2018/03/20
458
1,823
<issue_start>username_0: We are using a tool in which we need to delete log tables.Right now,we are keeping 1 million rows and deleting rest of rows if any.This is time consuming and sometimes in production takes 12 hours to delete the data,which affects daily transactions.Is there any other way to delete log tables ef...
2018/03/20
735
2,353
<issue_start>username_0: I am trying to achieve the following: ``` IMG TEXT IMG TEXT ``` Here is what I have so far: ``` var ws_ftr = data.ws_ftr.records; console.log(JSON.stringify(ws_ftr)); jQuery.each(ws_ftr, function(index, ftr) { jQuery('.carousel-inner').append(''); jQuery('.item').ap...
2018/03/20
777
2,346
<issue_start>username_0: I am trying to use Python3 and Pandas to shape a dataframe. My current frame looks like this: ```html .tg {border-collapse:collapse;border-spacing:0;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}...
2018/03/20
631
2,144
<issue_start>username_0: I have integrated froala editor on my HTML page. I need to fetch the data I have written inside the `div` with its HTML properties. Below is my code: **html** ``` click The editor can use `BR` tags. When ENTER key is hit, a `BR` tag is inserted. ``` **js code** ``` $('div#froala-edito...
2018/03/20
638
2,443
<issue_start>username_0: I'm doing a WPF application with a *UserControl* with a *TextBlock* element. The content of this elements depends on an enum in the view model (Success, Pending, Error etc.). Here are some example of the different states the TextBlock: **Example 1 - Simple** ``` Please wait ``` **Example...
2018/03/20
284
1,048
<issue_start>username_0: I am looking for a way to change css of the focused element. ``` input.on("select2-focus", function(elem) { console.log('FOCUSING'); $(this).css('background-color', 'yellow'); }); ``` What I am trying to do is, the clicked focus element should have the background color yellow. But ...
2018/03/20
712
2,415
<issue_start>username_0: I was trying to display the status of processing to the user on the front end when I was using *StreamingHttpResponse*. I was able to get the current status but it is being appended to the previous one. I want the response template to contain only the current yield. > > views.py > > > ...
2018/03/20
1,264
4,950
<issue_start>username_0: currently I am working on a Jenetics ([link to jenetics](http://jenetics.io/)) implementation to optimize a particle accelerator beam line. My fitness function calls accelerator detector devices and is defined as follows: ``` private double fitness(final DoubleChromosome chromosomes) { // ...