Newest Questions

Q&A for professional and enthusiast programmers

Bootstrap tabs in Chrome extension popup

I have some Bootstrap tabs in my HTML file: <!doctype html> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-...

memcpy fail and crash the program

I've coded this to execute a program througt his hexadecimal code in a main program, bug the problem is that the memcpy function bug and the program crash just after the printf function: int main() { ...

UnitySendMessage is not working when App is in Background

I'm working on Unity for iOS application which works in background. When applicationDidEnterBackground is called I need to call UnitySendMessage to change scene to empty (for taking less memory). But ...

Scrapy: how to check if a previously scraped page has been deleted?

I made a simple Scrapy crawler that fetches ads for house prices in my city. It collects the following data: AD TITLE, PRICE and URL. Then outputs a CSV file. Each week I run the crawler, and I ...

variation of objects falling with different properties

I'm a beginner to programming, and i'm creating a simple 2 player game where players move left and right on the bottom of the screen and collect falling objects - objects which will have different ...

How to do unit test on a method that has StreamReader and Database access

I have never do unit test before. This time I like to learn how to do it. I like to use Visual Studio unit test and moq. My project is transfer data from interbase to sql server. Firstly, I extract ...

mysql - how to merge two tables based on a column?

I have two tables, table1 and table2 table1 id | val | a | | a | | b | | b | | table2 id | val | a | 2 | ...

Use a script within a For Loop in batch

Is there a way within Batch that I can use a Visual Basic Script in place of the file/string field? Specifically I'm attempting to get something like the below to work so I can automatically store the ...

Payment gateway change method after duration

I'm using eCommerce. Once done payment it should be captured & after few days it should be processed or deducted from customers account. Example: If the customer pays using Paypal initial it ...

how to pull out numbers with E notation from a String

I have two Strings strg ="2.0^3.0+1.23454E10" and strg ="-1.2345E10+2.3-4.0" In the first String im trying to pullout the last Number regardless if it's in E notation or not. in the second String im ...

Xamarin.GooglePlayServices.Maps 42.1001.0 SupportMapFragment java.lang.NoClassDefFoundError

I recently updated my Xamarin.Android app to Google Play Services v42.1001.0. Without any other code changes, I noticed that when creating a SupportMapFragment, the output throws the following errors: ...

JS Ajax OnClick: How to execute php code multiple times?

I have an html button with an onclick attribute(or property?) which runs a JQuery ajax function pointing to php code. The php code writes HTML in an output HTML <select> element(the element ...

spark sql no parse rules error

when I run some query by spark sql(hivecontext) it complains like below. which syntax will cause this? I am using spark 1.6 and hive 1.2 I have no idea at all. It looks like your post is mostly ...

Passing dtype object for all column to pandas dataframe cause it is loading Nan in hive table

after searching through many answers , I came to ask for help. Thank you in advance. Can you please help understand why is it creating Empty df in the first place. It might sound strange but I was ...

Inconsistency in SpriteKit API SKWarpGeometryGrid

let sourcePositions: [vector_float2] = [ vector_float2(0, 1), vector_float2(0.5, 1), vector_float2(1, 1), vector_float2(0, 0.5), vector_float2(0.5, 0.5), vector_float2(1, 0.5), ...

How can I highlight text from listview using Textwatcher?

I have created a Textwatcher where the user can search for items from a textfile. The items are splitted and in a listview. It works fine, but I want to highlight the text, that the user is searching ...

how to check if dll is using full framework or .net core using .net decompiler

has anyone faced .net core versioning hell. We are facing this daily in our project. my questions as below a. understanding project.json itself looks like a big project. is there good link ...

ArrayList for Files in Folder Android Internal Storage /storage/emulated/0/

I want to click a button in my activity and open a separate activity that displays an arraylist of a folder that I want to access. So the code to get to the next activity is simple (start the new ...

Inflating a PreferenceScreen programmatically

I'd like to add a dynamic amount of PreferenceScreens to an existing PreferenceCategory. These PreferenceScreens are fairly complex so I'd like to avoid having to entirely create them ...

Dagger Switch Out Modules

My understanding of dependency injection is it quickly allows someone to switch out implementations or use test implementations. I'm trying to understand how you're expected to do it in dagger. For me ...

Creating % based alerts with elastalert

Currently with rule type Frequency(or any other), we can configure count based alerts. ex. if Error=404, occurs more than 5 times in last 1 hour. But I want to configure % based alerts and not count ...

Save a ggplot2 object as ggplotly and save to disk in Linux

Trying to make my first step with plotly in R. I want to convert my ggplot2 object to a ggplotly object and then save it as html on a Linux platform. I thought this would do (from plotly's manual): ...

Make date time object TZ aware

I have a string: 2017-02-21 12:43:47 I convert to datetime object: login = datetime.strptime(logins[0], '%Y-%m-%d %H:%M:%S') I have a TZ: LA = pytz.timezone("America/Los_Angeles") But I don't ...

Fetch Azure sync table on new device

I have an Azure app service setup for SyncTables. On my development machine, I can save items and they sync to the cloud, no problem. However, I am having a hard time getting the data to a new device. ...

Build libraries in external folder of AOSP source code

I noticed that a simple $ . build/envsetup.sh $ lunch $ aosp_hammerhead-eng $ make -j16 Would not build also the external libraries in the ./external folder. How am I supposed to build source code ...

Can two interfaces mutually extend each other?

I know interfaces can extend one another, if I have these two interfaces - public interface Drawable {} and public interface Dragable {}, Is it a good practice to extends them from each other? My ...

Modally presented view causes previous view to disappear when navigating away/to with tab bar view controller

I'm working on UITabBarController based app. The app has a concept of "user authentication/restriction" where particular tabs may become restricted/unrestricted at any point in time (via an admin). ...

How do you install RDieHarder on R?

This is the error I got when install the RDieHarder package. "Installing package into ‘C:/Users/pc/Documents/R/win-library/3.3’ (as ‘lib’ is unspecified) Package which is only available in source form,...

How can I turn right click off and on using functions in JS?

I have disabled right click in my application using the following: <body oncontextmenu="return false;"> I have a textarea element which has spellcheck enabled. I want to be able to right-...

GPU trained model's keys not found on cpu

Im finding that when I try and run a model that I have trained on a gpu now on a tensorflow cpu only docker image, Im getting the following error Here is my code for saving my model: def fit(self, ...

I have a few questions about foldleft in ATS

I have an assignment that I have to do for school which involves using foldleft to find the length of a list. My question lies in the implementation of foldleft. We were given some example code that ...

Trying to set a pointer to a struct

I have a function called SemCreate that takes a name an int and a pointer as parameters. I want the pointer to point to a new struct and I want to return an int, 0 if it went okay. int P1_SemCreate(...

sandbox error credentialas?

I am new to paypal and use sanbox. I'm trying to implement the paypal payment platform on an online sales page and I get an error; When creating an app in developer paypal (generates my client id and ...

Is there a better way to get a data row by OledbDataReader?

I'm trying to find a way that get one data row(selected by SQL SELECT,only one row in the result) from Access file,and insert it to the top of another dataset. I tried filling the data into a new ...

How does one calculate LD50 from a glmer?

I am analyzing a data set where ~10 individuals are exposed to a set treatment (Time) and mortality is recorded (Alive, Dead). glmer was used to model the data because Treatments were blocked (Trial). ...

Apache htdocs access restricted

I'm running an Apache web server 2.2 inside a Windows 10 VM. Whenever I try to edit the index.html file in the htdocs directory, I get an error that prevents me from saving any new documents to the ...

why this code is not working ? :( [python]

could you tell me why this code not working? !/usr/bin/python class InputData(object): def read(self): raise NotImplementedError class PathInputData(InputData): def __init__(self, ...

Object reference is not set to an instance Access query C#

I'm trying to make a query into the Clients table, when the user enters a mobile number, the code checks if it matches any record, if it does, it returns the client's Name & Address into text ...

How to traverse one level up in a binary search tree?

I have a program in which I'm recursively traversing through a binary search tree. But, once I get to a particular node, I want to go to its parent and insert a node between the two. So how would I ...

Bash function with an array input and output

If I define an array in bash shell: a=() a+=("A") a+=("B") a+=("C") I can interact with it as expected: echo "${a[0]}" # Returns "A" echo "${a[1]}" # Returns "B" But when I run that same array ...

Write a weekly payroll program in C++

Write a complete C++ program , including comments , to do the following: The program will compute a weekly payroll. It will read in information for each of the employees of a ...

Using Match in Jquery return just one value

I'm trying to use "Match" to filter some values in my textbox but my code only works for the first line, returning just "one.png;1". I need to get all values in "text2" div, like: "one.png;1 / two....

Deleting folder only if it does not contain any files

Is there a way to delete a folder in python if it does not contain any files? I can do the foll: os.rmdir() will remove an empty directory. shutil.rmtree() will delete a directory and all its ...

NUnit, can “setup” run before “ValueSource”?

I have the following basic setup for a uni-test: it tests a class that is responsible for indexing files in a directory, and keep giving the correct one on demand. To do this I use a mock file system ...

why i cant run the source code on xampp? for other source code it run very well

its come out like this and this too I used xampp platform to run the website on my local host previously, and it was run smoothly without any doubt, but this is my source code from my internship ...

React Native Android: allow to invoke callback multiple times

I would like to know how to allow a callback to be invoked multiple times in React Native Android app. My Android native module saves callback using com.facebook.react.bridge.Callback and ...

Cannot apply indexing with [] to an expression of typ 'object' c# mysql

Someone teach me how to iterate through the rows of the database, he gave me some example code, but i encounter this problem. Cannot apply indexing with [] to an expression of type 'object'. What does ...

Big O - Don't understand time complexity for these algorithms?

I am learning how to do time complexity in school and the professor uploaded some examples. For the first example below, the answer is supposed to be O(n^3) but I do not understand how. public ...

How can a user log in a user right after signing up?

I know I should put the code in the create action of the users controller, but I'm not sure what code. this is my controller code: # frozen_string_literal: true class UsersController < ...

How to wrap lines on TextView in RelativeLayout?

I have a Relative Layout with 2 columns, and several rows of TextViews. I display a series of long strings in the 2nd column. On high dpi devices, I don't have issues, but on lower dpi devices, the ...
15 30 50 per page
Translating... 0%