Newest Questions

Q&A for professional and enthusiast programmers

Parsing a std::string to a std::tuple

I'm looking to read input from a file and convert this to a std::tuple type. For example, I might have input like this: ((3,12,8),(2,4,6),(14,5,2)) in a file. Is there any built-in way to parse this ...

Convert newElm Buttons to list Buttons

What i am trying to do is converting buttons that are normaly created like this: for (i = 0; i < zahlen.length; i++) { newElm = document.createElement('button'); newElm.className = ...

Basic data export

I'm trying to export two columns of user metadata with WPAllImport, but I don't know how to do the same function twice so that different values are returned for each column. The meta keys required are ...

golang how to live test an http server?

I use gotests, and gorilla mux and I can unit test my http handlefunc handlers, but they do not respond to the proper http request methods as they should under the gorilla mux. How I can do a "live ...

Awaiting TaskCompletionSource across android activity navigations in C#

Im trying to create an awaitable method for gathering user input, that i can call from my viewmodel/core. On android i want to present a new activity with input fields and an "OK"-button. Once the ...

Cast as Float returns ActiveRecord::StatementInvalid: Mysql2::Error

So I am doing the following in Rails 4.2.7 @product.reviews.select('CAST(answer_1 AS FLOAT) AS answer_1') Unfortunately this returns ActiveRecord::StatementInvalid: Mysql2::Error: You have an ...

bootstrap 4: center inline form inside a jumbotron

I have an inline form inside a jumbotron. I want to center it. I tried using 'text-align:center' on the jumbotron and it did center all the other elements inside the jumbotron except for the inline ...

Compare Date in SQL Server

I building an ASP.NET application that connects to SQL Server 2008 R2. I having a brain fart on this one. I am trying to get some records between a date that the user chooses. The application builds ...

Swift: Asynchronous query to build array with recursion

I have an asynchronous query "buildArrayFromQuery" that i am using to build an array. This works fine most of the time but when i try and build an array of arrays with a for loop about 1% of the time ...

Keep track of filesystem (folders/files) states by saving them

I'm looking for a way to track changes of a folder, with sub-folders and files, from time to time - not in real time. Basically I want to know which folders/files that was changed (changed or delete) ...

Wamp Server error - php

I setup Wamp Server in D:/ Driver not C:/ Driver and i created a folder inside WWW Folder with the name of php_course and inside it i created php file named test.php and when i tried to run the php ...

CORS Issue with external API - Works via PostMan but not HTTP request with Axios

Working on a new Laravel project that involves car data and found a free look up API. http://www.carqueryapi.com/documentation/api-usage/ An example endpoint is: https://www.carqueryapi.com/api/0.3/...

Use “name” value from HTML form tag in Python lpthw.web application

So basically, I have an HTML form with sets of radio buttons with different "name" values (all distinct 6 digit numbers) to differentiate them. Different radio buttons have different "value" values (...

Tomcat 7 NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()

I am having trouble deploying a web application on tomcat 7. The application is compiled using JDK 7 so I configured tomcat to use JDK 7 by setting JAVA_HOME=/usr/lib/jvm/jdk1.7.0_80/ in /etc/default/...

CreateViews and assigning values to two OneToOneFields

I am trying to set the value of two OneToOne fields on save in a CreateView. Here are the two models (each living in separate apps). CompanyProfile app Models.py: class CompanyProfile(models.Model):...

Microsoft Graph. DriveItem Id format?

Looks like, in Microsoft Graph and OneDrive Id for drive and drive item has special internal format: Drive Id is equal to unique identifier of the user. Drive item Id is [DirevId]![ItemNo]. Am I ...

How to count the number of elements in an array in c++?

My data is on a text file that contains two columns, x-values, and y-values. The number of data points on this file can be different but never exceeds 1000. So I have declared two arrays x[1000] and y[...

C# - NetworkStream throwing Stream not writable Exception

I have two C# applications - TCP Client and TCP Listener. I communicate between these using StreamWriter and StreamReader which are NetworkStreams over TCP Socket. Due to the trouble with not being ...

Making a popup when someone enters the site

So basically I would like to implement the feature that when someone enters the site it welcomes them with a popup with two options to choose (language) and I don't know how to make it so I'm asking ...

Website doesnt scale properly when switched to landscape on phones

I have created a responsive website that has desktop and mobile versions, using @media. Everything works perfectly, apart from when you view the website on a landscape phone or on an ipad. Here's the ...

Webpack hash scss names

Is possible to hash scss classes names on production ? eg. class .container {} to ._4xev {} My style loader: { test: /\.s?css$/, loader: ExtractTextPlugin.extract("...

asp login in bootstrap modal

I am a beginner to asp.net. I am currently working on a school project and I am using bootstrap modals for login and register. I am using the login and create user wizard and they work fine if i use ...

Error: Generic parameter 'T' could not be inferred

I was trying to use Hakuba as a replacement for UITableViewDelegate and UITableViewDataSource implementations. Unfortunately, its latest version is written in swift 2.0, so, when opening the project ...

How to bind a nested property in a view with aspnet core

I am starting to learn AspNetCore, and I would like to know how to bind a nested property in the view. I have this two object public partial class Club { public Guid Id { get; set; } public ...

Lambda Integration vs. Lambda Proxy: Pros and Cons

What do you think are the Pros and Cons of using Lambda integration with and without the proxy feature in AWS API Gateway (and more specifically, when using the Serverless framework)? Here's what I ...

How do I subscribe to power management system preferences change notifications

Am attempting to caffeinate a 3rd party app and have created a simple background app that submits a command of caffeinate with its PID. Similarly have a the background app to check if its still ...

Unity Android PersistentDataPath UnauthorizedAccessException

I'm attempting to learn more about PersistentDataPath in order to resolve an issue in my application. Here is the error thrown on certain devices: UnauthorizedAccessException: Access to the path "/...

get min and max for a column plus all row data

CREATE TABLE users ( users_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, first_name VARCHAR( 20 ) NOT NULL, last_name VARCHAR( 40 ) NOT NULL, email VARCHAR( 60 ) NOT NULL, ...

Java: calculate cache misses in a single function

I have java project and after profiling it (through YourKit), I concluded that a single function is taking a lot of time. I want to compute cache misses in that single function. Is there any way to do ...

Wisdom for a smaller fellow

I am a younger developer and wanted to ask some older developers with jobs, in the development field, what their suggestions would be for me, to prepare myself to get a job. Such as what I should ...

Plotting a raster stack in R with raster specific colours

I have a raster stack of 15 rasters, and I would like to make two plots of the max and min value from this stack- this is fairly simple using max/ min. However, what I want to do is plot but apply ...

How can I update a Firebase element via Javascript?

I am programming a little app in which you have a score system (like 10 points a user) and I am doing this via the Firebase database. My problem is, that I don't know how to update my database ...

Is this sql code safe to use?

Is it safe to use variable as column name like I use in this code? public function SelectForum($column, $value) { global $database; $database->query('SELECT * FROM forums WHERE '.$column.' ...

Angular 2: Toggle sub menu (similar to jQuery slideToggle)

I'm trying to toggle a sub menu within a list when a link is clicked. https://plnkr.co/edit/ZoOGJD8FUbBfPgHTKlPh?p=preview Template <ul> <li><a><i class="zmdi zmdi-home"...

Compile with gccgo and my library package

How can I compile my go program (that successfully compiles with go) with gccgo? Running with go $ GOPATH=`pwd` go run hello.go Hello World! Failing with gccgo $ GOPATH=`pwd` gccgo-6 hello.go ...

Do not display removed sprites, Pygame

I am experiencing an issue with pygame. I am making a little game and if I die I would like to delete enemies sprites and reload them later I respawn. I successfully delete them for their group but ...

Solving stiff ode system with scipy

I used an autograd package to automatically differentiate a function and use derivatives as a part of the right-hand side of the system of 4 coupled ODEs. I used lsoda integrator (specified BDF method)...

Change injected generic class constructor parameter

I have a repository that takes a generic and whose constructor takes a DbContext (shown below). I want to inject this repository into a controller whose constructor is FirstController(...

zeppelin: New install, no home page

I've just downloaded Zeppelin, started the server, and loaded localhost:8080 into Chrome, but my startup page is blank. I've attached the blank screen and what I think I should be seeing below. ...

How to connect two or more mikrotik router as one?

i want to join/merge/connect two or more mikrotik router as one so that they can share their port and act as one mikrotik router, like load balancing in web servers there is a way to load balance and ...

SPARK SCALA Export DF to TextFile

I want to export DF to text file. There are two problems to export it as text file. It has 46 columns, and error log says text only support 1 column. I want the file is rolling fie means I want ...

bootstrap 4 dropdown menu in wordpress

I am building a UI in Bootstrap 4 and dropping onto WordPress. The navbar menu has proven to be a challenge. I have meticulously followed instructions on how to do this little retrofit, but have only ...

ELSE statement is getting skipped

In my template, I am trying check if a list is not empty. If it is not empty, I check for something. However, if the list is empty, it 'else' is never evaluated. {% for secret in secrets %} ...

PyWavelets Stationary Wavelet Transform: why does SWT/ISWT returns/requires intermediate approximation coefficients?

According to the documentation of PyWavelets: SWT returns: List of approximation and details coefficients pairs in order similar to wavedec function: [(cAn, cDn), ..., (cA2, cD2), (cA1, cD1)] ISWT ...

Can travis manipulate the version number in AssemblyInfo

This post shows how I can extract the build counter from Travis although from all the documentation I don't see how I can push that back into my AssemblyInfo.cs files. I can do this so easily in ...

How to join 2 MySQL Tables without returning all joined rows

I have 2 tables that I want to join and all I want to know from the joined table is whether there is an exiting row that matches the join condition. I do not want to return all rows the the joined ...

Binding DependencyProperty in codebehind to CommandParameter

I'm trying to send property thats set by dp to my viewmodel (bound via datacontext) via command parameter a Dependency Property in the code behind of my view. The property (ParentUserControl) seems to ...

How to create a list from array in javascript?

var arr = [1,2, [1.1,1.2,1.3] ,3]; How do i create a list using only javascript and DOM : 1 1.1 1.2 1.3 2 3 Thanks!!!

Why printing the array in PHP each string content appears as [0]=> &string instead of [0]=> string?

I'm trying to print out an array with var_dump() and the result is shown as this: array(2) { [0]=> &string(4) "8686" [1]=> &string(72) "Curso PRESENCIAL" } Now my question is: Why the ...

Hartl's Rails tutorial - false with “authenticated?” (activation_token)

Dear Colleagues. I'm doing a Hartl's Railstutorial and encountered a problem, I can not solve. Every step I make according to the tutorial. Description of the problem: When doing exercise, "Using ...
15 30 50 per page
Translating... 0%