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,035,060
Can I create a mySQL DatabaBase from Java code?
<p>I'm learning about JDBC.</p> <p>Can I create a mysql database from a java code?</p> <p>How can I make the connection?</p> <p>Thanks.</p>
<java><mysql><database>
2019-11-25 15:23:50
LQ_CLOSE
59,035,353
Please suggest javascript code for converting distinguished name into canonical name?Please refer the details below
This is distinguished name "CN=Peterson\,Misha,OU=Users,OU=Bright,OU=APAC,DC=xyz,DC=ang,DC=com". I need to convert this into"xyz.ang.com/APAC/Bright/Users/Peterson,Misha",i.e., Canonical name.
<javascript><active-directory>
2019-11-25 15:39:16
LQ_EDIT
59,036,609
Python- get last letter of a string
I am relatively new in python. I wanted to know if is there any possibility for me to get only the **E:** from the string below: p="\\.\E:"
<python><python-3.x><text>
2019-11-25 16:53:06
LQ_EDIT
59,037,458
How to get a approximate equation for reverse look up
Is there any method or way to get the approximate equation(x = g(y)) for doing a reverse lookup from Y to X. Following is the simple y = f(x) and it's plot. ``` import numpy as np import matplotlib.pyplot as plt formula = "2*x**6 + x**5 -3*x**4 + 7*x**3 + 9*x**2 + x + 6" x = np.arange(1, 10) y = eval(formula)...
<python><r><algebra><polynomial-math>
2019-11-25 17:47:08
LQ_EDIT
59,038,938
How to get local time from web server?
I set up an ajax server with this settings ``` let express = require('express'); let server = express(); server.use('/MyWebApp', express.static(__dirname + '/public')); server.get('/MyWebApp/dateService', function(request, response){ response.send({'dateTime' : new Date()})...
<javascript><html><node.js><ajax><server>
2019-11-25 19:36:30
LQ_EDIT
59,040,634
Can I give a class name as an XML element?
<p>I'm looking to use XML to fill in some definitions of objects. I really want the file to be able to give a class name in a property itself:</p> <pre class="lang-xml prettyprint-override"><code>&lt;Object&gt; &lt;Name&gt;Something&lt;/Name&gt; &lt;ObjClass&gt;SomeClass&lt;/ObjClass&gt; &lt;/Object&gt; </code></p...
<c#><xml>
2019-11-25 21:52:13
LQ_CLOSE
59,040,875
.NET / C# - Get the next semi-week end date
<p>I have the following code, which simulates a week start on Saturday and then divides the week in 2 parts, returning Tuesday if the given date is Sat-Tue, else it returns Fri, however, I feel i'm doing something wrong, and that the code could be simplified, but I can't figure out how.</p> <pre><code>private static D...
<c#><.net><datetime>
2019-11-25 22:14:14
LQ_CLOSE
59,040,987
How to skip the first two lines of a file and read those lines that are multiple of 5
<p>I have a file and I want to skip the first two lines and read those lines that are multiple of 5</p> <p>line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 line 9 line 10</p> <p>output: line 3 line 8 .. . .</p>
<python><file>
2019-11-25 22:24:42
LQ_CLOSE
59,044,957
Keep ratio of DIV or img
<p>I want to keep the ratio of DIV For example I use google map</p> <p><code>&lt;div id="map" style="background-color: grey;width:100%;"&gt; Map here &lt;/div&gt;</code></p> <p>It adjust the width to window or <code>col-*</code> for <code>bootstrap</code>.</p> <p>it changes according to window size. </p> <p>But now...
<jquery><css><twitter-bootstrap>
2019-11-26 06:28:25
LQ_CLOSE
59,048,447
Objecy.keys().map() VS Array.map()
<p>can you give me an argument why approach A is better than approach B.</p> <p>Approach A:</p> <pre><code>const transformCompanyOptions = (companies: Array&lt;{id: string, name: string}&gt;, selectedId: string) =&gt; { return companies.map(key =&gt; { return { value: key.id, label: key.name, ...
<javascript><arrays><object><javascript-objects>
2019-11-26 10:10:29
LQ_CLOSE
59,050,799
Duplicate elements of array in the same array
<p>I got this array of objects</p> <pre><code>let item = [ { a: 1 }, { b: 2 } ] </code></pre> <p>and would like to duplicate array's elements to the same array. Output should be:</p> <pre><code>[ { a: 1 }, { b: 2 }, { a: 1 }, { b: 2 } ] </code></pre> <p>Can you help?</p>
<javascript><arrays><object><javascript-objects>
2019-11-26 12:16:21
LQ_CLOSE
59,051,360
Learning scripting/programming (beginning)
<p>What I am asking can be a bit silly and weird by anyway, I decided to ask you.</p> <p>I am working as network security administrator and have knowledge and experience on cyber security as well. 2 month ago I Started my master degree on Cyber Security and now really want to continue my career on Cyber. Along with ne...
<bash><shell>
2019-11-26 12:49:22
LQ_CLOSE
59,052,654
onBackPressed finish() not working in android studio
I used below code to close activity after back button pressed. ``` @Override public void onBackPressed() { super.onBackPressed(); finish(); } ``` after 5 time pressed it worked how to solve it
<android>
2019-11-26 14:02:06
LQ_EDIT
59,053,204
How can I check if a an array of strings is empty in MongoDB with java?
Imagine I have a DB with documents with the format: ``` { "id": "12345", "adress": "adress1,adress2,adress3" } ``` I have tried, after query the DB and get the document of the id I want, to turn *adress* into a list and get list.isEmpty(), but it's not empty. Can it be done using MongoDB?
<java><mongodb>
2019-11-26 14:31:16
LQ_EDIT
59,053,960
Escaping @ in Blazor
<p>I want to display image from icon library in Blazor component. </p> <p>The path is:</p> <p><em>wwwroot/lib/@icon/open-iconic/icons/account-login.svg</em></p> <p>But <strong>@</strong> is a special character in Blazor.</p>
<escaping><blazor>
2019-11-26 15:14:23
HQ
59,054,873
Quickest and best way to determine Angular/AngularJS version a site is using?
<p>At work, I've inherited over 30 web sites/applications built using C#, ASP.NET, MVC and AngularJS/Angular. The sites were built and updated between 2010 and 2018. Some have been built and updated more recently than others. What is the quickest and best way to determine decisively what version of AngularJS or Angular...
<c#><angularjs><angular><asp.net-mvc>
2019-11-26 16:01:02
LQ_CLOSE
59,055,019
How to make a .py file not human readable?
<p>I have a script in .py format and random forest in pickle format and i should deliver it to a customer . He should not be able to read both. </p>
<python><machine-learning><random-forest>
2019-11-26 16:08:43
LQ_CLOSE
59,055,231
Convert number to a binary code in JavaScript?
<p>What function or method converts number (2354) to binary code (001011001010)? Thanks</p>
<javascript><binary><numbers>
2019-11-26 16:19:55
LQ_CLOSE
59,056,385
Cannot connect to Elasticsearch from Go server running in Docker
<p>I have set up an environment today that runs a <code>golang:1.13-alpine</code> image, along with the latest images for Elasticsearch and Kibana.</p> <p>Elasticsearch and Kibana are running fine when accessing from my local machine, but I cannot connect to Elasticsearch through the Go server. I have put this togethe...
<docker><go><elasticsearch><kibana>
2019-11-26 17:26:42
LQ_CLOSE
59,056,952
TS1128: Declaration or statement expected (end of file)
<p>folks. Working on a TypeScript/React project (just getting used to it, haven't written React in a year, etc.), and having an issue.</p> <p>When I wrote this component, I followed some docs that I found, but I'm getting a TS1128 (Declaration or statement expected) error at the end of this file, and I can't figure...
<reactjs><typescript>
2019-11-26 18:05:06
HQ
59,057,311
Symfony 4 | Custom configuration file
I have been searching for a little while but I cannot find anything useful (or at least I think so). My goal is to add to a new symfony 4.4 project an extra config file to define some behavior of the system, it could be anything, like, pancakes.yaml: ```yaml pancakes: enablePancakes: false ``` I wish to kno...
<php><symfony><yaml><symfony-config-component>
2019-11-26 18:28:01
LQ_EDIT
59,058,242
How to add the output of each html page into multiple files in python?
I created a code that would generate each html page as output to save in different files by iteration of for loop. import requests import urllib.request def crawlpages(): for i in range(1451720, 1451730): link = "https://www.mmo-champion.com/members/" + str(i) ...
<python>
2019-11-26 19:36:31
LQ_EDIT
59,060,689
SQL Table to nested xml file
Action Action2 Name Action3 Batch add PL Steve add 1 add PL Steve add 3 add PL Steve add 4 add PL Steve add 5 add PL Steve add 1 add PL Steve add 3 add PL Steve add 4 add PL Steve add 5 [![enter image desc...
<sql><sql-server><tsql><xquery>
2019-11-26 23:07:01
LQ_EDIT
59,062,480
C#: I'm looking for a way to create new "primitive" types with additional constraints which are visible at coding time to users of the type
Suppose I have an entity in my universe of discourse called a `Widget`. Widgets are passed around between multiple distributed applications. All systems communicate through a messaging system. The messaging system passes a "common data model" (CDM) instance of the `Widget` around, where all applications translate to an...
<c#><types><dto>
2019-11-27 03:16:34
LQ_EDIT
59,067,724
Trying to show the size taken up by a specific directory, I'm my case, the HOME directory
<p>I've tried </p> <pre><code>df -H $HOME </code></pre> <p>But I just get</p> <pre><code>Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p2 31G 7.9G 21G 28% / </code></pre> <p>This is not correct as the total used size of my home directory is only 800MB</p>
<linux><bash><shell><sh>
2019-11-27 10:10:43
LQ_CLOSE
59,068,384
setModal in Java
public DatePicker(JFrame parent) { d = new JDialog(); d.setModal(true); String[] header = { "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" }; JPanel p1 = new JPanel(new GridLayout(7, 7)); p1.setPreferredSize(new Dimension(430, 120)); What is the purpose of `d.setMo...
<java><swing><jdialog>
2019-11-27 10:45:51
LQ_EDIT
59,070,001
I have published an Android app on app store but whenever I search it by name or package name i can't find it even in the long list of apps
<p>But I can only find it when I click on the button <strong>"View Apps on Playstore"</strong> .What seems to be the problem. It's been almost two days since my app is published.</p>
<android><google-play>
2019-11-27 12:14:05
LQ_CLOSE
59,071,404
Error: Could not find or load main class - Whenever i make a new java file
im currently working on a group project, we are using Eclipse to make a java program and using e-git (eclipse extension) to work together. For some reason today, whenever im trying to make an new java file in the package it will give me the error Error: Could not find or load main class projectPackage.filename, i have ...
<java><eclipse>
2019-11-27 13:32:16
LQ_EDIT
59,071,799
psycopg2.OperationalError: could not connect to server: Connection refused Is the server running on host "localhost"
<p>Got Error while doing docker-compose up.</p> <pre><code>conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5433? could not con...
<python><docker><flask><docker-compose><psycopg2>
2019-11-27 13:55:01
LQ_CLOSE
59,072,147
How to write this decorator?
<p>HELP Please . How Write This Decorator (Take a validator if the validator return "True" send args to func :</p> <pre><code>#define decorator here ... def validator(x): return x&gt;=0 @decorator(validator) def f(x): return x**0.5 print(f(4)) #should print 2 print(f(-4)) #should print error </code></pre>
<python>
2019-11-27 14:15:30
LQ_CLOSE
59,072,266
How do I set the starting position of my turtle of my turtle in python to the bottom left of my screen?
Greetings people of Stackoverflow! Currently, I am working on a project that involves turtles. And I have been trying to find a way to make the turtle start at the bottom left of my screen, as opposed to the coordinates (0,0). #My Code import turtle turtle.setworldcoordinates(-1, -1, 20, 20) ...
<python><python-3.x><turtle-graphics>
2019-11-27 14:21:49
LQ_EDIT
59,072,669
Can you use python to solve a quadratic without teaching it the quadratic formula?
<pre><code>def f(x): f(x) = x^2 + 2*x + 1 for x in range(-100, 100): if f(x) == 0: print(x) </code></pre> <p>Something like this? I get the error "cannot assign to function call" though</p>
<python>
2019-11-27 14:41:44
LQ_CLOSE
59,072,783
Java- I'm unable to execute my if-else statement
I've been figuring out my code for hours and I can't find any solution for my code The game GUI shouldn't be display anymore when I have clicked on either my Water , Fire Or Nature button,because every button will add 1 to store into my gamePlayed and the maximum would only store up to 5 times,I really cant figure it...
<java><swing><user-interface>
2019-11-27 14:48:44
LQ_EDIT
59,074,098
Which one is the fastest beween Set and Maps in Java?
<p>Which structure should I use if I need to have several operations of add and remove items into my collection? I need to have the quickest result, and obviously the most efficent one</p>
<java><performance>
2019-11-27 15:59:57
LQ_CLOSE
59,074,782
How to create a editable data-table (with pagination) without using Angular material?
<p>I want to create an editable table in Angular but without using Angular material. The table should also have pagination.</p>
<angular>
2019-11-27 16:38:56
LQ_CLOSE
59,074,879
Express server not listening to specific port 3000 on localhost
<p>app.listen(port, (err) => { if (err) return console.log(err); console.log('Server running on port ' + port); })</p>
<javascript><node.js><express>
2019-11-27 16:44:27
LQ_CLOSE
59,076,282
nodejs push is not a function
<p>I have difficulty making a collection of a class</p> <p>Match example</p> <p>and matches</p> <p>matches is a collection of match</p> <p>my class match:</p> <pre><code>const uuid = require("uuid"); // Match class is a single game Match structure class Match { constructor(players) { this.id = uuid.v4()....
<javascript><node.js>
2019-11-27 18:16:36
LQ_CLOSE
59,076,876
How to get input field values based on classes
<p>i have a form where i am showing input fields using loop. all fields have classes. Basically there are 3 fields. 1 - quantity 2 - price 3 - total</p> <p>as the input fields are in loop. so here is the problem that i want to show total from the quantity*price == total but i want to calculate total on click.</p> <p>...
<javascript><jquery><html>
2019-11-27 18:57:49
LQ_CLOSE
59,077,060
Populate a table from a list using multiple criteria
<p>I need to populate a table using 2 criteria to match the information. the source data is</p> <pre><code> A B C Month Segment Value 01/08/18 Alfa 236.200 01/08/18 Bravo 39.700 01/09/18 Alfa 8.400 01/09/18 Delta 48.200 01/10/18 Bravo 31.700...
<excel><excel-formula><excel-2016>
2019-11-27 19:12:10
LQ_CLOSE
59,077,895
c++ vector isn't showing any values i inserted
<p>So I am trying to convert string to int and then store the int into vector. But when I do that and i create a for loop to display what I have stored in the vector, all i get is 0000. here is my code:</p> <pre><code>#include&lt;iostream&gt; #include&lt;sstream&gt; #include&lt;vector&gt; using namespace std; int main...
<c++><vector>
2019-11-27 20:21:41
LQ_CLOSE
59,078,263
How to do this question in R without using loop?
<p>Let's say I have a dataframe like this:</p> <pre><code>df=data.frame("A"=factor(c(1,2,1,4,2)), "date"=factor(c("1999","2000","1999","2001","2001")), "value"=c(10,20,30,40,50)) </code></pre> <p>I need to sum the values in the column "value" if they have the same "A" and "date". So what I need is a dataframe like th...
<r><dataframe>
2019-11-27 20:52:40
LQ_CLOSE
59,078,862
How can I turn off a liquid valve when a flame goes out?
<p>I'm trying to make my family's life easier and cheaper. I'm heating my barn with a waste oil drip heater. I want to be able to automatically turn off the oil feed valve in case the burner goes out which would cause the barn to fill up with oil and possibly cause a fire.The oil tank will be under about 10 pounds of p...
<heat>
2019-11-27 21:44:15
LQ_CLOSE
59,079,241
Euclidean GCD function returns type None instead of int
<p>I'm getting back into mathematics, algorithms, and data structures. Today, I spent time studying up on the Euclidean algorithm and greatest common divisors. </p> <p>Below, I implemented a function to demonstrate what I learned: </p> <pre><code>from math import floor def euclidian(a: int, b: int): # a = b * ...
<python><python-3.x><algorithm><math>
2019-11-27 22:23:05
LQ_CLOSE
59,081,402
Microservices Java
<p>I am learning about microservices using Java technology (Spring Boot) , I can not find a good book or tutorials. I want to learn about microservices in details.If any one can guide in this it will be great.</p>
<java><spring-boot><microservices>
2019-11-28 03:39:59
LQ_CLOSE
59,082,162
How to intergrate JIRA with our own AngularJS application
I want to integrate JIRA with my own application. So that I can perform operation like, - Create a ticket - Delete a ticket
<angularjs><jira>
2019-11-28 05:17:24
LQ_EDIT
59,082,457
I need the time difference between two times in Hours in sqlserver
I need the time difference between two times in Hours. I am having the start time and end time as shown below: start time | End Time 23:00:00 | 19:00:00 23:00:00 | 07:00:00 I need the output for first row as 20,for second row 8.
<sql><sql-server><time>
2019-11-28 05:47:36
LQ_EDIT
59,084,100
Making changes with ifconfig persistent
<p>can anyone tell me on how to make the following commandline changes persistent? (Like via /etc/network/interfaces or /etc/dhcpcd.conf)</p> <pre><code>route del default ifconfig eth0 add 172.25.1.1 netmask 255.240.0.0 ifconfig eth0:0 netmask 255.240.0.0 route del default route add default gw 172.25.0.1 </code></pre>...
<linux><raspberry-pi3><router><gateway><dhcp>
2019-11-28 07:58:27
LQ_CLOSE
59,084,137
Script dont fuction properly
I have an script that reads the file and compares the string by a pattern, if it returns false it will delete the line on the .txt file. This is my code ``` const readline = require('readline'); const lineReplace = require('line-replace') const fs = require('fs'); const inputFileName = './outputfinal.txt'; ...
<javascript><node.js><regex>
2019-11-28 08:00:46
LQ_EDIT
59,086,051
Java HasgMap gives wrong values for the given key
I am using a Map<Integer,Map<String,List<Employee>>>. After populating the map , if i immediately retrieve some values with key(String). The returned List<Employee> is correct. After some iteration the values are changing. After first time populating data into the map, i have not used map.put anywhere. Only i am usin...
<java><hashmap><hash-collision>
2019-11-28 09:55:12
LQ_EDIT
59,087,910
Put last element of each column in quotation marks
<p>I am trying to put every last element of each column of a csv into quotation marks by using regex in Visual Studio Code. I am matching the string using <code>[^,;]+$</code> and trying to replace it by using <code>"$1"</code>. After replacing, the strings are not in order anymore and some vanish. Can anybody help me...
<regex><csv><perl><replace>
2019-11-28 11:32:03
LQ_CLOSE
59,090,356
is there any way with which we can print the following pattern?
class pattern { public static void main() { int i,j,p=1; for(i=1;i<=5;i++) { for(j=1;j<=i; j++) { System.out.print(p+" "); p=p+2; ...
<java>
2019-11-28 13:49:06
LQ_EDIT
59,090,539
Javascript Value To PHP variable
javascript code <script type="text/javascript"> $("#test").click(function() { getQuerystring(this); return false; }); function getQuerystring(el) { console.log(el.href); var getUrlParameter = function(sParam) { var sPageURL = el.href.split('?')[1], ...
<javascript><php><html>
2019-11-28 13:57:45
LQ_EDIT
59,093,592
sorry if this question is so simple. how to produce output string and numbering from the same statement in python?eg. "output_CH = 0.7 and CH_healthy"
if input_CH in range (185, 211): if input_CH >= 185 and input_CH < 190: output_CH = (1/5 * input_CH) - 37 elif input_CH >= 190 and input_CH <= 200: output_CH = 1 else: output_CH = (-1/10 * input_CH) + 21 ...
<python><python-3.x>
2019-11-28 17:06:04
LQ_EDIT
59,096,332
here iOS SDK creating draggable marker
I want to create draggable marker but it doesn't work. What I have missing? ''' let marker = NMAMapMarker(geoCoordinates: coordinates, image: markerImage!) marker.isDraggable = true mapView.add(mapObject: maker) mapView.respond(to: .markerDragBegan) { (drag, ma...
<ios><here-api>
2019-11-28 21:28:07
LQ_EDIT
59,096,452
Swift How to decode JSON without knowing the key name?
<p>I have json that looks something like this:</p> <pre><code>"events": { "1": { "id": 1, "name": "something" }, "2": { "id": 2, "name": "something2" },... } </code></pre> <p>Is there any way to decode this type of JSON where I dont know the name of the key?</p>
<json><swift><decode><decoding>
2019-11-28 21:41:00
LQ_CLOSE
59,096,612
Java- How do I store my numbers in my int?
I'm a beginner still trying to learn java , I have no clue what have I did wrong on my code because they seem logically correct, really appreciate if someone can give me a hand ! Thanks very much ! What I'm trying to do is create an int and when everytime I clicked yes in my confirmation dialog the int will increase b...
<java>
2019-11-28 22:02:50
LQ_EDIT
59,096,714
Calling Angular application not from the root path
<p>I created a simple Angular app with some routes inside. Now I am calling it from my browser:</p> <pre><code>http://127.0.0.1:8000/products_whatever </code></pre> <p>For this to work, to my understanding the following is needed:</p> <ol> <li>Web server should be configured to return <code>index.html</code> on requ...
<angular>
2019-11-28 22:15:30
LQ_CLOSE
59,097,365
warning: dereferencing 'void *' pointer error
With a C program written for solving a heat problem I am getting following error: [enter image description here][1] The program was meant for this: [enter image description here][2] Here is my code: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> #in...
<c><pointers>
2019-11-29 00:07:42
LQ_EDIT
59,097,798
Python - Breaking a Word into a given list of "syllables"
I'm trying to write a function in Python that will return True or False based on string matching to see if a given list of "syllables" mixed and matched can form a word. The two inputs would be the word and the list of syllables. Some examples: **Inputs**: “hello” , [”hel”, ”hol”, ”llo”, ”he”] **Output*...
<python><string><algorithm>
2019-11-29 01:34:00
LQ_EDIT
59,099,581
Wake up the bot on a hi and should start with same functionality
Any one kindly can tell how to wake up the bot on Hi.Actually I am in a dialog named as product issue having a prompt of adaptive card , i just want after clicking on that adaptive card it go to main dialog show functionality with which my bot have began.
<c#><botframework><azure-bot-service><adaptive-cards>
2019-11-29 06:12:56
LQ_EDIT
59,100,713
how to retrieve the id just created in the database in laravel?
<p>how do I retrieve the id that was just created in the database, when I press the save button, the data is created, and I want to retrieve the id from that data</p> <p>this my controller code</p> <pre><code>$cart= new cart; $cart-&gt;user_id = $request-&gt;user_id; $cart&gt;vendor_name = $request-&g...
<laravel><laravel-5><eloquent>
2019-11-29 07:46:09
LQ_CLOSE
59,101,007
How to get control info of Notepad write by python language
I have code bellow copy from website : https://pywinauto.github.io/ : ``` from pywinauto.application import Application app = Application().start("notepad.exe") app.UntitledNotepad.menu_select("Help->About Notepad") app.AboutNotepad.OK.click() app.UntitledNotepad.Edit.type_keys("pywinauto Works!", with_spaces = T...
<python><frameworks><pywinauto>
2019-11-29 08:10:45
LQ_EDIT
59,101,792
Run CSS in PHP function WooCommerce
<p>I wrote this function:</p> <pre><code>add_action( 'woocommerce_before_calculate_totals', 'adding_custom_price', 10, 1); function adding_custom_price( $cart ) { global $woocommerce; foreach ( $cart-&gt;get_cart() as $cart_item ) { //If there is minimum 1 coupon active if (!empty(WC()-&gt;cart-&...
<php><jquery><css><wordpress><woocommerce>
2019-11-29 09:07:03
LQ_CLOSE
59,102,038
why type hint cannot be used in the for loop
```for i: str in test_string:``` I received the **invalid syntax** error, I would like to know the reason behind.
<python><python-3.x>
2019-11-29 09:24:04
LQ_EDIT
59,102,680
How to reduce the value from multiple rows by calculation
<p>I have table called : stock , From that qty will be reduced by priority column in the respective warehouse.</p> <pre> ------------------------------------------- Id SKU priority Warehouse Qty -------------------------------------------- 1 sku1 p1 W1 1 2 sku1 p...
<mysql><stored-procedures>
2019-11-29 10:05:25
LQ_CLOSE
59,102,750
Symfony4.3.2 - Allow access to specific pages
I am on Symfony 4.3.2, trying to get a way to allow users having role (CommissionOwner) access to only following specific pages. - www.xyz.com/Loginlandingpage - www.xyz.com/reportSalesCommissions I am trying in **myApp/config/packages/security.yaml** access_control: - { path: ^/reportSalesCo...
<symfony4><symfony-security>
2019-11-29 10:10:42
LQ_EDIT
59,103,845
How can i convert days names to dates of the current month?
<p>I have an array of days in a month excluding friday and sunday as they aren't inculded in policy, i want to convert the array of days names to the dates of the current month but when i convert it is in incorrect format because it shows for different month <a href="https://i.stack.imgur.com/gTQ3u.png" rel="nofollow n...
<php><date><time><type-conversion><dayofweek>
2019-11-29 11:21:22
LQ_CLOSE
59,105,631
When I select the incorrect answer the next question loads with the the answer already displayed
I am completely new to coding and c#. I am studying a level 3 ICT and in my programming subject we are asked to make a quiz for essential skills students(Using forms.). I have been asked to create a very basic login in screen, topic selection screen, level selection screen and the actual questions and answers; answer...
<c#><winforms><linq>
2019-11-29 13:22:00
LQ_EDIT
59,105,774
Why is javascript recursive function returning 'undefined' even when I am returning a value
<p>I am looking at how to implement binary search in a javascript function and found that when I return the value and save it into a variable then when I console.log this comes as undefined.</p> <pre><code>const recursiveBinarySearch = (numbers, target) =&gt; { const midpoint = Math.floor(numbers.length / 2); ...
<javascript><binary-search>
2019-11-29 13:30:46
LQ_CLOSE
59,106,395
HTML - Allow only pattern with numbers and dots for input type text
<p>I need to have a text input that accepts only numbers and the dot sign for float numbers.</p> <p>I don't want a number type input.</p>
<html><regex>
2019-11-29 14:12:44
LQ_CLOSE
59,106,783
I can't view the database content on a php page
<p>I can't view the database content on php page I want to fetch data using ID thats the code :</p> <pre><code>&lt;?php //connect with database $servername = "localhost"; $userdbname = "root"; $dbpassword = ""; $dbname = "users"; $usid = 0; $docname = ''; $conn = new mysqli($servername, $userdbname, $dbpassword, $d...
<php><mysql>
2019-11-29 14:41:38
LQ_CLOSE
59,107,818
Regex Pattern for domain or hostnames or probably the best way to match a pattern
<p>Here's a sample domain name FQDN, How can I match the domain name after the short hostname? instead of making a pattern match for domain names? Advice is really much appreciated.</p> <pre><code>host1.dept1.domain.com host2.domain.com host3.domain3.com </code></pre>
<arrays><regex><ruby>
2019-11-29 15:50:39
LQ_CLOSE
59,107,922
What is the purpose of period (.) in the ~/.bashrc
<p>I've been studying the bash scripting then i noticed using the period wildcard in the bash script, in my sense the period treated as current directory, </p> <p>I have snippet </p> <pre><code>if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bas...
<linux><bash><shell>
2019-11-29 15:57:39
LQ_CLOSE
59,108,603
Pass a vector of pointers to function in c++
<p>I saw many posts here but none of them explains what I'm trying to do. I have the vector <code>vector &lt;Car*&gt; carVector;</code> and I want to pass it to a function so I can read the information of the objects in there. The objective is to pass it and then I can use it in this cicle</p> <pre><code>for (i = 0; i...
<c++><function><vector>
2019-11-29 16:54:33
LQ_CLOSE
59,109,331
mapping integers 1-max onto 100 integers from 1-1,000,000
<p>I need to map a Java integer from the range 1-max to the range 1-1,000,000, but only using 100 particular (non-linear) values in the destination range. The 100 values are:<br> 1-10 (so the first 10 values map to themselves)<br> then by 5's: 15, 20, 25 ... to 100<br> then by 50's: 150, 200, 250 ... to 1,000<br> and ...
<java>
2019-11-29 18:02:02
LQ_CLOSE
59,109,620
GoLang - Conversion of type "interface {}" to another interface in a slice of type "interface {}" via reflection
I've been burning neurons for hours and I couldn't solve this question. I have a slice of type People, I need to pass this slice to a function that gets the type "interface {}". The People type "implements" an interface called HasCustomField, but I can't do the type conversion within the function, as I am doing: ...
<go><slice>
2019-11-29 18:34:11
LQ_EDIT
59,110,159
Thread Sleep and ReadKey doesn't cooperate
<p>I want to stop the whole do-while loop by using space and write out my WriteLine, but it doesn't do anything on pressing spacebar. I think it's something to do with Thread.Sleep, maybe It doesn't allow user input while on Sleep. I would be really happy if someone could enlighten me why this doesn't work</p> <pre><c...
<c#>
2019-11-29 19:35:08
LQ_CLOSE
59,111,939
importing an class from the same directory in Perl
<p>i have a directory with main.pl and Product.pl. in the main.pl i try to import the Product class but the execution fails when i run perl main.pl complaining that cant locate Product.pm in @INC. My directory is not in the @INC list. How can i fix this?</p>
<linux><perl><oop>
2019-11-29 23:26:29
LQ_CLOSE
59,112,151
Two constructor calls inside one constructor in C#
<p>I know how to call another constructor for a constructor from the same class or the base class, but how can I do both at once? Here is an example of what I am looking to achieve, noting that in a real case we might want to do something more complex than just set a property:</p> <pre><code>public class BaseClass { ...
<c#><constructor><base>
2019-11-30 00:08:32
LQ_CLOSE
59,112,429
How to code a javvascript to indicate item in a list clicked?
This javascript fails to show the line number of item clicked. <!DOCTYPE html> <html> <body> <script> function registerHandlers() { var as = document.getElementsByTagName('a'); for (var i = 0; i < as.length; i++) { as[i].onclick = fun...
<javascript>
2019-11-30 01:22:33
LQ_EDIT
59,113,034
Trying to make the answer randomly generated after retry in C#
<pre><code>using System; namespace Test { class Program { static void Main(string[] args) { int num1 = int.Parse(args[0]); int num2 = int.Parse(args[1]); bool GameOver = false; int turn = 3; Random random = new Random()...
<c#><random>
2019-11-30 03:47:53
LQ_CLOSE
59,113,673
Pet.Acropromazine(): Not all code paths return a value
<p>I am trying to make a class for a pet name, age, weight and if it is a dog or cat and the have to methods to calculate the dosage for Aceptomazine and Carprofen. I want to return a different value for both the Aceptomazine and Carprofen method for a cat and a dog but when I do it says Pet.Acropromazine: not all code...
<c#>
2019-11-30 06:05:35
LQ_CLOSE
59,113,807
Compilation on Linux - In function '_start': (.text+0x20): undefined reference to 'main'
<p>I want to compile a series of cpp files on Linux. Using CentOS 7, in the Konsole, I type "g++ -std=c++11 main.cpp canvas.cpp patch.cpp utils.cpp", and I get an error: </p> <pre><code>/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' co...
<c++><linux><c++11><compiler-errors><g++>
2019-11-30 06:31:48
LQ_CLOSE
59,114,632
Does my Java code for the Josephus problem work?
Here's some Java code I made for homework on the Josephus problem. I believe it doesn't work, but I want to make sure. If it's broken, I want to see if it can be fixed. If it can't be fixed because it is flawed by design, then please tell me so. Thank you. ``` public Int Josephus problem(int num4){ int reducer...
<java><optimization>
2019-11-30 08:51:59
LQ_EDIT
59,115,134
Removing duplicates and printing the string in specific output in python
Well, I tried my hardest to get it done! but i end up failing this at deleting duplicates at listing them. Can you guys tell me how to do this one or any clue? Here's the output I want to get: Please enter sentence: Hello Python! ' ' 1 '!' 1 'H' 1 'P' 1 'e' 1 'h' 1 'l' 2...
<python><python-3.x><string><duplicates>
2019-11-30 10:14:10
LQ_EDIT
59,115,180
How do I get Parent with multiple children in desc order in sql server to show the newly created parent with its children at top in a List
[enter image description here][1] [1]: https://i.stack.imgur.com/SSmyN.png## ---------- I need to get in desc order as Parent1 with its children, parent2 with its children and so on.. ##
<sql><sql-server>
2019-11-30 10:20:40
LQ_EDIT
59,116,048
Java turn HTML codes into normal characters
<p>I am making a trivia game that pulls the questions from <a href="https://opentdb.com/" rel="nofollow noreferrer">https://opentdb.com/</a> but some of the questions and answers don't come out correct in java for example one of the questions looks like this:</p> <pre><code>What color is the &amp;amp;quot;Ex&amp;amp;q...
<java>
2019-11-30 12:12:39
LQ_CLOSE
59,118,047
is there any package to extract particular keyword in python
I have comments like "the product name with ch12345 and tp12345 " there are so many comments like this. my query is to extract keywords starts with ch and tp followed by two or three-digit number.
<sql><python-3.x>
2019-11-30 16:24:15
LQ_EDIT
59,118,579
How to fix a strange error with List.Find()
public static string[] categoryNames = new string[] { "Control", "Supplies", "Power" }; int listSelected = categoryNames.Find(item => item == "Power"); Hello! For some reason, I get this error over 'Find': *There is no argument given that corresponds to the formal parameter 'match' of 'Array.Find<T>(T[], P...
<c#><list><find>
2019-11-30 17:32:47
LQ_EDIT
59,119,132
What is the moral of this?
<p>One great personality said once:</p> <p><strong>"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."</strong></p> <p>Is it true? What do you think the moral of this? </p>
<debugging><coding-style>
2019-11-30 18:40:17
LQ_CLOSE
59,119,822
What's the faster, most efficient way to toggle > 10000 checkboxes with Javascript/JQuery?
I have a `div` with more than 10000 checkboxes in it. ```html <div class="well well-sm" style="min-height: 100px; max-height: 360px; overflow: auto; background-color: #f7f7f7;"> <label> <input type="checkbox" class="checkbox-item" name="some_name" value="28" checked="checked"> Item 1 ...
<javascript><jquery><html><dom><optimization>
2019-11-30 20:09:38
LQ_EDIT
59,120,071
Dictionary to list of strings pair
<p>I have the following dictionary: </p> <pre><code>{'PoP': 4, 'apple': 1, 'anTs': 2, 'poeT': 1} </code></pre> <p>And I wish to have a list of values like this:</p> <pre><code>['PoP, 4', 'apple, 1', 'anTs, 2', 'poeT,1'] </code></pre> <p>Which is like having a list of tuples but without the parentheses. Is there any...
<python><list><dictionary>
2019-11-30 20:39:20
LQ_CLOSE
59,120,347
What is a flag in python while loops?
<p><strong><em>I am new to python and I came across this terminology-> flag in python while loops so can anyone explain what that is?</em></strong></p>
<python><python-3.x><while-loop>
2019-11-30 21:19:22
LQ_CLOSE
59,120,670
statement that executing code over and over
<p>I do not know how to do code that is executing over and over again. I would like to achieve something like this: (&lt; stands for input, > stands for output)</p> <pre><code>message=input() print('Write down the text.') </code></pre> <pre><code>&gt;Write down the text. &lt;qwerty &gt;qwerty &gt;Write down the text....
<python><if-statement>
2019-11-30 22:03:33
LQ_CLOSE
59,121,952
coverting arraylist to array in less than O(n)
<p>I am currently working on program and want to convert ArrayList to an array but in less than O(n) time.</p> <pre><code> for (int i = 0; i &lt; list.size(); i++) { if (list.get(i) != null) { arr[i] = list.get(i); } } </code><...
<algorithm><arraylist><data-structures>
2019-12-01 02:05:15
LQ_CLOSE
59,122,185
how many bytes is this struct? - how many bytes is pointer to a struct?
<pre><code>struct hello { size_t num; struct jump *next; } </code></pre> <p>I get that size_t is 4bytes but how many bytes is struct jump *next?</p>
<c>
2019-12-01 03:02:38
LQ_CLOSE
59,122,235
What does ** mean in Python?
<p>I have looked all over Ecosia and SO. I cannot find the answer to this question:</p> <p>What is <code>**</code> used for in Python?</p> <p>Like, <code>exampleVariable = 5 ** 5</code></p> <p>Thanks for any help!</p>
<python><python-3.x><math>
2019-12-01 03:16:43
LQ_CLOSE
59,123,399
What type of ML algorithm / model should I use for prediction?
<p>I apologize this might be a poorly asked question, Im looking for more of a point in the right direction to start research. </p> <p>So say I have large sets of Array data. Ill be easiest to give an example:</p> <pre><code>[{a: 1}, {h: 3}, {r:7}, {p: 2}] [{y: 4}, {p: 3}, {w: -3}, {u: 54}] [{l: -9}, {h: 5}, {r: 9},...
<python><tensorflow><machine-learning>
2019-12-01 07:18:26
LQ_CLOSE
59,123,445
PHP Get last increment of five minutes
<p>I am looking to get the previous increment of five minutes from the current time...</p> <p>Lets say that the current time is 12:07pm UTC</p> <p>I want to put into a variable 12:05pm UTC</p> <p>What would be an easy way of going about this?</p>
<php>
2019-12-01 07:24:59
LQ_CLOSE
59,123,670
Why my groupby work says "invalid syntax"
<p><a href="https://i.stack.imgur.com/IsAy6.png" rel="nofollow noreferrer">groupby</a></p> <p>Hello, i try to find the mean of a data of groupby a dataframe. However, it shows my work has invalid syntax and please somebody help me.</p>
<python>
2019-12-01 08:01:52
LQ_CLOSE