Newest Questions

Q&A for professional and enthusiast programmers

Plotting a set of data with two columns in python

I have been given a .dat file that contains two columns with numbers in each column. The x values are the values in the first column and the y values are the values in the second column. I am having ...

how to 'reset' cin so cin.good() evaluates true until I 'break' it again

I'm reading from a file via cin from a terminal until finishes(./proj < file.txt). afterwards I'd like to 'reset' it so I do something like while(cin >> word). I've read that cin.clear() does ...

Embedded Youtube video Full Screen Works with Firefox But Not Chrome

So I have a problem with using an embedded youtube video. Here is my iframe code <iframe width="560" height="370" src="https://www.youtube.com/embed/PrTXCPex_3o" allowfullscreen="allowfullscreen" ...

How to finally stop a service from a bat file that started first another service in Windows?

I'm doing an experiment creating a service that loads another service. I created a bat file, here is the code (I'm using Tomcat as the second service): rem MyTomcat7Service Service if exist C:\...

What's the correct way to use multprocessing signal and events together?

Specifically, why doesn't this exit when I press CTRL+C? from multiprocessing import Event from signal import signal, SIGINT e = Event() signal(SIGINT, lambda s, f: e.set()) print('waiting') e.wait(...

Show a modal by clicking a custom link inside the tinymce editor

I am try to pop up a bootstrap modal clicking a custom link inside the tinymce editor. custom link insert and event binding done like this. var contentURL = '<a class="lesson-content" href ="'+...

How do I get the sum of a column in sqlite database & display it in TextView

I am developing a Billing App. My columns are _id, itemname, qty, rate & price. I am able to display them using SimpleCursorAdapter. I want to display the sum of values in price column in TextView....

page not redirecting in PHP

I wrote this code in DreamWeaver to redirect after using the right login credentials, but it's not working ` // *** Redirect if username exists $MM_flag="MM_insert"; if (isset($_POST[$MM_flag])...

PyCuda: Calculating Indexing for Device Memory (1D blocks in 1D grid)

I'll be specific as one of my other posts did not follow the question guidelines (I'm new here). In constructing a moving average filter using PyCuda, I am using device memory to take in millions of ...

Updating PHP Code without Connecting via web

I'm creating a statistics page which shows the daily user count of my website however I've ran into an issue. I'd like to update a PHP array every ~10 minutes with a new user count number. My ...

Pandas to_sql using chunksize with MemoryError

I have a pandas dataframe df with more than 2,000,000 rows. I am using to_sql with a chunksize parameter to write data into MSsql. But even I set chunksize less than 100, it still calls MemoryError. ...

Android: in RecyclerView Adapter how do I test if an entry from SQLite database isNull?

I have a RecyclerView list of CardViews. The CardViews show user entered data that is stored in a SQLite database. One of the data fields from the database is a DueDate thtat stores a date from a ...

preg_match_all, search to first match, then echo each

i want to get all html classes that are vip, and print each vip result $html = "<span><div class=apples> text </div> <div class=vip> text2 </div> <div class=vip&...

Raspberry Pi: Playing multiple video files in mkfifo pipe

I have 2 files, test.mp4 and test2.mp4 that I want to play concurrently with no noticeable break in the middle. Currently I'm using mkfifo test cat test.mp4 > test & cat test2.mp4 > test &...

PostgreSQL: If Else Statement for Insert, Delete and Update in One Function

How I can convert this SP/Function from MySQL to PostgreSQL? DELIMITER $$ CREATE DEFINER=`user_name`@`%` PROCEDURE `sp_TABLE_name`( pTransType int, pId bigint, pName varchar(250), pStartFrom ...

Autoplay Youtube video in modal? (Avada Wordpress theme)

Hello again SO community! I have a Wordpress site using the Avada theme which comes with an out-of-the-box modal element within its native "Fusion Builder" page builder. I have embedded a YouTube ...

Visual Studio Code set up for Python

I have installed VS core on my Windows 7 machine. When i try to run a really simple python code, it gives the attached error. enter image description here Please advise on how to resolve this issue. ...

How to test JavaFX (MVC) Controller Logic?

How do we properly write unit/integration tests for the JavaFX Controller logic? Assuming the Controller class I'm testing is named LoadController, and it's unit test class is LoadControllerTest, my ...

C# - create function like ToString()

I want to create function, the function name is extend() ,it should after the string,bool,control.like default function ToString() "123".extend(); false.extend(); textbox1.extend(); extend(); How ...

Error in training CNN for binary classification

Hello Just to get familiar with the CNN I have prepared the code for the binary classification Aircraft (760 images) or non-aircraft (750). Here is my MATLAB Code Npos = numel(possitive_regions); ...

How can I change parts of my website using a template?

Please excuse the simplicity of the question, but I'm simple and sometimes get confused with the basics. The following is my web site:- It is a personal hobby site. As the visitor goes happily ...

Android: Consume touch event set false don't work when view add on window manager

I am try to add an moving image over all activity even home page. So I use window manager to achieve this. I need this image is partially touchable. But no matter if I set return true or false at ...

Ignore empty cells with phpexcel

i'm really new with PHPExcel library,and i'm new with this kind of programming. So my problem is i just wanna read a cells with a value in it, and ignore all the empty cell below my tables. can i do ...

Which C++ vector push_back is called for objects created inside a loop

This is a very basic question, but I cannot seem to get my head around the logic of what is going on here. Consider the code snippet: class Board{ private: vector< vector<Cell> > ...

basic redis example about teamDev redis client interface

as we know teamDev.redis is only library that works with unity and .net2 I could not find a usefull tutorial or documentation to how to work with it. I can now connect and write to it but cant find ...

Populating rails form with AJAX using checkbox

I am pretty new to ruby on rails and I am having a hard time integrating an AJAX call to populate my form. I do not know if I formatted this correctly and what I should be using to fill in my jSON ...

(Excel - advanced) How to pull unique values from list using range of criteria (array formula)

{=IFERROR(INDEX('Quarterly Changes Summary'!$F$3:$F$1428, MATCH(1, INDEX(('Quarterly Changes Summary'!$A$3:$A$1428=$B$5)*MATCH(0,COUNTIF($E$4:$E7,'Quarterly Changes Summary'!$F$3:$F$1428),0),),0),),"")...

Oracle every two records into one

Hello I have been trying to accomplish the following: key1, key2, val1, userid, receipttype, val2,val3,val4,date,val5 1 0 0 1 3 0 0 0 18-JAN-17 1 1 0 0 1 4 0 0 0 18-...

Tensorflow feed_dict key cannot be interpreted as Tensor

I just starts to learn Tensorflow in python. I got the following error when I starts with a simple AddTwo class. the error messages are "Cannot interpret feed_dict key as Tensor: Tensor Tensor("...

php asort not working for text string array

I have an array print_r($RL_all_years_unique_0); Gives: Array ( [0] => kWh Electricity [1] => Kg Refrigerants [2] => Gallons Diesel [3] => Indirect VMT [4] => Short Tons Solid Waste [...

.httaccess remove codeigniter url parameter can't working

I want to try remove url parameter but my setting not any work . RewriteEngine On RewriteBase / RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|assets|robots\.txt|$) ...

How solve the HSyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

I am using ajax in my symfony application to save data from the database without updating the screen. But I have found the following error: SyntaxError: JSON.parse: unexpected character at line 1 ...

Troubleshooting 401.2 Unauthorized on IIS client certificate authentication

I have configured IIS to use my self-signed cert to use client certificate authentication. I followed the steps in the link below and disabled all other authentication type (e.g. annoymous). I'm ...

How come I can't get audio in Chromium for WebVR?

I'm using Chromium for my Vive but don't get audio. Console says: Uncaught (in promise) DOMException: Unable to decode audio data. Anyone had this issue already?

Android Add View adds only first custom view for arc

I'm trying to draw a pie chart with each arc as separate custom object. But only first slice of the arc is shown. LinearLayout does have Vertical orientation as it has been suggested in other posts. ...

Fhir server conformance check

How to receive serverValiation value? FhirContext ctx = FhirContext.forDstu2(); ctx.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER); String serverBase = "http://...

Magento Website Crawl Issue - A description for this result is not available because of this site's robots.txt

I am working on this site and some how (I don't know why) Google stop crawling Home page URL (http://www.indusuno.com/), while checking this site in Google It shows (A description for this result is ...

Generate a new header for each group in RDLC

I have a problem when trying to display the result by group. I can display all the data but I don't know about where to start and how to do this if I want to do this in groups.. Here's the screenshot ...

Android 5.0 How Double Tap on Screen to Wake works?

I believed there is something transparent activity on homescreen listening the touch event when the phone is asleep. Application description: The application is used for personal safety App purpose, ...

Franz LISP to Common LISP conversion 2 - macros which generate macros

I'm reviving an old LISP program from the early 1980s. (It's the Nelson-Oppen simplifier, an early proof system. This version was part of the Ford Pascal-F Verifier, and was running in Franz LISP in ...

File Signature not Found

I am working on creating a SED plot from an rtout.sed file that has been created. The code I am using to create this plot is as follows: import matplotlib matplotlib.use('Agg') import numpy as np ...

file STRINGS file “/opt/intel/mkl/include/mkl_version.h” cannot be read

For Python 3.4.3, Ubuntu 14.04, CUDA 8 and latest version of OpenCV download from opencv website and the following command: (cv2) mona@pascal:~/computer_vision/opencv-3.2.0/build$ cmake -D ...

Kafka Producer Consumer API Issue

I am using Kafka v0.10.0.0 and created Producer & Consumer Java code. But code is stuck on producer.send without any exception in logs. Can anyone please help. Thank in advance. I am using/...

Import statement withing a function, wishful thinking? [duplicate]

Hi there I was wondering if it's possible to do imports inside a for loop. When trying to execute this code: const fs = require('fs'); function importFiles(x) { fs.readdir(x, (err, files) => { ...

PHP - Convert JPG to a Progressive JPG

Just like the title says, I'm trying to re-save an already created jpg as a progressive jpg. Basically, on the front end I have some JS that crops an image, and outputs a base64 image jpg. Once it is ...

Functional Programming List vs. ArrayList, Vector, etc

Hello experienced Java users, First of all, I apologize if the question is unclear or imprecise... I am not sure how else to phrase it. Hopefully, you will understand more as you go through the code ...

SQL to delete pairs if one row is older than a certain timestamp

I have a table with two columns: match_id varchar2(30) timestamp match_id is in format of integer.[A|B], such as 1234.A, 1234.B, 1235.A or 1235.B. rows with match_id on same integer is called a pair,...

Resize a parent and child window at the same time

I have two windows, a Parent window, and a Child window. The parent is a PROPSHEET_CONTAINTER and the child is a PROPPAGE_ITEM_IN_CONTAINER. I have a check box that when called does this: void ...

Show/Hide elements on a single page using <a> or <span>

I am showing or hiding divs elements on a single page using jQuery depending on what is clicked: HTML: <div id='aboutPage' class='visible'> //content </div> <div id='contactPage' ...

How to get a combination of multiple lists with the order preserved in python? [duplicate]

For example, if I have: alist=[['a','b'],['c','d'],['e','f']] I would like to get combinations of the lists within alist in such a way: ('a','c','e') ('a','c','f') ('b','d','e') and etc. where the ...
15 30 50 per page
Translating... 0%