Newest Questions

Q&A for professional and enthusiast programmers

Which content-type to use when Uploading sqlite .db file to a server?

I want to upload a .db (SQLite) file from my android app to a server and I'm wondering if I can use "multipart/form-data" as the content-type. Is there any specific type for .db file as for pdf files ...

Outlook VBA to scan through the inbox for a specific string in the subject

I'm working on a project were I need a macro in outlook that will scan through the inbox for an e-mail with a "reference number" contained with-in the subject field. If no e-mail was detected, the ...

Why does this code open in a new window after the signed in?

Here is my code. My problem is that when I click to Sign In it signs me in a new tab. How can I make this code to keep the content in the same window? Do I must use iframe? Thanks. <form accept-...

Angular 2 download .CSV file click event with authentication

I'm using a spring boot backend and sending backend and my api uses a service to send data via an OutputStreamWriter. I can download this in Angular 2 using a click event like so: Typescript results(...

Elixir + Phoenix: Where do I put application initializers?

I am looking into using the Amnesia package: https://github.com/meh/amnesia One of the requirements in addition to defining my database / schema is running the line Amnesia.start. I would like to do ...

How do i fix this issue i am having with my else? [duplicate]

Please help me. I am stuck on how to get the program to do this part. So what i want it to do is when they enter an invalid choice (where the else is) i want it to keep asking to enter Choice until ...

Jenkins SCM Branch Specifier with regex

Is there a way to define a regex pattern for a specified branch in Jenkins SCM?

python3 script to add a line if string doesnt exists file

I am trying to add a group entry to sudoers file. If group exists in the file skip it or else add the group entry to /etc/sudoers file. with open('/etc/sudoers', 'r') as sudorfile : for line in ...

View selected photo inside a ng-repeat in another div

I have a table that has data in ng-repeat. A column contains photos. When I edit a specific data in the table, the photo of the data that I have been selected should be shown. How can I possibly do it?...

Do CUDA threads execute in lockstep for O(n) operations?

The CUDA programming guide has the following to say: A warp executes one common instruction at a time, so full efficiency is realized when all 32 threads of a warp agree on their execution path. If ...

Set position to FacesMessages

I'm displaying a facesmessage [![FacesContext.getCurrentInstance().addMessage( null, new FacesMessage(FacesMessage.SEVERITY_WARN,"Datos Inválidos","Credenciales ...

Create form in ssrs

I was assigned a task to create a form in SSRS. This form is used by finance dept submit to government quarterly. The sample form looks like a tax form. When end user input data the form will ...

How to write to multiple files in C#

Can you please tell me, how can I write my data in to 4 separate files in C#. I have a example data set as follows and need to write them in to separate files. originaldata.txt 5.1,3.5,1.4,0.2 4.9,3....

“The system cannot find the path specified” for C# MVC Application

When I run the code,I get this error "The system cannot find the path specified", I have screenshot that shows what the error looks like,I need help to fix it,Anyone can help me???

How can I make a bootstrap navbar stay on top after scrolling down? (It's more complicated)

https://i.stack.imgur.com/hmadN.jpg ^Here is the picture of my website header. How can I make the blue navbar scroll smoothly to the top while i scroll down the page (only the navbar, not the logo&...

SWI-prolog same generation

I have some facts and rules that I'm trying to use that when I pass a query it says if the two variables are of the same generation (either siblings or cousins). %mother/father DB mother(lisa, abe). ...

How can I specify network interface for redis replication

I'm using Redis 3.2.0 and enabled replication. But I got result for "info replication" as follows: master_link_status:down Redis log shows: Connecting to MASTER master_host:6379 MASTER <...

How to develop a check class attendance using wifi direct?

What I want to do is develop a check class attendance using wifi direct. In the old way, teacher have to call the name of each student, the student should answer him. So I want to use phone to do this ...

Could not instantiate persister org.hibernate.persister.entity.JoinedSubclassEntityPersister

I am getting the following error while trying to connect to mysql using hibernate. I have a Super class Employee and three subclasses: SoftwareEmployee, HardWareEmployee and Admin.I also have two xml ...

Please help! Exception in thread “main” java.lang.NullPointerException at ExerciseC.main(ExerciseC.java:13) [duplicate]

Please help! When I enter * to terminate the entering of values.It shows "Exception in thread "main" java.lang.NullPointerException at ExerciseC.main(ExerciseC.java:13)" . I'm looking forward to ...

How can I include my javascript file?

I need to inculde my javascript a file in django. I know how to include files of CSS. I'm doing it so way: <link rel="stylesheet" href="{% static 'demo/style.css' %}"/> How can I include ...

SmartGWT DateTimeItem,how to show the hour and min PickerItem?

enter image description here The SmartGWT DateTimeItem doesnot show the hour and min picker item ,how to show the hour and min picker item like the picture? (the picture is use the RelativeDateItem)

How to solve the error onClientConnectionState() - status=22 clientIf=7 in BLE

I have an Android application which uses to connect Bluetooth Low Energy (BLE) with my phone. The application worked well in the almost phone such as Galaxy S5 (Android 5.0.1), Galaxy S6 (Android 6.0)....

Can the result of this HQL be reused?

As known, HQL is not SQL and will be executed using JAVA, so I have 2 view regarding the following HQL and could anyone tell me which one is correct? The content inside the c will be executed ...

Problems with a program that decodes resistance by color in C

I've hit a complete roadblock on this, I'm not entirely good with pointers and file handling atm and uni. was moving too fast that I can't keep up... so for here is my code: #include<stdio.h> #...

How to translate Linq Expression where clause to hql where clause?

For some reason, I needs to combine Linq Expression (only where clause) & a hql where clause into one query, I find that the session.Query() API will translate Linq Expression to a HqlQuery object(...

How to fix Requested URL / was not found?

Hello I wanna ask about how to change a permission on a server. The story is I have an application file, when I put the application file in the server and accessed it from the browsers,it didn't work ...

Meteor @import css: Resource interpreted as Stylesheet but transferred with MIME type text/html:

I keep seeing this message in my console, although my stylesheet seems to be loading fine (they weren't originally, seems they have to be in the client folder, is that correct?). I'm on Meteor 1.4.2.3....

ResourceNotFoundException throws when a service layer method test is running

I'm using spring boot and i try to to some test Actually my test class @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT) public class MemberServiceImplTest { ...

HTML Bootstrap Method Not Allowed

Im doing a small project where I give the users the ability to type in a note and it will display the typed in note right above. My first displayed box.. is a note box.. When I type in something and ...

When to use static class functions instead of namespaced functions?

I'm currently trying to implement a factory design pattern and somewhat confused as to how this is typically done in C++. I've been referring to this webpage. So on that webpage, they show an example ...

Writing a buffer to a struct seems to not be working

I am working on a project that is aiming to create a simple version of a file system for a class. I am running into trouble when I work with the "inode" structure that we have defined. The inode ...

javascript setinterval not going back

//change the speed at which the animations are moving function spd() { var stuff = document.getElementById("speed"); //if start is enabled //change speed if ((document.getElementById("stop")...

how to get on off switch in android like this one

i want an on off switch like this one in the first image enter image description here but i am getting an switch like this one in the second pic. Its text On and TextOFF does not look good. How to ...

Does overfit outside the dataset range in Machine learning really matter?

I was tyring out a pizza price dataset. With two different approaches, the results were different (as shown in the screenshot below). As the dashed line shows, the model was overfitted. But it is ...

How to access output files in Travis?

I'm trying to deploy an Android library on Bintray using Travis-CI. But when I upload my repo... I got this: Ran lint on variant release: 6 issues found Ran lint on variant debug: 6 issues found ...

Android: which kind of Broadcast/Receiver combination should I use?

In my app, I want to kick off an timer that triggers an action every x minutes, regardless if the user is currently in the app or not. I have been reading around and am not sure which combo of ...

caffe mnist softmax layer gives probability always 1

I'm using caffe/example/mnist network to classify numbers. When I give the network a picture of number it seems working ok. But when I give the network a picture not a number, the mnist trained ...

Redirect to the same page after removing record from mongodb

How to redirect to the same view (handlebar) after performing remove data operation in mongodb? I'm trying to perform res.render but it says that web site cannot be reached. Thank you for your help. ...

JavaScript: How to use a method within a prototype?

I am trying to modify a plug-in (Pikaday) and add my own little bit of functionality. The plugin is built using the proto-type system, and I have added my funciton within it. Pikaday.prototype = { ...

In Ulysses, how to keep original image (figure) size when exporting to PDF?

Everything seems to be fine to write with Ulysses, but one thing I feel frustrated is the image size and position (when exporting to PDF). The only style to set is paragraph-figure, but I can not make ...

I am getting the following error when I am using the confusion matrix in R:Error in sort.list(y) : 'x' must be atomic

Cleaning the environment rm(list = ls()) reading the data hr <- read.csv('C:/Users/Pranav/Documents/Fall 2016 MIS/CS 513/Final Project CS 513/human-resources-analytics/HR_comma_sep.csv') ...

Copying the pixels of an image to a canvas in java

I'm trying to manipulate the pixels of an image uploaded by the user and write the new image onto a canvas. Right now I'm just trying to copy the original image without changing the RGB of the pixels. ...

Firefox Webextension Error: Permission denied to access property “document”

I am writing a firefox webextension and i am having this error : Error: Permission denied to access property "document" My manifest.json { "description": "Demonstrating webRequests", "...

iOS Microphone Option Not in App Settings Even Though Permission was Given

I'm having a weird issue with asking for permission to the microphone on iOS 10. I put the proper plist property (Privacy - Microphone Usage Description) and enabling it through code. On my phone, the ...

My Table Invoice and LineItem arent outputting its values

enter code here SET NOCOUNT ON Create Database FinalDatabase GO USE FinalDatabase GO /* Create tables */ Create TABLE tblSalesPerson ( SalesID INT IDENTITY(1,1)PRIMARY KEY, FName VARCHAR(24) ...

EAS/Outlook not authenticating - Exchange 2016

Hope you are all well! Sorry if this is not the right section to post, I just signed up so please point me in the right direction if this is the case. I am currently studying Server 2012r2 and ...

Can I use groupByKey in each partition of RDD? or how can I find the largest key of each partition?

I want to find the largest key (also the last key) in each partition and there may be two or there largest keys (equal with each other) in each partition. DStream.map(lambda x: (x,1)).transform(...

What is the R command for conditional formatting?

I need to plot y~x, but only for specified values of dummy variables b=0, c=0. I think this is some sort of conditional formatting, but can't figure out the command. Thanks in advance.

Nibabel inconsistent image header/data orientation

I am finding an inconsistency in my image between the header and the data: >>> im = nib.load('image.nii') >>> im.shape (512, 512, 112) >>> im.get_data().shape (112, 512, ...
15 30 50 per page
Translating... 0%