date
stringlengths
10
10
nb_tokens
int64
60
629k
text_size
int64
234
1.02M
content
stringlengths
234
1.02M
2018/03/09
431
1,334
<issue_start>username_0: I am trying to take a text file with dates and reformat them. Ex: `'1/31/2017'` becomes `'2017-1-31T:00:00:00Z'` Code: ``` with open("test.rtf") as f: data = f.readlines() for line in data: a,b,c = line.split("/") if len(a) < 2: a = "0" + a if len(b) <2: b =...
2018/03/09
500
1,541
<issue_start>username_0: I want to run python script from php. this is my python code. It is saved in /home/pi and name of file is hello.py ``` #! /usr/bin/python import bluetooth bd_addr="xx:xx:xx:xx:xx:xx" port=1 sock=bluetooth.BluetoothSocket(bluetooth.RFCOMM) sock.connect((bd_addr.port)) data="" while 1: try: ...
2018/03/09
294
1,029
<issue_start>username_0: In my master page (his name is menu.master) , i want to create 3 menu , the first (title) , the second (example2) and the footer (copyright ) my question is : how to make ( here is my code in masterpage ``` [Home](test1.aspx) [Contacter](contact.aspx) ### ........... ```<issue_com...
2018/03/09
1,118
3,215
<issue_start>username_0: I'd like to replicate the following excel formula without using constants in VBA ``` =MAX(A9:A13) =MAX(A4:A8,A14:A18) ``` wherein the selection start and end (A9) and (A13) is a dynamic cell(not limited to A column) and is stored in the variables startVar and endVar. For =MAX(A9:A13) I di...
2018/03/09
1,079
3,254
<issue_start>username_0: I am learning with and at the same time trying to put together a small application in MS Access (pls don't judge:)) and all they .accdb files I produced are inordinately large in comparison to their contents. E.g. I have on database with 4 tables, each with about 20 entries and 2-4 columns for...
2018/03/09
1,299
3,727
<issue_start>username_0: i already read related post about reading a.config. The strategy is to use property, and method getproperty(). But what if i only have values there? how can i extract all value out? for example: ``` server1 127.0.0.1 50000 server2 127.0.0.1 50001 server3 127.0.0.1 50002 server4 127.0.0.1 5000...
2018/03/09
2,244
6,977
<issue_start>username_0: I've got a struggle. I have a code that works perfectly but I have to set my own ranges (scales) in the code as you can see (cato0 to cato 8). My codes has to function on all sort of data (currency), It could be millions it could be K's. But is has to be rounded to perfect obvious scales. If so...
2018/03/09
2,518
6,849
<issue_start>username_0: I have post a request and test it on postman , the response return correctly on postman and android logcat , but on retrofit it returns null in the body here is the model of the response ``` public class DriverResponse implements Serializable{ @SerializedName("errors") @Expose public Errors...
2018/03/09
1,006
3,820
<issue_start>username_0: when i navigate from /home to /dashboard,router is working fine but when i navigate from /home to /profile:id, router navigates me to that profile page which is also working fine,but when i refresh it,then it becomes blank page and does not give me any 404 or redirects back to home page,i am us...
2018/03/09
3,785
13,877
<issue_start>username_0: I am facing the following problem. I have an ASP Net Core 2 web app that I want to deploy to Azure. The app authentication is integrated with the Azure Active Directory, so when I try to login the following requests happen: ``` GET https://login.microsoftonline.com/ecf3f643-27e5-4aa7-9d56-fd35...
2018/03/09
2,633
8,281
<issue_start>username_0: Trying to work out why i get a error when using delete on this array pointer? Trying to load png images not sure whats going on The error is when using `delete[] chunks;` The code ``` typedef struct { char r; char g; char b; char a; } pixel; class chunk { public: unsign...
2018/03/09
1,635
5,076
<issue_start>username_0: Good afternoon! Now I'm doing with something like a blog on django. But I do not understand how you can make it so that you can put not one author of the post, but two, three, four, etc. Thank you so much<issue_comment>username_1: Add default constructor to your `chunk` class. ``` chunk::chun...
2018/03/09
1,847
5,803
<issue_start>username_0: According to the instructions in the React documentation, it is possible to set the `keys` of the elements of the `array` by it's `ID`. Actually the question is, where does the react take the ID data according to the instruction (and its does not be an **index** of an elements): From React do...
2018/03/09
656
2,268
<issue_start>username_0: I'm using containers built from external images provided by a coworker. The whole application is a testing instance of a production environment. I need to know which version of Java is running inside a container. I assume that is something like: ``` docker container_name java -version ``` B...
2018/03/09
634
2,138
<issue_start>username_0: I want to hide vertical scrollbar and show horizontal scrollbar in talbe in HTML. If I use: ``` #element::-webkit-scrollbar { display: none; } ``` The result is both vertical and horizontal scrollbar are hidden. So, you can show me how to do with it ?<issue_comment>username_1: ``` docker...
2018/03/09
589
2,037
<issue_start>username_0: I try to validate the form on the page /order/create, before ajax request ``` @model rentcar2.Models.mOrderSnapshot ... @Html.EditorFor(model => model.Fam) .... $('#test').click(function () { if ($("#order").valid()) { alert(1); } else { alert(2); } alert(3); }); ``` But after Alert ...
2018/03/09
621
1,562
<issue_start>username_0: I'm trying to write a regular expression in oracle that match the following number format : ab0ab0 where b can be strictly equal to a-1 or a+1 but I'm having difficulties with increasing or decreasing a digit value in regex. I don't want to add all possible values in the regular expression wi...
2018/03/09
437
1,837
<issue_start>username_0: Trying API Explorer <https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/profiles/insert> as per settings in attach screenshot. The New GA View that's created has Ecommerce settings enabled (as expected) but Enhanced Ecommerce toggle still switched off... ...
2018/03/09
426
1,503
<issue_start>username_0: I noticed a pretty feature in Visual Studio Code (don't know if it's due to the GitLens extension): when I'm editing a line I can see the GIT annotation of that line including author, time of last edit and commit message. [![enter image description here](https://i.stack.imgur.com/6ZLRF.png)](h...
2018/03/09
3,638
16,668
<issue_start>username_0: I recently developed a special camera preview, because I needed to unmirror the default preview. The code is as follows: ``` public class CameraApi extends AppCompatActivity { private static final String TAG = "CameraAPI"; protected TextureView textureView; private static final Spa...
2018/03/09
544
1,571
<issue_start>username_0: I have a plot where I gather 10 points via mouseclick events on a 2d grid [-55 - 55, -35, 35]. After that I'm adding a label representing the 10 points and save it in a list. Here is a sample entry of the result list: ``` : [[-38.39, 20.3], [-38.25, 12.27], [-38.39, 5.0], [-38.96, -3.48], [-...
2018/03/09
515
1,715
<issue_start>username_0: I need to show no results found message when user tries to filter any columns. Is there any way to achieve it in AG-Grid? ``` [noRowsOverlayComponent]="noRowsOverlayComponent" ``` Find the example here. Try to enter any incorrect value for any columns. <http://plnkr.co/edit/FPiWCCBVs6UFHuV...
2018/03/09
370
1,250
<issue_start>username_0: There has an example in Typescript Document. ``` interface NumberDictionary { [index: string]: number; length: number; // ok, length is a number name: string; // error, the type of 'name' is not a subtype of the indexer } ``` I'm understand why it's incorrect. But someti...
2018/03/09
1,082
4,365
<issue_start>username_0: Consider the following repository interface declaration: ``` interface KotlinUserRepository : Repository { fun findById(username: String): User fun search(username: String) = findById(username) } ``` I'm declaring a default interface method `search(…)` that defaults to invoking `findByI...
2018/03/09
1,062
3,501
<issue_start>username_0: I am making a small game where in I have 50 buttons and when I click on any one of the button, its color changes and amongst them, I have one button which is blue in color. If the player clicks on that blue button, he is a winner. He will be given only three chances. I have used a button `event...
2018/03/09
253
1,017
<issue_start>username_0: While running project on .netStandart2.0 get an exception Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.AddDbContext (Microsoft.Extensions.DependencyInjection.IServiceCollection,...
2018/03/09
486
1,680
<issue_start>username_0: I would like to get clients and their orders with cost > 100, which means I want to access `client.Orders` and fetch only those that have `cost > 100`. ``` var list1 = list.SelectMany(c => c.Orders.Where(x => x.Cost > 100), (c,x)=> c).Distinct(); public class Client { public string Fi...
2018/03/09
906
3,468
<issue_start>username_0: I have been trying this for a day now, and I can't seem to find the correct way to do this. I need a SQL query that returns me all locations with zero physical stock ( inventSum.PostedQty + inventSum.Received - inventSum.Deducted + inventSum.Registered - inventSum.Picked <= 0) I think it should...
2018/03/09
791
3,049
<issue_start>username_0: Anyone help me please. I'm new to coding. I want to create a new android application using only `HTML, CSS, JS (for cross- platform next time)`. I've struck with this problem for days. I finished my first page (index.html) and will do another page but when I link to the other pages, the side **...
2018/03/09
1,284
4,021
<issue_start>username_0: I have the following program which generates 100 million mac's and append it into the list. But the 100 million mac's generation and insertion itself takes ~7 Minutes in python??? ``` import datetime def mac_gen(): hex_byte1=0 hex_byte2=0 hex_byte3=0 hex_byte4=0 h...
2018/03/09
680
2,444
<issue_start>username_0: How do I get the value of `name`tag under `metadata` section of below yaml file. ``` apiVersion: v1 kind: Pod metadata: name: sss-pod-four namespace: default spec: containers: - name: sss-test-container image: anaudiyal/infinite-loop volu...
2018/03/09
755
1,884
<issue_start>username_0: Ok So I have an PHP array of data like the following ``` 0 0 0 0 0 0 500 // Get index of this value which is 6 11000 100 110 221 1245 2141// Get index of this value which is 12 0 0 0 0 0 ``` Is there a PHP function that would grab the **first Non-Zero Value index** and the **last Non-Zero v...
2018/03/09
1,553
4,730
<issue_start>username_0: I wonder if you can help. I have a table of staff names along with their sales By month as follows ``` Name | surname | local | Jan | Feb ————————————————+——— John. | Bushill | Exeter | 18,500 | 20,100 Richard | Niels. | Plymouth | 21,...
2018/03/09
315
1,264
<issue_start>username_0: Sorry for the title, it sounds confusing but how to avoid extra commit same message, here's the scenario. I modified some files, I do `git add . && git commit -m 'done something'`.. Later on when I PR into develop branch I realised I accidendally left a `'console.log(x)'`, now how can I remove...
2018/03/09
4,830
15,485
<issue_start>username_0: I have a problem running some R scripts on our cluster. The problems appeared suddenly (all the scripts were working just fine but one day they started giving a `caught segfault` error). I cannot provide reproducible code because I can't even reproduce the error on my own computer - it only hap...
2018/03/09
2,251
8,259
<issue_start>username_0: I have been working on creating a binding project for an iOS SDK for the last week or so. I have gone through the steps in the Xamarin Developer guides walkthrough, I created the .a library on the Mac and ran the sharpie tool to create ApiDefinitions and Structs. I then created the binding proj...
2018/03/09
738
2,600
<issue_start>username_0: I have the following function where the total amount is displayed when the relevant price is selected however i would like to make an IF where if after all prices are selected and then checked VAT to multiply by 1.2 the total. ``` function show_payment_values() { $(".sum").show(); fin...
2018/03/09
553
1,914
<issue_start>username_0: I am working on Unity 5.6.5f1 with VR enabled and Daydream selected for an Android app. So my application is working with daydream but I would like to get inputs from the Daydream remote (only a simple click). Is that possible without including the GVR sdk to my project? Alternatively, can I c...
2018/03/09
7,813
19,876
<issue_start>username_0: Until now, when I wanted to apply a function to, say, numeric columns only, I used ``` library(tidyverse) map(diamonds[map_lgl(diamonds, is.numeric)], range, na.rm = TRUE) ``` Now I am wondering if this is a situation where `map_if()` would be less clunky. What I tried is this: ``` map_if(...
2018/03/09
1,009
4,103
<issue_start>username_0: I am trying to work with Behave on Python. I was wondering if there would be a way to put my .py files somewhere else instead of being forced to put them all inside the "steps" folder. My current structure would look like this ``` tests/ features/ steps/ #all code inside here, for now ...
2018/03/09
473
1,372
<issue_start>username_0: I want to do something that can be passed through a function immediately after a value for example: ``` // my value let str = "example"; // my func let sum = value => { if(value.length + 1 == 7) { return true; } else{ return false; } } // I want it to work when I write it like this. con...
2018/03/09
268
954
<issue_start>username_0: [![enter image description here](https://i.stack.imgur.com/UeneD.png)](https://i.stack.imgur.com/UeneD.png) I am using native base and in this picture you will see stackedLabel form. I'm trying to move it to the center of the screen but it doesn't work with justifyContent and still stays at th...
2018/03/09
515
1,464
<issue_start>username_0: I'm trying to filter on the sharepoint lists, but the semantics seems to be different to the [default semantics](https://developer.microsoft.com/en-us/graph/docs/concepts/query_parameters#filter-parameter). What I already tried was (with $ and without; single quotes and no quotes): ``` https...
2018/03/09
519
1,803
<issue_start>username_0: I am trying an example of car evaluation classification from <http://archive.ics.uci.edu/ml/datasets/Car+Evaluation> I have successfully trained model and printing predictions successfully using following [code](https://gist.github.com/stonesarvesh/b6fe9bfb8759931dc81ee4439a241415) I am follo...
2018/03/09
368
1,261
<issue_start>username_0: I need to create an Alexa smart home skill. I would like to control my lights using Alexa device. But based on my understanding, smart home skill only support utterances like this ``` Alexa, turn on name Alexa, turn off name Alexa, set name to x percent Alexa, brighten name Alexa, dim name Ale...
2018/03/09
473
1,390
<issue_start>username_0: I'm facing with this issue, the terminal said: > > [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project FloAutomation: Compilation failure > [ERROR] /Users/hai/workspaces/automation-for-iPad/src/main/java/Locators/ObjectReposi...
2018/03/09
1,405
5,254
<issue_start>username_0: I have two activities. **MainActivity.java** that shows only a splash screen. **LoginActivity.java** that shows login screen. I have defined the style as **Theme.AppCompat.Light.NoActionBar**. I want to add an actionbar and menu on LoginActivity. When I create the menu resource, even though it ...
2018/03/09
902
2,840
<issue_start>username_0: This is my PHP coding from which I am grabbing data from my DB with a select where statement and outputting it. I am trying to change the text properties such as font, colour and size on the print statement can anybody assis with how to do this? ``` php $servername = ""; $username = ""; $pass...
2018/03/09
2,193
8,131
<issue_start>username_0: How do you make an app with an actual fullscreen capabilities, that has the layout to be rendered underneath the notch? Here's what I want: [![Google Photos](https://i.stack.imgur.com/yxzNk.jpg)](https://i.stack.imgur.com/yxzNk.jpg) Here's the code of what I've tried: ``` class MainActivity...
2018/03/09
1,771
6,560
<issue_start>username_0: So I have a large CSV file (in Gb) where I have multiple columns, the first two columns are : ``` Invoice number|Line Item Number ``` I want a unix / linux /ubuntu command which can merge this two columns and create a new column which is separated by separator ':', so for eg : If invoice nu...
2018/03/09
272
865
<issue_start>username_0: I am calculating the area of objects in my image using `bwarea` like so: ``` i=imread('Z:\Azhagu project work\MRI\input.jpg'); imshow(i); bwarea(i) ``` This gives the following output: ``` ans = 1.0428e+05 ``` Why is the area in an exponential format?<issue_comment>username_1: It's no...
2018/03/09
1,019
3,103
<issue_start>username_0: The qeustion is how should i create a dictionary out of two different length lists. I dont have dictionary. I want to create dictionary. I would like to create a dictionary out of two lists that have different length when i apply split method. Forexample ``` names Out[41]: ['<NAME>', 'Q...
2018/03/09
620
2,060
<issue_start>username_0: In my agency's website, the buttons on the homepage have a small delay between hovering and I don't know what's causing this behaviour. Could you guys take a look? [Aparticula](https://www.aparticula.com) This is the code applied to it ``` .btn span { position: absolute; top: 2px; left:...
2018/03/09
251
882
<issue_start>username_0: I'm fairly new to IntelliJ and I'm using it to develop an AngularJS application having spring-boot as the backend server. When I make any changes to HTML or JavaScript code, I always have to restart the app server. Is there a config or plugin that provides hot-swap for HTML/JS/CSS files? I'm u...
2018/03/09
236
771
<issue_start>username_0: I'm completely baffled: `strptime(format(Sys.time(), "%Y%a%b%e %R%p"),format="%Y%a%b%e %R%p")` returns `NA` I was wondering why I always got `NA`s, so I tried to convert `Sys.time` to a string and immediately back to `POSIXct` using the exact identical format code.<issue_comment>username_1: ...
2018/03/09
1,062
2,755
<issue_start>username_0: I know that for an array it can be used `last` function of underscore, so in the case of this array it would be: ``` myArray = [32, 1, 8, 31]; lastElement = _.last(myArray); ``` The problem is when there is a matrix like this: ``` myArray = [[1, 3, 5], [55, 66, 77], [0, 1, 2]]; ``` and ...
2018/03/09
2,025
6,948
<issue_start>username_0: I want to implement an awaitable and noticed that `__await__` 'needs' to be a generator. From [PEP-492](https://www.python.org/dev/peps/pep-0492/#await-expression): > > An object with an `__await__` method returning an iterator. > > > ... > > > Objects with `__await__` method are called ...
2018/03/09
976
3,216
<issue_start>username_0: I was reading the following <https://developer.atlassian.com/blog/2016/06/common-dockerfile-mistakes/> and got caught up on a section: > > Volumes in your image are added when you run your > container, not when you build it. You should never interact with your > declared volume in your buil...
2018/03/09
527
1,728
<issue_start>username_0: I would like to check what version of twisted python is installed on my OS. I need to have a version `17.1.0` or greater and I work on `CentOS 7`. I tried this: ``` (.synapse)[root@nexus-chat1 .synapse]# twisted -v -bash: twisted : commande introuvable ``` But how can I upgrade my version...
2018/03/09
238
837
<issue_start>username_0: Does anybody know if it's possible to view the generated SQL statement before executing it? I know I can get the Query log however that is after the statement has been executed. I am looking for a way to get/view the generated SQL statement before it has been executed. Any hints would be hi...
2018/03/09
772
2,855
<issue_start>username_0: I'm trying to add the Scrollspy effect to the Angular project. When a user click a link, rather than show it as a new page, that component should scroll up and the next component should come to that place. Is there a way to do it in Angular with routing? When a link get clicked, the page should...
2018/03/09
842
2,943
<issue_start>username_0: I have this date format `19 FEB, 2018 3:39:37 PM` from this I want only this `19 FEB, 2018`. How can I get this ?? this is the function I am using to show the data in the `jsp` ``` $.each(rows, function(index, row) { var element = getVal(row,col); if(col == 3){ var d = element....
2018/03/09
915
3,081
<issue_start>username_0: Suppose I am having a huge list having elements from 1 to 1 million. ``` val initialList = List(1,2,3,.....1 million) and val myList = List(1,2,3) ``` Now when I apply an operation such as foldLeft on the myList giving initialList as the starting value such as ``` val output = myList.fold...
2018/03/09
295
1,009
<issue_start>username_0: For some reason, I am unable to start a process using QProcess on Ubuntu, and I do not understand why... ``` int main(int argc, char *argv[]) { //Run the process: QString procName = "./path/to/executable/Individual"; QProcess *proc = new QProcess(); proc->start(procName); ...
2018/03/09
502
1,773
<issue_start>username_0: I have Azure AD B2C in node, I want to know that why we use validateIssuer = true or false? ``` passport.use(new BearerStrategy({ isB2C: true, validateIssuer: false, loggingLevel: 'trace', passReqToCallback: false, } ``` if i make it false it send me warning to make true in ...
2018/03/09
954
2,548
<issue_start>username_0: I have a list of dictionaries. How can i group that list by valaues. ``` list = [{a:1},{b:2},{c:1},{d:3},{e:2}] ``` Now my result should be like below ``` 1:a,c 2:b,e 3:d ``` I tried using `groupby` from `itertools`. But i couldn't get the required result. I am using python 2.7. Could yo...
2018/03/09
441
1,506
<issue_start>username_0: I want to time delay load used setTimeout, i had statement a varible and it is global.but it is generate a TypeError when i input content in the input tag; i dont know why. the code following: ``` var searchInvoiceTimer = null; clearTimeout(searchInvoiceTimer); searchInvoiceTimer = setTim...
2018/03/09
833
3,139
<issue_start>username_0: I am working with a package `vendorName/moduleName` (a Magento extension) that is present on [packagist](https://packagist.org/) and on [firegento](http://packages.firegento.com/). On my `composer.json` file, I have : ``` "require": { ...................., ..................., "vendor...
2018/03/09
667
2,107
<issue_start>username_0: I have two bounding boxes and want to create a big one that includes this 2 - join them. For example(2 results of the turf.bbox): ``` var bboxCircles = turf.bbox({ "type": "FeatureCollection", "name": "bboxes", "features": circles }); ...
2018/03/09
411
1,316
<issue_start>username_0: I want to create a background of color #F74422 in the top right corner of the html page. [![enter image description here](https://i.stack.imgur.com/3fn1s.png)](https://i.stack.imgur.com/3fn1s.png)<issue_comment>username_1: Maybe this could be solved using a combination of `bboxPolygon`, `combi...
2018/03/09
681
2,429
<issue_start>username_0: I've created a function that gets all integers from `1` to `n` and then combines with the same sequence to create a sequence of tuples of all combinations. So passing it the integer `2` would give you `[(1,1);(1,2);(2,1);(2,2)]`: ``` let allTuplesUntil x = let primary = seq { 1 .. x } ...
2018/03/09
514
2,026
<issue_start>username_0: I have a nested resource like this: ``` @GetMapping("/tour-requests/{tourRequestId}/tour-request-messages") @Secured({AuthoritiesConstants.ADMIN}) public ResponseEntity> getTourRequestMessagesForTourRequest( @PathVariable("tourRequestId") long tourRequestId, TourRequestMessageCriteria crite...
2018/03/09
901
3,316
<issue_start>username_0: I am Trying to validate some input for a login form using JavaScript. From what I can see, everything in the script is correct, but it is not working. I'm sure it's a tiny thing that I've missed, any help would be appreciated. Note: I am unable to use external libraries. JavaScript code: ```...
2018/03/09
1,120
3,937
<issue_start>username_0: I'm calling an API and storing the data in an array. But if there is no data the debugger says: **Expected to decode Array but found a dictionary instead.** The fail JSON response is: ``` '{"status":"Failed","msg":"Sorry It\'s Not Working"}' ``` The success JSON response is: ``` '[{"id...
2018/03/09
1,001
3,795
<issue_start>username_0: I have followed the guide here: <https://redux-observable.js.org/docs/basics/SettingUpTheMiddleware.html> (Section: Redux DevTools) The store is configured in the following manner: ``` // @flow import { createStore, compose, applyMiddleware } from 'redux'; import { createEpicMiddleware } fro...
2018/03/09
903
3,462
<issue_start>username_0: im stuck here, but what dosnt i cant move JList in Layout to left-top-corner.Im trying to move list to left-top-corner with `list.setLocation();` but seem that is not work it good. Thank you! ``` public class JList_ extends JFrame { private JList list; private static String[] colorname...
2018/03/09
1,101
4,657
<issue_start>username_0: I am using Keycloak 3.4 in a Java Application using Spring Framework and Jetty 8.1 with Keycloak Jetty-81-Adapter 3.4. According to the Keycloak documentation I should be able to use the HttpServletRequest in a Java EE application to logout from Keycloak. However, this does not work in my case...
2018/03/09
1,767
5,690
<issue_start>username_0: I have `string` which I need to `split()` and assign it's value into two variables. Is it possible for `split()` to return `tuple` instead of `string[]` so I can do something like: ``` String myString = "hello=world" value, id = myString.Split('='); ``` I'm looking for some elegant solution....
2018/03/09
420
1,175
<issue_start>username_0: I am trying to create a dataframe containing made up sentences. In order to make the sentences vary I want to sometimes concatenate a string to a pre-existing string and sometimes not **Example input** ``` FD1<-data.frame(c("It is raining","It is snowing","It is stormy")) FD_try<-list(x="a lo...
2018/03/09
1,116
3,006
<issue_start>username_0: I have a string like this ``` str = "[numA1-E1]+[SalineLotNumberQ2-P1]-[numericP1-A1]" ``` The regex gives ``` arr[0] = numA1E1 arr[1] = SalineLotNumberQ2P1 arr[2] = numericP1A1 ``` whereas i want ``` arr[0] = numA1-E1 arr[1] = SalineLotNumberQ2-P1 arr[2] = numericP1-A1 ``` **If ...
2018/03/09
458
1,473
<issue_start>username_0: I have this code ``` func main() { router := mux.NewRouter() router.HandleFunc("/", rootHandler) router.HandleFunc("/xyz/{url}", urlHandler) http.Handle("/", router) log.Fatal(http.ListenAndServe(":8080", nil)) } ``` With this url: `http://localhost:8080/xyz/https%3A%2F%2Fabc.no%2...
2018/03/09
650
1,583
<issue_start>username_0: Having an array like this ``` myArray = ["test", 32.5, 11.3, 0.65, 533.2, null, 423.2, null, null]; ``` is there a way to get the last non-null element? In this case it should be `423.2`.<issue_comment>username_1: You can use `filter` to filter the non null elements and use `pop` to get th...
2018/03/09
1,312
4,897
<issue_start>username_0: In Dexie.js you can create a store with an auto-incrementing key ``` let db = new Dexie("nav_api"); db.version(1).stores({ jobs: '++id, json' }); ``` So to test, I created 14 objects in the db via `db.jobs.put({json: '[]'})`, and all their keys came out as expected, start...
2018/03/09
631
2,074
<issue_start>username_0: How can I Extract these three cookies from a request and pass them as headers in second request First Request: ![First request](https://i.stack.imgur.com/tkjDi.jpg) Second Request: ![Second request](https://i.stack.imgur.com/yngHv.jpg)<issue_comment>username_1: Try using the [pm.cookies.get()...
2018/03/09
357
1,255
<issue_start>username_0: This is piece if my code: ``` x=driver.find_element_by_xpath("""//*[@id="react-root"]/section/main/article/div[1]/div/div/div[1]/div[2]/a""") x.click() ``` But, this error are occurred: ``` selenium.common.exceptions.ElementNotInteractableException: Message: Element [could not be scrolled ...
2018/03/09
974
3,487
<issue_start>username_0: I am working on a program in c# . There are 3 columns. Let's call them A,B and C. When any row in column B is unchecked but column A is checked, it should pop out a display warning message indicating which location id (rows) that has column A checked but column B unchecked. I managed to crea...
2018/03/09
885
2,572
<issue_start>username_0: I have a MySQL tables that look like this: questions\_table: ``` questionID, question, optionID, optionText '1', 'question1', 100, 'option1', '2', 'question2', 200, 'option2', '3', 'question3', 300, 'option3', '3', 'question3', 400, 'option4', '3', 'ques...
2018/03/09
212
739
<issue_start>username_0: ``` Short s = somevalue; // could be negative or positive myobject.setMyShort(Math.abs(s)); ``` I can't change the type of field myShort of MyObject, at the same time Math.abs return only int values. Is it right to cast this way or could it result in a change of the original value? ``` myobj...
2018/03/09
833
3,088
<issue_start>username_0: I have an app that has several services - this happens for all of them but below is data for the **data-dev** service: If i deploy any of the services to a blank project - i.e. one where there are no services with that name yet, they all deploy fine with this command: `gcloud -q app deploy ap...
2018/03/09
588
2,303
<issue_start>username_0: I wanted to create json string like this- ``` { "credentials": { "name":"abc", "password":"<PASSWORD>" } } ``` I have created one Java class with name Credentials with "name" and "password" fields. I have added name and password values in credentials object. To give o...
2018/03/09
328
1,330
<issue_start>username_0: I encrypted password using MD5 and inserted them to MySQL database. But, How can I decrypt that password to the original and place them in a jTextField.<issue_comment>username_1: MD5 is a hashing function, not encryption, this means is irreversible. Thus can't be decrypted. What you can do is c...
2018/03/09
950
4,332
<issue_start>username_0: I use this library `dialogplus` <https://github.com/orhanobut/dialogplus> to show custom view on the top. Now I want to get EditText value, but I get an error null object. I see they talk about how to get value: For customview holder, there is a specific method to get your view back. Then yo...
2018/03/09
547
2,486
<issue_start>username_0: What is the syntax for creating a database and collection using mongo.exe and an inine command string? I have tried (server and password masked): mongo.exe MY\_SERVER/admin -u MongoDBA -p MY\_PASS --eval "use mytest;db.createCollection('mytemptestCollection')" This gives Syntax error "Missing...
2018/03/09
610
2,326
<issue_start>username_0: I'm looking for ionic2 best practice to show loadings, alerts and console logs.. so instead of repeat the code below in each page so I can call it once. For example code to show loading: ``` showLoading() { this.loading = this.loadingCtrl.create({ content: '' }); this.loa...
2018/03/09
642
2,255
<issue_start>username_0: I have an array ``` myArray []={1,4,3,2}. ``` I want to create 4 new array like: ``` myArray1[]={2,3,4}, myArray2[]={1,2,3}, myArray3[]={1,2,4}, myArray4[]={1,3,4}. ``` firs element of myArray1 should be number from myArrays first element(1) to 4 but except 1 itself. So its gonna be {2,...
2018/03/09
565
1,853
<issue_start>username_0: I am using Vue Element UI, how can i change the 'disable' attribute of a inputbox from true to false when clicking the 'edit' button? ```js var Main = { data() { return { input1: 'type something here', } }, method: { editvalue() { this.$set('disable',false)...
2018/03/09
1,482
5,239
<issue_start>username_0: In functional programming books, a recurring theme is that FP means telling computer what to do, not how to do. And some code example is give, like: ``` val newNumbers = oldNumbers.map(_ * 2) ``` Explanation is given that we dont implement this using traditional `for-loop`, but we rather use...
2018/03/09
523
1,599
<issue_start>username_0: Why the table can get $row['staffName'] but the value='.$row['staffName'].' cannot get full value? ``` while($row = mysql_fetch_array($result)){ echo "|"; echo " " . $row['staffName'] . " |"; echo " " . $row['staffPhone'] . " |"; echo " " . $row['staffEmail'] . " |"; echo " " . $row[...
2018/03/09
766
3,193
<issue_start>username_0: I want to use large files (> 2 GB zip archives as well as video files) in my instrumentation tests to test file loading from SD card / internal storage. How can I write these instrumentation tests and equip them with the files they need? For other tests, I only needed very small files so I put...
2018/03/09
342
1,226
<issue_start>username_0: I am trying to check if a prop is empty and add a condition to a react component. Here is the code: ``` class Mycomp extends Component { render() { return ( {this.props.title} if (this.props.title != '') { console.log('Title is not empty'); } ); } } ``` The pr...