Newest Questions

Q&A for professional and enthusiast programmers

python dynamic import for test scripts execution using eval

I am working on a framework that basically tries to run test scripts from a package containing all the scripts. on my execution driver file: currently what i am doing is, from testscripts import ...

export default react without mention redundant class

const Dashboard = class Dashboard extends Component { } export default Dashboard My code above is working but I feel guity mention 'Dashboard' for 3 times just to export one function. Is there ...

R dataframe apply passing row with header

I have a dataframe df. I want to apply a function myfun to every row of it. But I would ideally like to use the header names of the dataframe in the function myfun. Wondering if this can be done ...

CSS : Rotate an element without rotating it's inner content - Single Element

I am trying to build the flag of Bosnia and Herzegovina which looks like this. http://flags.fmcdn.net/data/flags/normal/ba.png I am trying to achieve how the stars are lined up. They are laid on a ...

fetching data from core data sometimes takes time

I'm fetching data from core data and storing in an array after that I'm reloading the tableview... _dataArray = apiObject.fetchedArray; [self.tableView reloadData]; Its working fine but sometimes ...

Getting no data from SQL in PHP for android parsing

I want so select SQL in PHP to parse the given data in Android Studio. The problem is that my php page return nothing. No error and no result. I'm absolutely stumped for a solution. Can you take a ...

How to trigger the onclick / onchange event for a already selected option clicks in javascript

I am trying to get option value of an already selected option in the select choice list. How can I make it possible. Here is my code snippet HTML <select id="getCusineType" onchange="...

How to store current system date in structure?

My program to find current system date and time is #include<stdio.h> #include<time.h> struct date{ int day,month,year; }; main() { time_t t; time(&t); printf("Today's ...

Laravel 5.3 doesn't trigger mutator

I'm having problem on this Laravel 5.3 Mutator. I can create the product without problems but during update, it doesn't trigger. My Product Model class Product extends Model { public function ...

Get Uploaded file progress on time using node module

I am trying to get the remaining time of the upload progress on time.In order to do that ,I need the file size get uploaded on time. We already started using request node-module to handle REST api ...

Windows cmd shell: if-then-else weirdness for block statements

Trying to setup a simple build script that will expand the path based on other environment variables. This little script works fine: echo off call c:\vstudio\vc\bin\vcvars32.bat set _ISGIT=1 echo ...

What's the recommended go mysql driver for selecting millions of rows?

everyone. I'm looking for a go mysql driver for selecting millions of rows. As I can't store all the rows in memory, I hope to get rows group by group, like fetchmany in python. Mymysql and go-mysql-...

in python, what is the preferred method to check if variables are not None?

If I have a construct like this: def foo(): a=None b=None c=None #...loop over a config file or command line options... if a is not None and b is not None and c is not None: ...

What are the differences between weak and strong in Swift 3

While reading the Swift Programming Guide, I am quite struggle with the idea of strong and weak references. What are the differences between these two references in Swift 3? and how to understand ...

remove double spaces, new line and break in php

I have a stream of characters, a sentence or a paragraph, which may have extra spaces in two words or even tabs or line feeds, how can I remove all these and substitute them by a single whitespace ...

Pass ListView in AsyncTask

I'm fetching contacts from database using AsyncTask. And want to show it in listview. But I'm facing a problem. Here is a code. public class BackgroundWorker extends AsyncTask<String,Void,String&...

vuejs - Caching searchresults of table based on multiple filters

I'm using vuejs for this project, but this problem is not necessarily connected - but if there is a vue-way, I would prefer that. I'm building a table, that enables the user to have per-column-...

Adding a composite foreign key to an existing sql table

I have the following tables: create table x (a int primary); create table y (b int primary); create table z (c int, d int, e int); I am (later on purpose) adding a composite foreign key to z: alter ...

Convert base64 string into byte array through javascript

I want to convert "base64" string into bytes array through the javascript. I received string from the URL like. ("data:image/jpeg;base64,/9j/4QN6RXhpZgAASUkqAAgAAAAIA) And i want to convert the ...

python 2.7 : Python logging is not creating log file or storing any logs into it

I am trying to learn logging in python and was trying to run the basic program provided by the Python 2.7 Documentation. But the python logger is not even creating the file. So i created the file ...

Remove all the leading zero from the number part of a string

I am trying to remove all the leading zero from the number part of a string. I have came up with this code (below). From the given example it worked. But when I add a '0' in the begining it will not ...

Is it possible to cache filter with script execution in elasticsearch?

I have such query with a script: GET index/_search?size=0 { "query": { "bool": { "filter": { "script": { "script": { "inline": "script_name", "...

Does ng-src also add src attribute to image tag?

I had an angular code for an image like <img class="testClass" ng-src="{{ImagePath}}" alt="{{imageName}}" /> However when after the page loads, I see an src attribute to the img tag as shown ...

Python, how to write space to file?

The 4th line of the source file just contains 4 spaces, and after reading the file and write the data to disk, the 4th line doesn't contains spaces. And my code is: data = [] with open('file_src.py', ...

Edit form field labels in angular 2

I have a built a model-driven (reactive) form, as shown here, in Angular 2. My html looks like this: <form [formGroup]="userForm" (ngSubmit)="onSubmit(userForm.value, userForm.valid)"> <...

Why not report compile error after method has changed to property(update maven dependency version)?

I import spring-data-mongodb-1.1.2.RELEASE in my project: <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> <...

How to assign importance levels to ints?

I'm having to make a program that allows a gerbil to go mining for four metals and the four metals have different levels of value. The gerbil can only carry 10 ounces at a time. The gerbil will ...

Making responsive multiple divs

I have page where I show 4 images - 2 by 2 on each row. I'm trying now to make them responsive when page is open on mobile device but I can't figured it out how to make this. So I have this html <...

document.getElementbyID returns NULL for the DIV with in iFrame

I have a JSP page which loads a static HTML page using iFrame. Now i am trying to change the alignment of one of the DIV (which is there in static HTML page) using the jQuery dynamically. But its not ...

how to use .CRX file to another extension

I built one chrome extension but i want add one more feature to my extension,that feature already available in the chrome web store.how to add that extension to my code

Assign the size and elements of multi dimensional string array dynamically

i know this is a silly question but i'm not able to achieve it, because of that only i'm posting it here i'm trying to achieve the dynamic grid view with titles/suppuration, for this i got the ...

Binding a checker in SystemVerilog

I would like to bind a checker construct to a VHDL module (in QuestaSim) to ensure some verification properties, without having to declare and bind a more (complex) module/interface/agent structure. ...

Javascript cookie is not creating

I am trying to create a cookie when a button is clicked.But it is not being created.I have also tried with jquery cookie plugin but no luck.Here is my code: <button id="test" >Test</button&...

Is the Delphi IDE hijacking my system?

The has happened many times - Sometimes when installing a new software on my Window 7 system while the Delphi XE4 IDE is running, the following error message would keep popping up - over 40 times in ...

How to place controller in multilevel subfolder in CakePhp3?

I would like to place some of my controller classes in a subfolder (src/Controller/dev/v2/) and want to access using url: app/v2/api/Controller/Action. Does anyone know how this can be reached in ...

Which (if any) NDK libraries/headers are compatible with binaries using other toolchains

I'm working on a project that is compiled using the arm-linux-muslabi toolchain. What are my options to use NDK features such as jni.h? Am I wrong when assuming that jni.h on android NDK is not the ...

How to find currently running applications in android when > LILLIPOP?

My app has to get the information about the applications currently running on foreground. I tried get all running proccess: ActivityManager activityManager = (ActivityManager) K2Application....

double file uload in sessoin when using multiple file upload in jqury ajax in asp mvc

i use this code for multiple upload with jquery ajax in asp mvc : public ActionResult GetFiles(HttpPostedFileBase NewsFilePath) { if (NewsFilePath != null) { var ...

anttask using update command

what wrong with my update ? <svn refid="svn.settings" logFile="D:\Copyof\anttt\R\log1.log"> <checkout url="${svn.url}" destpath="D:\Copyof\anttt\R\OXS" revision="HEAD" depth="...

Generate ngrams with Julia

To generate word bigrams in Julia, I could simply zip through the original list and a list that drops the first element, e.g.: julia> s = split("the lazy fox jumps over the brown dog") 8-element ...

Spring Boot with Thymeleaf Failing

I am developing an application with spring boot but its failing with Thymeleaf configuration - [THYMELEAF][http-nio-8080-exec-4] Exception processing template "Works still fails!!!": Error ...

Java Californium CoAP Server

I am using Californium Library for my CoAP Server. I have no difficulties using it. However, I was wondering if there is a way to set my resource as "root resource". It seems that some sites have ...

D3 exit(), remove() not working when the element is removed and added

I have a histogram that dynamically updates based on the input (country on map is clicked). The each bar has a mouseover info display. While all the bars are update correctly at least visually, the ...

Jhipster4: what are the benefits of using DTO

Jhipster4 adds Data Transfer Objects (DTO) just what is the benefit of using DTO objects?

Android: Updating Gauge Chart onLocationChanged

Problem: Create a Gauge meter that would display the location accuracy of the device but the challenge here is it operates like a speedometer the data is then changed onLocationChanged Tools used: ...

Translate VBA to GAS

does anybody know how to do this (Problem #5) in Google Appscript? Im collecting data over several days and writing it into a spreadsheet but iam struggeling to sort this in the right way (like in ...

What does “$1<span>$2</span>$3” means?

What does "$1<span>$2</span>$3" means in javascript???

Progress in xhr request and the file size

How can I add the filesize of the file to the xhr request? Im trying this method but when I upload it it always go 0%.. is it because of the (percentComplete / sizefile * 100);? for (var i = 0, f; ...

How to give action to a single floating button of three normal buttons in tabs in android

Can anyone help me that how to give action to floating button of various buttons. I have 3 buttons in my tabbed activity in different tabs. And i wanna give that 3 buttons actions to single floating ...

How can I translate the private IP address of default gateway to public IP address in C#

I wanna use the external IP address of gateway to recognize specific organization or group of machines because I think the gateway can be used as identifier of network address group. Obviously I can ...
15 30 50 per page
Translating... 0%