Id int64 34.6M 60.5M | Title stringlengths 15 150 | Body stringlengths 33 36.7k | Tags stringlengths 3 112 | CreationDate stringdate 2016-01-01 00:21:59 2020-02-29 17:55:56 | Y stringclasses 3
values |
|---|---|---|---|---|---|
59,405,465 | @EnableResourceServer @EnableAuthorizationServer are deprecated? | <p>I am writing a simple application to test Oauth. But i see that both the annotations @EnableResourceServer @EnableAuthorizationServer were deprecated!</p>
<p>I don't find an alternative way to deal with it and I don't find any info anywhere.</p>
<p>What is the latest way to configure resource server and Auth serve... | <spring-security><spring-security-oauth2> | 2019-12-19 08:00:31 | HQ |
59,405,791 | VBScript - replace all commas occuring between ," and ", | <p>Using VBScript I need to replace all commas that occur between <strong>,"</strong> and <strong>",</strong> (i.e. chr(34)&chr(44) and chr(44)&chr(34)) with dots so it transforms below input into output string. Commas that occur not between these characters should stay.</p>
<pre><code>Input
2019/011,05-11-201... | <regex><vbscript> | 2019-12-19 08:24:41 | LQ_CLOSE |
59,409,365 | is this table is correct? or i should put unsignedBigInteger for tag_id too? and remove.->unsigned and index? | /**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('post_tags', function (Blueprint $table) {
$table->unsignedBigInteger('post_id');
$table->integer('tag_id')->unsigned()->index();
$table->foreign('post_i... | <php><laravel><migration> | 2019-12-19 11:59:24 | LQ_EDIT |
59,411,371 | Font awesome icon name | <p>Does anyone know name of this icon in fontawesome(ignore color)?</p>
<p><a href="https://i.stack.imgur.com/Z2xAg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z2xAg.png" alt="enter image description here"></a></p>
| <html><css><font-awesome> | 2019-12-19 14:05:42 | LQ_CLOSE |
59,411,397 | What makes ValueTuple covariant? | <p>This compiles correctly in C# 7.3 (Framework 4.8):</p>
<pre><code>(string, string) s = ("a", "b");
(object, string) o = s;
</code></pre>
<p>I know that this is syntactic sugar for the following, which also compiles correctly:</p>
<pre><code>ValueTuple<string, string> s = new ValueTuple<string, string>... | <c#><covariance><valuetuple> | 2019-12-19 14:07:37 | HQ |
59,411,907 | Is this possible to predict the lottery numbers (not the most accurate)? | <p>I am looking for the machine learning correct approach for predicting the lottery numbers, not the most accurate answer but at least we have some predicted output. I am implementing the regression based and neural network models for this. Is their any specific approach which follows this?</p>
| <machine-learning><scikit-learn><neural-network><artificial-intelligence> | 2019-12-19 14:39:03 | LQ_CLOSE |
59,414,789 | how apt-get knows where to look for packages | <p>If I just run <code>apt-get update</code> (without any package name) on a new installation, the OS download/updates the packages. How does it know which packages to download and from where? Is the list of <code>sources</code> pre-configured in the <code>OS</code> eg. in Debian?</p>
| <debian> | 2019-12-19 18:01:03 | LQ_CLOSE |
59,415,327 | how to make from real IP into automatic IP range in python? | <p>how do I make an IP range, for example my original IP there are the first 2 127.0.0.1 the second 128.0.0.1, I want if I use that IP for the IP range will be: 127.0.0.1 - 127.0.255.255 and so on, this my example code :</p>
<pre><code>list_data = ["127.0.0.1", "128.0.0.1"]
for i in range(255):
for j in range(255)... | <python> | 2019-12-19 18:45:54 | LQ_CLOSE |
59,417,551 | Trouble with my angular project and my Apache Server | <hr>
<p>Look, i recently finished my project and went happy to send it to my Apache server. </p>
<p>My Apache server has the standard folder structure <strong>www</strong> as the source and inside of it you put you files. </p>
<p>I ran the command in my project: <code>ng build --prod</code>, and gave me the follow... | <angular><apache><production> | 2019-12-19 22:15:48 | LQ_CLOSE |
59,418,255 | gcloud stop working - "was unexpected at this time." | <p>I just update my google cloud SDK on windows 10 (gcloud components update).
After the update the gcloud command stop working.
All I get is (for example : gcloud -h):
PATH\lib\gcloud.py" -h" was unexpected at this time. </p>
<p>I try to re-install but it didn't help:(</p>
<p><a href="https://i.stack.imgur.com/bJngw... | <google-cloud-platform><gcloud><google-cloud-sdk> | 2019-12-19 23:44:53 | HQ |
59,418,648 | Sentence boundary detection across many languages | <p>I'm looking for a framework like below that can be used with swift.
What do you recommend?</p>
<p><a href="https://github.com/diasks2/pragmatic_segmenter" rel="nofollow noreferrer">https://github.com/diasks2/pragmatic_segmenter</a></p>
<p>Thank you.</p>
| <ios><objective-c><swift> | 2019-12-20 00:50:43 | LQ_CLOSE |
59,419,330 | apply 1 css class which applies more than 1 class to an element | <p>Lets say I use multiple bootstrap classes to achieve my desired button effect.</p>
<pre><code>styleClass="btn btn-lg btn-block btn-success my_wrap"
</code></pre>
<p>Can I do something like this with css that allows me to have a single style defined in my html but in my css defining multiple bootstrap classes, util... | <html><css><bootstrap-4> | 2019-12-20 02:56:40 | LQ_CLOSE |
59,420,303 | How do I access the input from UI Text View in Swift Xcode | I have linked my uitextview and I have looked all around and cannot seem to be able to access the information my user inputs. This probably is a dumb question but I am Kinda new to swift so any advice would be awesome. Thank again | <swift><xcode> | 2019-12-20 05:34:03 | LQ_EDIT |
59,421,849 | How is REST api versioning implemented technically? | <p>I am working on a REST api which needs to be refactored. This will be a breaking change so the original api is to be made as v1 and the new refactored api will be known as v2. The versioning will be implemented at url level.</p>
<p>I want to understand technically how to approach this problem. Should I create a cop... | <c#><rest><asp.net-web-api><webapi> | 2019-12-20 08:09:47 | LQ_CLOSE |
59,421,957 | The type 'ContentPresenter' does not support direct content | <p>In WPF in XAML page I am getting error .The type 'ContentPresenter' does not support direct content.<a href="https://i.stack.imgur.com/tE21l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tE21l.png" alt="enter image description here"></a></p>
<p>the content presenter is inside the Custom Control... | <wpf><xaml><custom-controls> | 2019-12-20 08:19:34 | LQ_CLOSE |
59,424,238 | I want to make a snake game in a C# console, movement problem | <p>To change snakes direction I first have to press upArrow and then the new direction of the snake, and the snake is going in that direction until I hit upArrow again. So, to change direction to the left you need to press upArrow and then leftArrow. I want that to disappear, when I press left to make snake go left. Ba... | <c#><if-statement><controls><key><readkey> | 2019-12-20 11:06:39 | LQ_CLOSE |
59,424,843 | no overload for method get touch takes 0 arguments | <p>code:</p>
<pre><code>void Update(){
if (Application.platform == RuntimePlatform.Android) {
foreach (Touch touch in Input.GetTouch()) {
if (touch.fingerId == 0) {
if (!GameManager.instance.isPlaying) {
GameUIManager.instance.showStartGameCanvas (false);
... | <c#><unity3d> | 2019-12-20 11:51:12 | LQ_CLOSE |
59,425,147 | Laravel installer has been install but laravel command not found ... wtf? | I've got an issue with trying tu use laravel installer.
I follow each steps to install laravel installer globally from https://laravel.com/docs/6.x,
- sudo composer global require laravel/installer
- export PATH="/home/hedwin/.composer/vendor/bin:$PATH"
But laravel command isn't found in sudo, but it's foun... | <laravel><composer-php><installation> | 2019-12-20 12:18:05 | LQ_EDIT |
59,426,387 | Why is this 'if' statement printing "Impossible"? | <pre><code>public class Experiment5 {
private static int countChar(String string, char c) {
int count = 0;
for (int i = 0; i < string.length(); i++) {
if (string.charAt(i) == c) {
count++;
}
}
return count;
}
public static void main(String[] args) {
Scanner scan = ne... | <java><function><if-statement> | 2019-12-20 13:54:18 | LQ_CLOSE |
59,429,987 | im receiving this code when i run npm run dev why? | Failed to compile.
[1]
[1] ./src/index.js
[1] Module not found: Can't resolve '.components/App' in 'C:\Users\Adam\Desktop\ChatBot\client\src'
I'm receiving this result when I run ...npm run dev why?
thanks in advance | <node.js><reactjs><npm><npx> | 2019-12-20 18:42:39 | LQ_EDIT |
59,432,326 | Finding element by "data-reactid" on Yahoo! Finance | <p>I am writing a python program to evaluate stock prices. I'm using <a href="https://finance.yahoo.com/screener/predefined/day_gainers" rel="nofollow noreferrer">this page on Yahoo! finance</a> to get my stock informaiton. I want to be able to get the top five listings' <strong>stock symbol</strong> on the top gainers... | <python><python-3.x><selenium><selenium-webdriver><selenium-chromedriver> | 2019-12-20 23:26:17 | LQ_CLOSE |
59,432,514 | find the length of array using map function ES6 | <p>I'm trying to find the length of an array using ES6 using the below code but it does not work.</p>
<pre><code>a=[[1,2,3,4],[4,5,6]]
result = a.map(d=>({d[0]:d.length}))
console.log(result)
</code></pre>
<p>This works:-</p>
<pre><code>a=[[1,2,3,4],[4,5,6]]
result = a.map(d=>({name:d[0], length:d.length}))
co... | <javascript><ecmascript-6> | 2019-12-21 00:01:31 | LQ_CLOSE |
59,434,319 | How to make a button on-click to go to another page using HTML? | <p>I have a button, when you click the button it will take you to one of my sub-sites.</p>
<p>The button is a child element of a <code>a</code> tag. Is there a better way?</p>
<pre><code><a target='_blank' href='example.com/sub-site.html'>
<button name='link' style="cursor:pointer" class='example-style' val... | <html><button><hyperlink> | 2019-12-21 07:26:35 | LQ_CLOSE |
59,434,405 | I imported Selenium2Library, there were no errors but in Test case section of Robot framework its not getting recognised | [enter image description here][1]
[1]: https://i.stack.imgur.com/OZSog.png
clearly, under settings section, we see that the library seleniumlibrary is not being recognised? | <robotframework><selenium2library> | 2019-12-21 07:42:27 | LQ_EDIT |
59,435,056 | How can I properly use for loop in def? | <pre><code>def kolas(lst, n):
for i in range(0, len(lst)):
e = []
x = lst[i] % n
e.append(x)
return x
</code></pre>
<p>I noticed that for loop doesn't affect in def() - <strong>i</strong> is only assigned by the first value of the list. Does exist funcion like for loop that affects in d... | <python><function><for-loop> | 2019-12-21 09:33:01 | LQ_CLOSE |
59,435,070 | sort a string array by first two characters in swift | <p>I have a string array as strList = ["12abc", "23bcd", "12shsh", "23xyz"]
Is there any way to sort the array according to just first two characters of each string?</p>
| <arrays><swift><string><sorting> | 2019-12-21 09:34:39 | LQ_CLOSE |
59,435,508 | What is wrong with this code because when i click Buy Now button a next page appears but it is not showing the contents which want it to show? | This is HTML Code
=================
```
<div class="card-body" style="height:260px;">
<p class="card-text"> Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible</p>
</div>
<div class="card-footer... | <javascript> | 2019-12-21 10:48:47 | LQ_EDIT |
59,437,743 | Where can I find Java 8u241? | <p>I am looking for Java 8u241, as it is a requirement for a project I am working on. I have not been able to find it anywhere; not even Java’s own website.</p>
<p>Any suggestions?
I appreciate your’alls help!</p>
| <java> | 2019-12-21 16:02:33 | LQ_CLOSE |
59,439,096 | ImportError: cannnot import name 'Imputer' from 'sklearn.preprocessing' | <p>Trying to import Imputer from sklearn,</p>
<pre><code>import pandas as pd
dataset = pd.read_csv('Data.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 3].values
#PART WHERE ERROR OCCURS:-
from sklearn.preprocessing import Imputer
</code></pre>
<p>Shows "ImportError: cannot import name 'Imputer' from 'skl... | <python-3.x><scikit-learn><compilation> | 2019-12-21 19:07:09 | HQ |
59,439,970 | This isnt working. it isnt actually accepting that this is actually entered... when i enter manually it works.selenium python | im trying to get this code to work, but it isnt. i enter manually and it works but not when i automate it
import selenium
import time
import os
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
num = 1
while num != 1000:
driver = we... | <python><selenium> | 2019-12-21 21:30:29 | LQ_EDIT |
59,440,004 | Regular expression to remove characters at the end of a line | <p><br>
I need a regular expression to remove sentences at the end of a line (after a period) containing more than 2 digits,
example:</p>
<p>Before<br>
Some text1. Text (270) 6265204<br>
Some text2. text97 66 48 35<br>
Some text3. text 504-791-4972<br>
Some text4. (414)5290192<br>
Some text5. text6.<br></p>
<p>After ... | <regex> | 2019-12-21 21:37:49 | LQ_CLOSE |
59,440,679 | I want to learn javascript | <p>I want to learn javascript soon and I would like to ask for your opinion about the online sites where I could start: Udemy, Pluralsight, Codecademy ...
Which one is better? I attended a training in Angular on Pluralsight and I can say that I like it but I would like to try something new if it is worth it.</p>
| <javascript> | 2019-12-21 23:49:27 | LQ_CLOSE |
59,441,497 | how to return an array in a c++ function | int main()
{
std::string my_string= "16657";
std::map<std::string, std::array<std::string, 2>> m_msg_int;
std::array<std::string, 2> arrId;
arrId[0] = "ABC";
arrId[1] = "XYZ/CDE";
m_msg_int[my_string] = arrId;
get_msg_type(const std::string& msg_type);
}
... | <c++><arrays> | 2019-12-22 03:51:53 | LQ_EDIT |
59,442,182 | How to find the sum of numbers that have digits higher than 5 | <p>so I want to write a function that returns the sum of all numbers in an array who's digits are higher then 5 so for example if the array is [12, 66, 23, 67] the answer would be 66+67
This code summs all the numbers in the array and I can'\t figure out why</p>
<pre><code>
using namespace std;
int func(int n[], int s... | <c++> | 2019-12-22 06:38:37 | LQ_CLOSE |
59,442,813 | Api blockchain not works | <p>I've a little Bot to use the api for <a href="https://www.blockchain.com/" rel="nofollow noreferrer">https://www.blockchain.com/</a>.
It's work until recently, but now the service respose with: erver returned HTTP response code: 429 .
I have recevided the api-key for use the service. But is not present documentatio... | <api><blockchain><bitcoin> | 2019-12-22 08:49:50 | LQ_CLOSE |
59,443,042 | Can't vertical center h1 inside div | <p>I'm having some troubles when trying to vertical center a header inside a div.
CSS is the following:</p>
<pre class="lang-html prettyprint-override"><code>.container {
background: #a3f;
padding-left: 3% !important;
}
.container h4 {
vertical-align: middle;
text-align: center;
background: #f02;
}
</code><... | <html><css> | 2019-12-22 09:29:20 | LQ_CLOSE |
59,445,308 | How to store items of a list in class1 on another list in class2 | <p>I have two classes: Tache2new.java and Luncher.java.
In Tache2new, I use a list named "rules" to store items.</p>
<pre><code>public static void execute(String concept) {
List<Rule> rules = new ArrayList<>();
…
}
</code></pre>
<p>I would like to call this list in the class Luncher and store its items i... | <java><arrays><arraylist> | 2019-12-22 14:55:07 | LQ_CLOSE |
59,445,683 | uninitialized float pointer (c++) | > so basically, I have this pointer in a struct, and it is used to fill the values of an array. it works as it should, but the visual studio keeps giving the same warning, saying that is uninitialized, and it's a NULL pointer, when it isn't. Can anyone explain/help?
struct Sinal {
int freq_amostra=0;
... | <c++> | 2019-12-22 15:47:35 | LQ_EDIT |
59,445,784 | INSERT INTO statement not working error 3134 | <p>Currently trying to get my add button to work. I'm trying to insert into a table and I'm getting a Run-Time error '3134. I've watched several youtube videos and searched here. Not sure why its erroring out. There are no prime keys associated with this table.</p>
<pre><code>CurrentDb.Execute "INSERT INTO tblMemb... | <sql><vba><ms-access> | 2019-12-22 15:59:03 | LQ_CLOSE |
59,447,736 | how i can extract output form cmd using java script | how i can extract an output from cmd and add it as var in javascript
i wanna extract this value as an example "11675724" in the screenshot below
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
ar extract = function(string) {
var o = {};
str... | <javascript><parsing><cmd> | 2019-12-22 20:14:16 | LQ_EDIT |
59,448,202 | bad request response to fetch REST API | I have built an API and app that uses that API. When I POST method via Postman it works fine but when I try fetch via app I get bad request 400 status response. What am I doing wrong?
here is my js code:
const myForm = document.getElementById('loginForm');
myForm.addEventListener('submit', function... | <javascript><rest><api><fetch> | 2019-12-22 21:36:22 | LQ_EDIT |
59,448,885 | in python3: most efficient way to modify each element in multiple lists together? | Let's say I have 3 lists
```
a = [1.12, 2.23, 3.34]
b = [2.12, 3.23, 4.34]
c = [3.12, 4.23, 5.34]
```
my goal is to round the numbers down to 1 decimal. so I have this custom function:
```
import math
def round_down(n, decimals=0):
multiplier = 10 ** decimals
return math.floor(n * multiplier) / mul... | <python><python-3.x> | 2019-12-22 23:47:41 | LQ_EDIT |
59,449,136 | How I can split string by comma and/or new line and/or whitespace | <p>Hi there I am searching for regex to split emails, but no success so far.
What is the point
I want to make possible to separate this:</p>
<pre><code>o@gmail.com b@gmail.com c@gmail.om
</code></pre>
<p>or </p>
<pre><code>o@gmail.com, b@gmail.com,c@gmail.com
</code></pre>
<p>or </p>
<pre><code>o@gmail.com,
b@gm... | <javascript><regex> | 2019-12-23 00:42:17 | LQ_CLOSE |
59,450,094 | How can i hide request header and parameters for rest api | I am using laravel and vue js.
In vue js, i am requesting api using axios.
when i inspect and get request header and parameters in browser and it is possible to request in Postman.
Everyone can request any apis after login because it is possible to get header and parameters. | <javascript><php><laravel><vue.js><networking> | 2019-12-23 04:13:20 | LQ_EDIT |
59,450,183 | Why mysql querry doesnt match with what i though? | *sorry for my bad eng :(
Guyss...
Please help me,... i just learn MySQL, and i dont get why "permasalahan_khusus" doesnt match with "nama_psikolog" :(
please explain where did i go wrong
select customer.nama_customer, psikolog.nama_psikolog, tipe_permasalahan.permasalahan_khusus from customer cross join psiko... | <mysql> | 2019-12-23 04:30:28 | LQ_EDIT |
59,451,255 | Python get for loop result into an array variable | <pre><code>code = []
def getCode():
for data in range(59):
code = []
min = 9900
max = 9999
code1 = randint(min, max)
code2 = randint(min, max)
code = str(code1) + '/' + str(code2)
# print(code)
return code
print(getCode())
dat2 = pd.DataFrame({'c... | <python><python-3.x> | 2019-12-23 06:54:14 | LQ_CLOSE |
59,454,745 | sql group by each row select | sql table name= phones
rows= id, mobileno, status, userid, createdon
each user can have multiple numbers, i want to find oldest active phonenumber for each users.
status=1 is active.
for example:
user1= id=1, mobileno=123, status=1,userid=1,createdon=2019/12/20
user1= id=1, mobileno=1234, status=1,userid... | <sql><sql-server> | 2019-12-23 11:40:27 | LQ_EDIT |
59,454,934 | How to compare two lists in python and write the similar index values in one list and non similar values in another list | <p>consider two lists
a=[1,2,3], b=[1,4,5].The Code should print the similar values c=[1] and the Code should print d=[2,3,4,5] which shows different values</p>
| <python><python-3.x><list><string-comparison> | 2019-12-23 11:54:42 | LQ_CLOSE |
59,455,445 | Excel VBA - Understanding of code - use of not, application.intersect, if condition in one line | ***Private Sub Worksheet_Change(ByVal Target as Range)
Dim Keycells as range
Set Keycells = Range("Search_String")
*If not application.intersect(Keycells, Range(Target.Address)) is nothing then msgbox "Working" End If*
end sub*** | <excel><vba> | 2019-12-23 12:32:22 | LQ_EDIT |
59,455,598 | how to call oracle stored proc in spark? | In my spark project , I am using spark-sql-2.4.1v.
As part of my code , I need to call oracle stored procs in my spark job.
> how to call oracle stored procs? | <apache-spark><apache-spark-sql> | 2019-12-23 12:43:56 | LQ_EDIT |
59,455,965 | regular expression Python with at least 3 upper cases | <p>I need a regular Expression that Matches a string that mustn't contain digits. The string should have at least 3 upper cases. In addition, the string should contain 6 to 40 chars.</p>
<p>Here is my Approach, but it doesnt work as I expect it to:</p>
<pre><code>re.findall("\\n(?=(?:[^A-Z]*[A-Z]){3})[^0-9]{6,40}:\\n... | <python><regex> | 2019-12-23 13:11:57 | LQ_CLOSE |
59,456,223 | In App Purchase with fingerprint or Face ID in Objective c | I have an Objective C Project which i am working using Xcode 11 and i am trying to implement In App Purchase.
I used some tutorials and implemented successfully but i am not able to use Fingerprint or Face ID.
Please find the Image Url below in which it shows old subscription interface asking for password.
https... | <ios><objective-c><in-app-purchase><xcode11><face-id> | 2019-12-23 13:31:01 | LQ_EDIT |
59,456,521 | Sort a matrix by the sum of the rows C++ | Heyy, I am new to programming, so can you help me finish my program? I have to sort the matrix by the sum of the rows, the smallets sum has to be first and the the bigger and at the end has to be the biggest sum.
I have done this but I cant finish it:
#include <iostream>
using namespace std;
int m... | <c++><matrix><sum><rows> | 2019-12-23 13:52:54 | LQ_EDIT |
59,457,479 | If integer look like this `010` is first 0 consider integer? | <p>There was misunderstanding about this <code>int number = 010</code>, What I am saying is </p>
<blockquote>
<p>first 0 is not integer due to c# has no leading zero so <code>010</code> will be <code>10</code></p>
</blockquote>
<p>however one of stackoverflow user saying </p>
<blockquote>
<p>first 0 in <code>0... | <c#> | 2019-12-23 15:09:35 | LQ_CLOSE |
59,458,853 | Python: How to find a list of all keys that contain equal values | I want to find a list (of lists) of all keys in a dictionary that contain values equal to other elements.
For example:
```
dict_with_dups = {
"a": 1,
"b": 1,
"c": 1,
"d": 2,
"e": 3,
"f": 3,
"g": 4,
}
keys_with_same = locate_same_keys(dict_with_dups)
for key_list in keys_... | <python><dictionary> | 2019-12-23 16:58:01 | LQ_EDIT |
59,459,242 | how to handle Array of column coming from UDF in spark dataframe | I am trying to concatenate the Array of column in spark dataframe i am recieving the Array of column through a spark scala UDF but I am getting below
my code :-
val sampleDf = sparksession.createDataFrame(
List(("00", "DELHI", "111", "222", "333"), ("00", "SP", "123123123", "231231231", "31231231... | <scala><apache-spark><apache-spark-sql><user-defined-functions> | 2019-12-23 17:34:58 | LQ_EDIT |
59,460,266 | Sourcetree not refreshing view | <p>The view within sourcetree has to be manually updated by hitting F5 as of version 3.3.6.3829. I attempted to raise this as a bug on <a href="https://jira.atlassian.com/" rel="noreferrer">https://jira.atlassian.com/</a>, but the form doesn't give me a correct option for version with 3.2 being the most up to date vers... | <atlassian-sourcetree> | 2019-12-23 19:14:34 | HQ |
59,461,659 | a function with too many parameters in perl | <p>I have a function has too many parameters. I have viewed the resolving approach in PHP that passing class object into the function instead of many parameters. Is it any approaches for perl?</p>
<p>Thanks</p>
| <perl> | 2019-12-23 21:52:49 | LQ_CLOSE |
59,464,344 | c# wpf treeviewitem with contextmenu | <p>i just want to make right click menucontext with normal treeviewitem.
all example i can find , it ask to bind with something . but i just don't want to bind any thing .</p>
<p>for example:</p>
<pre><code> TreeViewItem ceo = new TreeViewItem() { Header = "CEO" };
TreeViewItem manager1 = new T... | <c#><wpf> | 2019-12-24 05:46:37 | LQ_CLOSE |
59,465,361 | Loop add new record to array in typescript | <p>I have a opt variable in Typescript</p>
<pre><code>let opt = [{}];
</code></pre>
<p>if I want to add multiple children to opt variable to below exsample with for loop</p>
<pre><code>options = [
{ name: "option1", value: 1 },
{ name: "option2", value: 2 }
]
</code></pre>
<p>how can I coding</p>
<pre><cod... | <angular><typescript> | 2019-12-24 07:29:57 | LQ_CLOSE |
59,465,758 | How to set Auto Reconnect with Unified Topology | <p>After setting <code>useUnifiedTopology=true</code>, the Auto Reconnect stopped working and generates the following ERRORS:</p>
<pre><code>DeprecationWarning: The option `reconnectInterval` is incompatible with the unified topology
DeprecationWarning: The option `reconnectTries` is incompatible with the unified topo... | <node.js><mongoose><node-mongodb-native> | 2019-12-24 08:10:21 | HQ |
59,467,328 | What is characteristics of a good unit test | I need to know that what is characteristics of a good unit test and best practices ? how much code coverage considered good enough ?
In order for our unit tests to become effective we need to lay out some ground rules. What is a good unit test and what can we do to make sure we create tests that actually help us in ou... | <ios><swift><xcode> | 2019-12-24 10:24:22 | LQ_EDIT |
59,467,830 | How should this Java code look like in Kotlin? | I started Kotlin after Java.
I want to write this function to return `Single<List<LocationData>>`
```java
override fun getDestinations(): Single<List<LocationData>> {
//return ???
}
```
My LocationData class:
```java
@Parcelize
data class LocationData(val latitude: Double, val ... | <kotlin> | 2019-12-24 11:04:22 | LQ_EDIT |
59,468,489 | Observable returning value after method call finished | <p>getModel() method always return array with empty name array even when languages Observable returns value. why?</p>
<pre><code> export interface Category extends BaseModel {
code: string;
name: LocalizedValue[];
description: LocalizedValue[];
active: boolean;
}
getAllLanguages(): ... | <angular><rxjs><rxjs-observables> | 2019-12-24 11:57:16 | LQ_CLOSE |
59,469,348 | Converting a Regex from JS flavor to Golang flavor? | <p>I am trying to convert a certain regex from ECMAScript flavor to Golang flavor, here it is : </p>
<pre><code>((r|🇷)+)(( |\n)*)((🇪|e)+)(( |\n)*)((p|🇵)+)(( |\n)*)((🇴|o)+)(( |\n)*)((🇸|s)+)(( |\n)*)((t|🇹)+)
</code></pre>
<p>Basically the point is to match messages like "r 🇪 p O s t".
I've tried to replace " "... | <regex><go> | 2019-12-24 13:11:12 | LQ_CLOSE |
59,470,414 | i want on click screen close sidebar | <div class="col-6 text-left">
<!-- <span class="toggle-div toggle-btn" onclick="openNav()" id="nav-toggle"> -->
<span class="toggle-div toggle-btn" onclick="openNav()" id="nav-toggle">
<i class="fa fa-bars"></i>
</span>
</div>
<div class="sidebar" id="sidebar">
<a href=... | <html><css> | 2019-12-24 14:48:31 | LQ_EDIT |
59,471,999 | Append text to a Text file without replacing it Python | <p>Im new to python and I need some help from you guys. </p>
<p><strong>So this is my Code</strong></p>
<pre><code>Tk().withdraw()
filename = askopenfilename(title='Choose a file', filetypes=[("Text Files", "*.txt")])
f = open(filename)
with open(filename,'r+',encoding="UTF-8") as file:
file.write('test')
file... | <python><python-3.x><tkinter> | 2019-12-24 17:45:57 | LQ_CLOSE |
59,472,326 | Linux Bash, what does this mean: awk 'OFS="\t" {$1=$1}1' /filepath | What does following Linux Bash code do:
awk 'OFS="\t" {$1=$1}1' /filepath | <awk> | 2019-12-24 18:30:13 | LQ_EDIT |
59,473,174 | Can not use keyword 'await' outside an async function in a custom React hook | <p>I'm trying to create a custom hook, but I keep getting the error for the <code>getToken()</code> function: </p>
<blockquote>
<p>Can not use keyword 'await' outside an async function</p>
</blockquote>
<p>How do I get around this issue?</p>
<pre class="lang-js prettyprint-override"><code>export const useExistingT... | <javascript><reactjs><react-native><async-await><react-hooks> | 2019-12-24 20:33:11 | LQ_CLOSE |
59,474,706 | Python : How to replace the array of values in one dictionary with elements from another array of dictionaries | This is my dictionaries:
```
main_dict =
[
{'link_value':[123,111] , 'id' : 22}
{'link_value':[234] , 'id' : 14}
]
dict2 =
[
{'id':123 , value:['xx','yy'],name:'mg1'}
{'id':111 , value:['zz','yy'],name:'mg2'}
{'id':234 , value:['aa','yy'],name:'mg3'}
]
```
I want to replace the li... | <python><dictionary> | 2019-12-25 02:16:56 | LQ_EDIT |
59,475,155 | I am having problem in downloading the VS code here is error i am getting i am using macBook pro | <p>I am not able to install Visual Studio Code can anyone please help me.I am adding image please help me out of this.</p>
| <visual-studio-code> | 2019-12-25 04:08:24 | LQ_CLOSE |
59,475,551 | Javascript Functions - Calling Two Function In A File | <p>Question: Two Functions Return Different Data But After Calling Both Functions Receive Output From Last Function. Why? </p>
<blockquote>
<p>javascript</p>
</blockquote>
<pre><code>var printStudentInfo = function () {
return 'Name';
}
var printStudentTerritory = function () {
return 'Age';
}
printSt... | <javascript> | 2019-12-25 05:43:35 | LQ_CLOSE |
59,476,267 | How to get file name without file extension | <p>Im trying to get file name without its extension, i have the following code that let me take the file name with extension which is </p>
<pre><code>var docName = new DirectoryInfo("C:\\files\\").GetFiles("*.docx");
</code></pre>
<p>with that code im taking all of the file names then use them on </p>
<pre><code> fo... | <c#><.net> | 2019-12-25 07:43:50 | LQ_CLOSE |
59,477,079 | How can I modify Jenkins Configuration Global Security from linux server? | In Jenkins UI, I have the below section under http://XXXXXX:YYYY/configureSecurity/
[![OpenID Federated Login][1]][1]
where can I find this definition in Server (Linux RHEL)? I tried to grep for it in jenkins-production folder but couldn't find anything.
is there a way to change the checkbox for 'Enable script sec... | <jenkins><rhel> | 2019-12-25 09:41:08 | LQ_EDIT |
59,477,161 | Why does the command prompt showing this following error? | <p>I just installed the GCC compiler and wanted to test if it is working correctly. But in the middle, I am facing this issue with the command prompt as shown in the figure. 'ls' ie., List command is not working what might be the problem??</p>
<p>Regards,<a href="https://i.stack.imgur.com/Jd8OR.png" rel="nofollow nore... | <windows><command-prompt> | 2019-12-25 09:49:28 | LQ_CLOSE |
59,477,621 | iOS/Swift how update Table View in Real Time | <p>I need to to fetch realtime news from API, and then show them in a <code>UITableView</code>, news must disappear 5 seconds after their arrival.</p>
<p>I am new in Swift, I know that UITableView has <code>reloadData()</code> that is meant to update the data in the table, I suppose I should use this method.</p>
<p>M... | <ios><swift><api><uitableview> | 2019-12-25 10:49:51 | LQ_CLOSE |
59,478,673 | How does password manager rechecks the password as salt value is random? | <p>I am relatively new to LINUX, so I am having trouble understanding one concept related to pass in LINUX.</p>
<p>I learnt that UNIX stores my passwords by hashing it, and storing along with the randomly generated salt value.</p>
<p><code>Salt value is nothing but a random data that's generated to combine with the o... | <linux><unix><passwords><salt><passwd> | 2019-12-25 13:05:07 | LQ_CLOSE |
59,478,743 | C: How to detect a re-entry of a char character? | <blockquote>
<p>I am creating a program whereby;
the first input e.g. 'a' will give a "no duplicate" result,
and upon re-entry of 'a' it should would give me a "duplicate has found" result.</p>
</blockquote>
<pre><code>I am having a hard time finding the logic to this program. Help would be much appreciated. ... | <c> | 2019-12-25 13:13:55 | LQ_CLOSE |
59,481,186 | Different output using print and return | can anyone explain me why we get different output using print and return.
For this code:
def string(txt):
for char in txt:
print(char)
string('Stack')
the output would be:
S
t
a
c
k
And for this code:
def string1(txt):
for char in... | <python><python-3.x> | 2019-12-25 19:10:38 | LQ_EDIT |
59,481,375 | Add a prefix of +1 to a string | <p>How can I remove all non 10 digit numbers from a string, and add a +1 to the front of it if it doesn't exist yet?</p>
<p>Here's the regex code I have:</p>
<pre><code>phoneNumber.replace(/[^0-9.\,]/g, '');
phoneNumber = '+1' + phoneNumber;
</code></pre>
<p>but this won't work if <code>phoneNumber</code> already ha... | <javascript><regex> | 2019-12-25 19:43:02 | LQ_CLOSE |
59,482,179 | which one of these returns a registry value? | <https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry>
is confusing me. All I want is to retrieve the value of particular registry key. Which one of the functions do I use?
Many thank,
-T | <winapi><registry> | 2019-12-25 22:08:50 | LQ_EDIT |
59,483,042 | Game development: Are in-game interrupts ever used? | <p>I'm learning game development, and the tutorials tell me to put everything in a while (1) loop. However, this is discouraged in embedded systems, where it's better if everything is treated as an interrupt. </p>
<p>Does this same concept apply in game development? I feel as if adding everything into a continuous loo... | <software-design> | 2019-12-26 01:29:32 | LQ_CLOSE |
59,484,111 | Why the correct output of this java code is 22? Not 12? | <p>I was solving some java-tasks and had a problem with that one:</p>
<pre><code>What is the output of this code?
public class Test {
public static int test(int i) {
try {
if (i == 0) throw new Exception();
return i;
} catch (Exception e) {
return 1;
} finally {
return 2;
... | <java><exception><output> | 2019-12-26 05:16:23 | LQ_CLOSE |
59,484,643 | Find the top 10 centre most values from each clusters done by k-means using python | <p>I have a data frame and I have clustered it into 3 clusters using k-means clustering. </p>
<p>Now I want to find the top 10 centre most values from each clusters. </p>
<p>How to do it using python ? </p>
| <python><machine-learning><cluster-analysis><k-means> | 2019-12-26 06:28:56 | LQ_CLOSE |
59,484,828 | how to get coordinates from polyline (google maps api) | i am able to draw a polyline between source and destination using google maps api on android. Now, I want to get locations from the polyline for let's say every 25meter. So, as the polyline is generated between two points, app must generate coordinates for the points on polyline at a distance of 25meter. So as you can ... | <android><google-maps><android-studio> | 2019-12-26 06:46:34 | LQ_EDIT |
59,486,987 | How to Remove special characters at the end and at the begging of the string | <p>I have a string:</p>
<pre><code>String str = " line0\n" +
"line1\n" +
"line2 line0\n" +
"line3\n" +
"line4 \n"
</code></pre>
<p>How can I get the following script:</p>
<pre><code>String formatedStr = "line0\n" +
"line1\n" ... | <java><string> | 2019-12-26 10:20:07 | LQ_CLOSE |
59,487,789 | I have a problem with my java homework. I need to verify an email | <p>If you speak german, this is the task:</p>
<p>Schreiben Sie eine Methode checkEmail(String email), die prüft ob ein String eine Email Adresse ist.
Hierzu können Sie das Pattern / Matcher Konstrukt verwenden:</p>
<pre><code>Pattern pattern = Pattern.compile( "[\\w|-]+@\\w[\\w|-]*\\.[a-z]{2,3}" );
Matcher m = patte... | <java> | 2019-12-26 11:28:55 | LQ_CLOSE |
59,488,883 | Write a program to print odd numbers in a list by userentered input | #WAP to print odd numbers in a list.
list2 = [ list2 for list2 in input("list").split(",")]
odd_nos = [ num for num in list2 if num % 2 !=0]
print ("Odd numbers in the list: ",odd_nos)
I cant runthis program it came type error like:
odd_nos =[ num for num in list2 if num % 2 !=0]
TypeError: not all argu... | <python><python-3.x> | 2019-12-26 13:03:04 | LQ_EDIT |
59,488,961 | How to create a Yii2 Query to get an array like given below | <p>I want to get the id and name arrays as output from a query. How to do that</p>
<p>i need the output like this </p>
<pre><code>[
['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],
['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']
]
</code></pre>
<p>How to get an array li... | <php><yii2> | 2019-12-26 13:09:05 | LQ_CLOSE |
59,489,883 | how and using which library can i use knn imputation for missing value analysis | <p>I am trying to to impute the missing values using knn but i couldnt able to use the
code:
from fancyimpute import KNN<br>
is there any other library for knn imputation ?</p>
| <python><missing-data><knn><imputation> | 2019-12-26 14:39:20 | LQ_CLOSE |
59,490,832 | Java frontend beginner | <p>I have to build a simple java application so i am using Spring boot and hibernate as my frameworks . Its the first time i am doing this so i need all the help i can get, i manage to make the back end to work ,at least the most of it, but i was wondering what would be the easiest way to create a front end for my appl... | <java><frontend> | 2019-12-26 16:14:03 | LQ_CLOSE |
59,492,744 | return statement does not work in forEach loop | <p>I'm trying to write a function <code>returnIndex</code> that returns the index of an object in an array, e.g. <code>myArr = [{ "name": "Bob", "age": 4 }, { "name": "Kirk", "age": 11 }]</code>, by passing in a given key/value pair: e.g. <code>returnIndex(myArr, "name", "Bob")</code> should return <code>0</code>.</p>
... | <javascript> | 2019-12-26 19:40:12 | LQ_CLOSE |
59,493,551 | Describe a sorted function by a loop | <p>I have a task. This is a learning task. I successfully solved it. But I have a problem. The problem is that I need to sort the values in the list in descending order without using functions and methods. This needs to be done in a loop (without using sorted(), as I did).</p>
<p>Guys, I honestly looked for a soluti... | <python> | 2019-12-26 21:18:13 | LQ_CLOSE |
59,494,232 | Apache Spark: Group by condition | <p>I have a table which is like:</p>
<pre><code>+-----+-----+
| name|value|
+-----+-----+
|Alice| 1.2|
| Lisa| 3.4|
| Nick| 0.8|
| Jack| 10.1|
| Cici| 4.4|
+-----+-----+
</code></pre>
<p>I want to group the data by condition such as [value < 1, 1 <= value < 5, value >= 5] and know the percentile of each ... | <scala><apache-spark><pyspark><pyspark-sql> | 2019-12-26 22:50:45 | LQ_CLOSE |
59,495,107 | Can anyone explain what is TraitCollectionDidChange/UITraitCollection in simple term? |
public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection)
base.TraitCollectionDidChange(previousTraitCollection)
What does base.traicollectiondidchange do? | <ios><swift><xcode><xamarin><xamarin.ios> | 2019-12-27 01:38:07 | LQ_EDIT |
59,495,760 | Split column into 2 with '-' delimiter | Would need to split a column into 2, with a given delimiter. Excel file does not have a header in the columns. example input file and outfile s are attached. | <python> | 2019-12-27 03:49:03 | LQ_EDIT |
59,495,933 | Group according to its parent and children | This is the output of my List. I need help in grouping the children with their parent. Thanks for your help.
0).
nodeID id_0 |
nodeName Test 3 |
parentID id_0
********************************************
1).
nodeID id_72864 |
nodeName Element A |
parentID id_0
********************************************
... | <java> | 2019-12-27 04:20:59 | LQ_EDIT |
59,498,305 | How to clear out char array with memset | <p>I'm looking for a method to clear a char array similar to how in python you would do the following:</p>
<pre><code>buffer = ""
</code></pre>
<p>Is using memset the best approach for this, or is there another builtin function/method I'm missing?</p>
<p>What Ive tried:</p>
<pre><code> memset(buf, '\n', sizeof(char... | <c++><c><buffer><memset> | 2019-12-27 09:00:51 | LQ_CLOSE |
59,498,524 | how to sole application.yml with Spring boot (while parsing a block mapping) | i want to solve while parsing a block mapping error for use Spring boot with Eureka server configuration
`while parsing a block mapping
in 'reader', line 5, column 3:
application:
^
expected <block end>, but found '<block mapping start>'
in 'reader', line 15, column 4:
hikari:`
... | <spring><spring-boot> | 2019-12-27 09:21:26 | LQ_EDIT |
59,498,816 | How to echo html in php with link to database? | <p>below is what i had tried:</p>
<pre><code>echo "<input class='form-control' type='text' name='jobID' value='.$result['jobID'].' readonly>";
</code></pre>
<p>or </p>
<pre><code>echo "<input class='form-control' type='text' name='jobID' value=<?php $result['jobID'];?>readonly>";
</code></pre>
<... | <php><html><mysql><database><twitter-bootstrap> | 2019-12-27 09:46:28 | LQ_CLOSE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.