Questions Tagged with #Devel cover

Devel::Cover - Code coverage metrics for Perl

Array and string offset access syntax with curly braces is deprecated

I've just updated my php version to 7.4, and i noticed this error pops up: Array and string offset access syntax with curly braces is deprecated here is part of my code which is triggering the above..

Android Layout Animations from bottom to top and top to bottom on ImageView click

I have created a view in Android and I need to animate it from bottom to top and vice-versa. when I clicked on ImageView I need to animate the complete RelativeLayout from bottom to top and it is succ..

Simple java program of pyramid

I am a beginner in Java programing and I want to print a pyramid ,but due to mistake in coding I am not getting favorable output. class p1 { public static void main(String agrs[]) { Syste..

Googlemaps API Key for Localhost

How do I get googlemaps api key to work on localhost? I've created an API key and under referers I add the following: Accept requests from these HTTP referrers (websites) (Optional) Use asterisks f..

import error: 'No module named' *does* exist

I am getting this stack trace when I start pyramid pserve: % python $(which pserve) ../etc/development.ini Traceback (most recent call last): File "/home/hughdbrown/.local/bin/pserve", line 9, in &..

How to put two divs on the same line with CSS in simple_form in rails?

Putting two divs on the same line is an old question. But I can't find a solution when working with simple_form in rails. What I want to do is to display content and its label on the same line. The wi..

jQuery get an element by its data-id

Similar to this question here, I'm looking to get an element based on it's data-id. <a href="#" class="whatever" data-item-id="stand-out">...</a> I'm looking to take action on the a tag..

How to preSelect an html dropdown list with php?

I am trying to get the option selected using PHP, but I ran out of ideas! Below is the code I have tried until now: <select> <option value="1">Yes</options> <option value="2"&g..

Swift Modal View Controller with transparent background

I know this topic is quite popular, but I'm a little iniciate problem in a programming language, the fact is that I still do not understand where I put the code. Well, I'll tell the whole case: I'm..

How to split data into trainset and testset randomly?

I have a large dataset and want to split it into training(50%) and testing set(50%). Say I have 100 examples stored the input file, each line contains one example. I need to choose 50 lines as train..

C# - How to add an Excel Worksheet programmatically - Office XP / 2003

I am just starting to fiddle with Excel via C# to be able to automate the creation, and addition to an Excel file. I can open the file and update its data and move through the existing worksheets. My..

Pass Multiple Parameters to jQuery ajax call

I have the following jquery code to call a webmethod in an aspx page $.ajax({ type: "POST", url: "popup.aspx/GetJewellerAssets", contentType: "application/json; charset=utf-8", data: ..

Why do I always get the same sequence of random numbers with rand()?

This is the first time I'm trying random numbers with C (I miss C#). Here is my code: int i, j = 0; for(i = 0; i <= 10; i++) { j = rand(); printf("j = %d\n", j); } with this code, I get ..

Pandas timeseries plot setting x-axis major and minor ticks and labels

I want to be able to set the major and minor xticks and their labels for a time series graph plotted from a Pandas time series object. The Pandas 0.9 "what's new" page says: "you can either us..

How to programmatically modify WCF app.config endpoint address setting?

I'd like to programmatically modify my app.config file to set which service file endpoint should be used. What is the best way to do this at runtime? For reference: <endpoint address="http://myd..

JSLint says "missing radix parameter"

I ran JSLint on this JavaScript code and it said: Problem at line 32 character 30: Missing radix parameter. This is the code in question: imageIndex = parseInt(id.substring(id.length - 1))-1;..

Writing a string to a cell in excel

I am trying to write a value to the "A1" cell, but am getting the following error: Application-defined or object-defined error '1004' I have tried many solutions on the net, but none are workin..

How do you declare an interface in C++?

How do I setup a class that represents an interface? Is this just an abstract base class?..

How do you push just a single Git branch (and no other branches)?

I am working on a local git repository. There are two branches, master and feature_x. I want to push feature_x to the remote repo, but I do not want to push the changes on the master branch. Will a ..

How to convert .pfx file to keystore with private key?

I need to sign Android application (.apk). I have .pfx file. I converted it to .cer file via Internet Explorer and then converted .cer to .keystore using keytool. Then I've tried to sign .apk with jar..

Creating a BAT file for python script

How can I create a simple BAT file that will run my python script located at C:\

What is the difference between a function expression vs declaration in JavaScript?

What is the difference between the following lines of code? //Function declaration function foo() { return 5; } //Anonymous function expression var foo = function() { return 5; } //Named function e..

How to import existing Git repository into another?

I have a Git repository in a folder called XXX, and I have second Git repository called YYY. I want to import the XXX repository into the YYY repository as a subdirectory named ZZZ and add all XXX's ..

How do I align a label and a textarea?

My code ends up like: XXXXX XXXXX Description: XXXXX I want: XXXXX Description: XXXXX XXXXX "Description" sometimes spans multiple lines. Cod..

How to use onSavedInstanceState example please

I'm confused when it comes down to saving a state. So I know that onSaveInstanceState(Bundle) is called when the activity is about to be destroyed. But how do you store your information in it and brin..

How to make a programme continue to run after log out from ssh?

Possible Duplicate: Prevent a background process from being stopped after closing SSH client I have a program that takes a lot of time to finish. It is running as root over ssh. I want it t..

How to set the locale inside a Debian/Ubuntu Docker container?

I'm running a Ubuntu Docker container. I have a Norwegian keyboard and need to use Norwegian characters (øæå). My Terminal character encoding is set to UTF-8 and I'm connected to my container usin..

How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

I'm starting with the new Google service for the notifications, Firebase Cloud Messaging. Thanks to this code I was able to send ..

Determine .NET Framework version for dll

I have an old dll that was compiled against the .NET framework and deployed. I am not sure which version of the .NET framework it was compiled against. I am wondering how I can determine which versi..

How to convert index of a pandas dataframe into a column?

This seems rather obvious, but I can't seem to figure out how to convert an index of data frame to a column? For example: df= gi ptt_loc 0 384444683 593 1 384444684 594..

How to make HTML Text unselectable

I would like to add text to my webpage as a label and make it unselectable. In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. A ..

React Error: Target Container is not a DOM Element

I just got started using React so this is probably a very simple mistake, but here we go. My html code is very simple: <!-- base.html --> <html> <head> <title>Note Cards..

Clang vs GCC for my Linux Development project

I'm in college, and for a project we're using C. We've explored GCC and Clang, and Clang appears to be much more user friendly than GCC. As a result, I'm wondering what the advantages or disadvantage..

How to change active class while click to another link in bootstrap use jquery?

I have a html as sidebar, and use Bootstrap. <ul class="nav nav-list"> <li class="active"><a href="/">Link 1</a></li> <li><a href="/link2">Link 2<..

Is there any advantage of using map over unordered_map in case of trivial keys?

A recent talk about unordered_map in C++ made me realize that I should use unordered_map for most cases where I used map before, because of the efficiency of lookup ( amortized O(1) vs. O(log n) ). Mo..

How to get the date from jQuery UI datepicker

I want to get the date from datepicker whenever user choose the date in jQuery UI datepicker and click the button on the form. well I need to get the day, month and year of the date they choose. How ..

Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly

I'm attempting to deploy my code to heroku with the following command line: git push heroku master but get the following error: Permission denied (publickey). fatal: The remote end hung up unexpec..

How to change the timeout on a .NET WebClient object

I am trying to download a client's data to my local machine (programatically) and their webserver is very, very slow which is causing a timeout in my WebClient object. Here is my code: WebClient web..

Bash command line and input limit

Is there some sort of character limit imposed in bash (or other shells) for how long an input can be? If so, what is that character limit? I.e. Is it possible to write a command in bash that is too l..

How can I introduce multiple conditions in LIKE operator?

I want to write an SQL statement like below: select * from tbl where col like ('ABC%','XYZ%','PQR%'); I know it can be done using OR. But I want to know is there any better solution...

Setting public class variables

How do I set a public variable. Is this correct?: class Testclass { public $testvar = "default value"; function dosomething() { echo $this->testvar; } } $Testclass = new Testclass();..

Tensorflow r1.0 : could not a find a version that satisfies the requirement tensorflow

I want to install Tensorflow 1.o for python on windows. This is information for my system. D:\>python --version Python 3.5.2 :: Anaconda 4.2.0 (32-bit) D:\>pip3 --version pip 9.0.1 from d:\we..

Proper MIME type for .woff2 fonts

Today I updated Font Awesome package to 4.3.0 and noticed that woff2 font was added. That file is linked in CSS so I need to configure nginx to serve woff2 files properly. Currently I have this block..

Getting the button into the top right corner inside the div box

I can't figure out how to get the [X] button into the top right corner of my custom css box. Here's the result so far: _x000D_ _x000D_ #wrapper {_x000D_ height: 100px;_x000D_ width: 500px;_x00..

How to automatically update an application without ClickOnce?

For the project I am working on, I am not allowed to use ClickOnce. My boss wants the program to look "real" (with an installer, etc). I have installed Visual Studio 2012 Professional, and have been ..

Catching access violation exceptions?

Example int *ptr; *ptr = 1000; can I catch memory access violation exception using standard C++ without using any microsoft specific...

How to find array / dictionary value using key?

I would like to find the value in an array using the key. Like this: $array=('us'=>'United', 'ca'=>'canada'); $key='ca'; How can I have the value 'canada'?..

How to set Google Chrome in WebDriver

I am trying to set Chrome as my browser for testing with Web-Driver and set the chromedriver.exe file properly but I am still getting the following error: org.openqa.selenium.WebDriverException: The..

LogisticRegression: Unknown label type: 'continuous' using sklearn in python

I have the following code to test some of most popular ML algorithms of sklearn python library: import numpy as np from sklearn import metrics, svm from sklearn.linear_model ..

Which selector do I need to select an option by its text?

I need to check if a <select> has an option whose text is equal to a specific value. For example, if there's an <option value="123">abc</option>, I would be looking for "abc". Is t..

Convert hex color value ( #ffffff ) to integer value

I am receiving hex color values from a server (in this form, #xxxxxx , example #000000 for black) How do I convert this to an integer value? I tried doing Integer.valueOf("0x" + passedColor.substri..

Combine Regexp?

After collecting user input for various conditions like Starts with : /(^@)/ Ends with : /(@$)/ Contains : /@/ Doesn't contains To make single regex if user enter multiple conditions, I combine th..

How can I delete an item from an array in VB.NET?

How can I delete an item from an array in VB.NET?..

Converting Java file:// URL to File(...) path, platform independent, including UNC paths

I am developing a platform independent application. I am receiving a file URL*. On windows these are: file:///Z:/folder%20to%20file/file.txt file://host/folder%20to%20file/file.txt (an UNC path) I..

How can I retrieve Id of inserted entity using Entity framework?

I have a problem with Entity Framework in ASP.NET. I want to get the Id value whenever I add an object to database. How can I do this? According to Entity Framework the solution is: using (var context..

Twitter Bootstrap 3: how to use media queries?

I'm using Bootstrap 3 to build a responsive layout where I want to adjust a few font sizes according to the screen size. How can I use media queries to make this kind of logic?..

Python socket receive - incoming packets always have a different size

I'm using the SocketServer module for a TCP server. I'm experiencing some issue here with the recv() function, because the incoming packets always have a different size, so if I specify recv(1024) (I ..

SSH Key: “Permissions 0644 for '' are too open.” on mac

I generate a ssh key pair on my mac and add the public key to my ubuntu server(in fact, it is a virtual machine on my mac),but when I try to login the ubuntu server,it says: @@@@@@@@@@@@@@@@@@@@@@@@@..

How do I check in python if an element of a list is empty?

I have a list like l = [] How do I check if l[i] is empty? l[i] = '' and l[i] = "" dont't work...

How to position one element relative to another with jQuery?

I have a hidden DIV which contains a toolbar-like menu. I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them. Is there a built-in function which will move t..

Get a list of all threads currently running in Java

Is there any way I can get a list of all running threads in the current JVM (including the threads not started by my class)? Is it also possible to get the Thread and Class objects of all threads in ..

Getting or changing CSS class property with Javascript using DOM style

My objective is to change the background color of a columns in a table without addressing each data entry individually by Id or Name. I know there are several ways to do this, and I've tried 3 to be e..

What does CultureInfo.InvariantCulture mean?

I have a string of text like so: var foo = "FooBar"; I want to declare a second string called bar and make this equal to first and fourth character of my first foo, so I do this like so: var bar =..

git checkout all the files

How can I get rid of all the changes in all the files of my repository? Say I am in a branch and I did some changes. git status returns a set of files in the "Changes not staged for commit" and I not..

Simplest way to throw an error/exception with a custom message in Swift 2?

I want to do something in Swift 2 that I'm used to doing in multiple other languages: throw a runtime exception with a custom message. For example (in Java): throw new RuntimeException("A custom me..

align textbox and text/labels in html?

I cant figure it out. How do i align the textbox? I thought using float: left on the labels on the left (then doing it on the input when i notice the input was now on the left without that) but that w..

When saving, how can you check if a field has changed?

In my model I have : class Alias(MyBaseModel): remote_image = models.URLField(max_length=500, null=True, help_text="A URL that is downloaded and cached for the image. Only used when the alias is..

Are PHP short tags acceptable to use?

Here's the information according to the official documentation: There are four different pairs of opening and closing tags which can be used in PHP. Two of those, <?php ?> and <scri..

Reading string by char till end of line C/C++

How to read a string one char at the time, and stop when you reach end of line? I'am using fgetc function to read from file and put chars to array (latter will change array to malloc), but can't figur..

Remove all multiple spaces in Javascript and replace with single space

How can I automatically replace all instances of multiple spaces, with a single space, in Javascript? I've tried chaining some s.replace but this doesn't seem optimal. I'm using jQuery as well, in c..

iOS - UIImageView - how to handle UIImage image orientation

Is it possible to setup UIImageView to handle image orientation? When I set the UIImageView to image with orientation RIGHT (it is photo from camera roll), the image is rotated to right, but I want to..

Numpy ValueError: setting an array element with a sequence. This message may appear without the existing of a sequence?

Why do I get this error message? ValueError: setting an array element with a sequence. Thank you Z=np.array([1.0,1.0,1.0,1.0]) def func(TempLake,Z): A=TempLake B=Z return A*B Nlayers=..

Android: How to enable/disable option menu item on button click?

I can easily do it when I am using onCreateOptionsMenu or onOptionsItemSelected methods. But I have a button somewhere in screen, and on clicking that button, it should enable/disable context menu it..

Regular expression to limit number of characters to 10

I am trying to write a regular expression that will only allow lowercase letters and up to 10 characters. What I have so far looks like this: pattern: /^[a-z]{0,10}+$/ This does not work or compil..

Try catch statements in C

I was thinking today about the try/catch blocks existent in another languages. Googled for a while this but with no result. From what I know, there is not such a thing as try/catch in C. However, is t..

Open links in new window using AngularJS

Is there a way to tell AngularJS that I want links to be opened in new windows when the user clicks on them? With jQuery I would do this: jQuery("a.openInNewWindow").click( function() { window.o..

How to change href attribute using JavaScript after opening the link in a new window?

I have a link on my page <a href="" id="mylink" onclick="changeLink();" target="_blank">google</a> And the goal is to follow this link (opening in a new tab) and change..

C# 30 Days From Todays Date

I need my application to expire 30 days from today, I will store the current date in the application config.How will I check if the application has expired ? I don't mind if the user changed the clock..

Running Python in PowerShell?

I am attempting to learn the very basics of Python using the guide "Learn Python the hard way" by Zed A. Shaw. The problem that I am having is that I can run Python scripts, but only when using .\ in ..

Regex using javascript to return just numbers

If I have a string like "something12" or "something102", how would I use a regex in javascript to return just the number parts?..

Create aar file in Android Studio

I'd like to create an aar file for my library in Android Studio, i would've gone with a jar option but my library has resources. Any idea how to create an aar file from a library?..

LINQ to SQL - Left Outer Join with multiple join conditions

I have the following SQL, which I am trying to translate to LINQ: SELECT f.value FROM period as p LEFT OUTER JOIN facts AS f ON = f.periodid AND f.otherid = 17 WHERE p.companyid = 100 I have ..

Transposing a 1D NumPy array

I use Python and NumPy and have some problems with "transpose": import numpy as np a = np.array([5,4]) print(a) print(a.T) Invoking a.T is not transposing the array. If a is for example [[],[]] th..

Find most frequent value in SQL column

How can I find the most frequent value in a given column in an SQL table? For example, for this table it should return two since it is the most frequent value: one two two three ..

Dump Mongo Collection into JSON format

Is there any way to dump mongo collection into json format? Either on the shell or using java driver.I am looking for the one with best performance...

Generate a random point within a circle (uniformly)

I need to generate a uniformly random point within a circle of radius R. I realize that by just picking a uniformly random angle in the interval [0 ... 2p), and uniformly random radius in the interva..

How to check all checkboxes using jQuery?

I am not expert with jQuery but I have tried to create a little script for my application. I want to check all checkboxes but it isn't working correctly. First I tried to use attr and after that I tr..

@JsonProperty annotation on field as well as getter/setter

I have inherited a certain bit code that has the @JsonProperty annotation on getter/setters. The purpose is so that when the object is serialized using the Jackson library, the fields have that specif..

What does '<?=' mean in PHP?

<?php $a=1; ?> <?=$a;?> What does <?= mean exactly?..

C-like structures in Python

Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like: class MyStruct(): def __init__(self, field1, field2, field3): self.field1 = field1 ..

How do you display JavaScript datetime in 12 hour AM/PM format?

How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?..

Make button width fit to the text

While I was fiddling with this 'Fancy 3D Button' example, I found that the width seemed to be hard-coded to fit the text's width. Here is the HTML / CSS: _x000D_ _x000D_ body {_x000D_ background-..

force css grid container to fill full screen of device

How do I force a css grid container take the full width and height of the device screen for a single page app? Modified example is from Mozilla: Firefox documentation _x000D_ _x000D_ .wrapper {_x000D..

Difference between two lists

I Have two generic list filled with CustomsObjects. I need to retrieve the difference between those two lists(Items who are in the first without the items in the second one) in a third one. I was t..

Redirecting to authentication dialog - "An error occurred. Please try again later"

Why does it always happen to me? This happens after my application verify for user user login and redirect user to the authentication page:

AWS S3 copy files and folders between two buckets

I have been on the lookout for a tool to help me copy content of an AWS S3 bucket into a second AWS S3 bucket without downloading the content first to the local file system. I have tried to use the A..

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

I can push by clone project using ssh, but it doesn't work when I clone project with https. The error message that shows me is: server certificate verification failed. CAfile: /etc/ssl/certs/cacerti..

Switching to a TabBar tab view programmatically?

Let's say I have a UIButton in one tab view in my iPhone app, and I want to have it open a different tab in the tab bar of the TabBarController. How would I write the code to do this? I'm assuming..

Logical Operators, || or OR?

I remember reading a while back in regards to logical operators that in the case of OR, using || was better than or (or vice versa). I just had to use this in my project when it came back to me, but ..

Can I mask an input text in a bat file?

I am writing a batch file to execute some other programs. In this case I need to prompt for a password. Do I have any way to mask the input text? I don't need to print ******* characters instead of in..

SQL Update with row_number()

I want to update my column CODE_DEST with an incremental number. I have: CODE_DEST RS_NOM null qsdf null sdfqsdfqsdf null qsdfqsdf I would like to update it to be: CODE_DES..

Can there be an apostrophe in an email address?

Possible Duplicate: What characters are allowed in email address? I have an email address with an apostrophe in it and am wondering if that is valid?..

Receive JSON POST with PHP

I’m trying to receive a JSON POST on a payment interface website, but I can’t decode it. When I print : echo $_POST; I get: Array I get nothing when I try this: if ( $_POST ) { foreach..

StringLength vs MaxLength attributes ASP.NET MVC with Entity Framework EF Code First

What is the difference in behavior of [MaxLength] and [StringLength] attributes? As far as I can tell (with the exception that [MaxLength] can validate the maximum length of an array) these are ident..

How can I insert multiple rows into oracle with a sequence value?

I know that I can insert multiple rows using a single statement, if I use the syntax in this answer. However, one of the values I am inserting is taken from a sequence, i.e. insert into TABLE_NAME..

Delete forked repo from GitHub

I'm starting with git and GitHub and there's a project I'm watching on GitHub. I unintentionally clicked to fork it. Now it appears as a new project to me. I have some doubts about it: I know if co..

Java get last element of a collection

I have a collection, I want to get the last element of the collection. What's the most straighforward and fast way to do so? One solution is to first toArray(), and then return the last element of th..

When must we use NVARCHAR/NCHAR instead of VARCHAR/CHAR in SQL Server?

Is there a rule when we must use the Unicode types? I have seen that most of the European languages (German, Italian, English, ...) are fine in the same database in VARCHAR columns. I am looking f..

java Arrays.sort 2d array

I am looking to sort the following array based on the values of [][0] double[][] myArr = new double[mySize][2]; so for example, myArr contents is: 1 5 13 1.55 12 100.6 12.1 .85 I want..

Javascript How to define multiple variables on a single line?

Reading documentation online, I'm getting confused how to properly define multiple JavaScript variables on a single line. If I want to condense the following code, what's the proper JavaScript "stric..

How can I change the text color with jQuery?

When I hover a text with animation definitely I will use jQuery. Is there a code that will change the color, or size?..

How to check if a string contains only digits in Java

In Java for String class there is a method called matches, how to use this method to check if my string is having only digits using regular expression. I tried with below examples, but both of them re..

Does dispatch_async(dispatch_get_main_queue(), ^{...}); wait until done?

I have a scenario in my app, where I want to do some time consuming task which consists of some data processing as well as UI update, in a method. My method looks like this, - (void)doCalculationsAnd..

How to determine SSL cert expiration date from a PEM encoded certificate?

If I have the actual file and a Bash shell in Mac or Linux, how can I query the cert file for when it will expire? Not a web site, but actually the certificate file itself, assuming I have the csr, k..

New self vs. new static

I am converting a PHP 5.3 library to work on PHP 5.2. The main thing standing in my way is the use of late static binding like return new static($options); , if I convert this to return new self($opti..

Angular2 Error: There is no directive with "exportAs" set to "ngForm"

i'm on the RC4 and i'm getting the error There is no directive with "exportAs" set to "ngForm" because of my template : <div class="form-group"> <label for="actionType">Action Typ..

Using Vim's tabs like buffers

I have looked at the ability to use tabs in Vim (with :tabe, :tabnew, etc.) as a replacement for my current practice of having many files open in the same window in hidden buffers. I would like every..

Use Fieldset Legend with bootstrap

I'm using Bootstrap for my JSP page. I want to use <fieldset> and <legend> for my form. This is my code. <fieldset class="scheduler-border"> <legend class="scheduler-border"..

How to convert DataSet to DataTable

I am retrieving data from a SQL table so I can display the result on the page as a HTML table. Later I need to be able to save that table as a CSV file. So far I have figured out how to retrieve the..

jQuery: how to scroll to certain anchor/div on page load?

Lately im trying to use jquery more often and right now im having some problem i'd like to solve with jquery hope u could help me. I have some web page that includes some anchor tag (lets say the anc..

How to determine programmatically the current active profile using Spring boot

Is there a way programmatically to get the current active profile within my bean?..

How to get child element by class name?

I'm trying to get the child span that has a class = 4. Here is an example element: <div id="test"> <span class="one"></span> <span class="two"></span> <span class=..

ReportViewer Client Print Control "Unable to load client print control"?

Has anyone come across this issue? Seems MS have broken it with their own update: A number of people have reported problems using the ActiveX print control in the report viewer after instal..

How to autosize and right-align GridViewColumn data in WPF?

How can I: right-align the text in the ID column make each of the columns auto size according to the text length of the cell with the longest visible data? Here is the code: <ListView Name="l..

How to open a local disk file with JavaScript?

I tried to open file with"file:///D:/Hello.txt"); The browser does not allow opening a local file this way, probably for security reasons. I want to use the file's data in the client s..

C - gettimeofday for computing time?

do you know how to use gettimeofday for measuring computing time? I can measure one time by this code: char buffer[30]; struct timeval tv; time_t curtime; gettimeofday(&tv, NULL); cu..

Schema validation failed with the following errors: Data path ".builders['app-shell']" should have required property 'class'

Schema validation failed with the following errors: Data path ".builders['app-shell']" should have required property 'class'. Schema validation failed with the following errors: Data path ".build..

Java - Find shortest path between 2 points in a distance weighted map

I need an algorithm to find shortest path between two points in a map where road distance is indicated by a number. what is given: Start City A Destination City Z List of Distances between Cities: ..

Converting std::__cxx11::string to std::string

I use c++11, but also some libraries that are not configured for it, and need some type conversion. In particular I need a way to convert std::__cxx11::string to regular std::string, but googling I ca..

Redirecting from HTTP to HTTPS with PHP

I'm working on a shopping cart website and I would like to redirect the user to a HTTPS page when he's entering his billing details and maintain the HTTPS connection for the next pages until he logs o..

C++ error: "Array must be initialized with a brace enclosed initializer"

I am getting the following C++ error: array must be initialized with a brace enclosed initializer From this line of C++ int cipher[Array_size][Array_size] = 0; What is the problem here? What do..

Increment variable value by 1 ( shell programming)

I am a beginner to shell programming and it sounds like a very stupid question but i cant seem to be able to increase the variable value by 1. I have looked at tutorial but it only shows how to add to..

Resetting a multi-stage form with jQuery

I have a form with a standard reset button coded thusly: <input type="reset" class="button standard" value="Clear" /> Trouble is, said form is of the multi-stage sort, so if a user fills out ..

What is the @Html.DisplayFor syntax for?

I understand that in Razor, @Html does a bunch of neat things, like generate HTML for links, inputs, etc. But I don't get the DisplayFor function... Why would I write: @Html.DisplayFor(model => ..

How can I edit a .jar file?

So I have a jar file with one .class file on it. I just need to change some words in the file. What program should I use? I want this to work for my phone...

Apply jQuery datepicker to multiple instances

I've got a jQuery date picker control that works fine for once instance, but I'm not sure how to get it to work for multiple instances. <script type="text/javascript"> $(function() { ..

Converting a generic list to a CSV string

I have a list of integer values (List) and would like to generate a string of comma delimited values. That is all items in the list output to a single comma delimted list. My thoughts... 1. pass the ..

How to push to History in React Router v4?

In the current version of React Router (v3) I can accept a server response and use browserHistory.push to go to the appropriate response page. However, this isn't available in v4, and I'm not sure wha..

How to sort a file, based on its numerical values for a field?

Example file.txt: 100 foo 2 bar 300 tuu When using sort -k 1,1 file.txt, the order of lines will not change, though we are expecting : 2 bar 100 foo 300 tuu How to sort a field consi..

Get JSONArray without array name?

I'm new to JSON and trying this tutorial: I'm new to JSON, C languages, Java and also Android, but am le..

How to get POSTed JSON in Flask?

I'm trying to build a simple API using Flask, in which I now want to read some POSTed JSON. I do the POST with the Postman Chrome extension, and the JSON I POST is simply {"text":"lalala"}. I try to r..

Handling Dialogs in WPF with MVVM

In the MVVM pattern for WPF, handling dialogs is one of the more complex operations. As your view model does not know anything about the view, dialog communication can be interesting. I can expose a..

Safe Area of Xcode 9

While exploring Xcode9 Beta Found Safe Area on Interface builders View hierarchy viewer. Got curious and tried to know about Safe Area on Apples documentation, in gist the doc says "The the view area ..

How do you Make A Repeat-Until Loop in C++?

How do you Make A Repeat-Until Loop in C++? As opposed to a standard While or For loop. I need to check the condition at the end of each iteration, rather than at the beginning...

Remove warning messages in PHP

I have some PHP code. When I run it, a warning message appears. How can I remove/suppress/ignore these warning messages?..

How to add days to the current date?

I am trying to add days to the current date and it's working fine but when I add 360 days to the current date it gives me wrong value. eg: Current Date is 11/04/2014 And I am adding 360 Days to it, it..

Value of type 'T' cannot be converted to

This is likely a a novice question, but google surprisingly did not provide an answer. I have this rather artificial method T HowToCast<T>(T t) { if (typeof(T) == typeof(string)) { ..

How do I run Python script using arguments in windows command line

This is my python script: def hello(a,b): print "hello and that's your sum:" sum=a+b print sum import sys if __name__ == "__main__": hello(sys.argv[2]) The problem is ..

How to truncate string using SQL server

i have large string in SQL Server. I want to truncate that string to 10 or 15 character Original string this is test string. this is test string. this is test string. this is test string. Desired ..

How To have Dynamic SQL in MySQL Stored Procedure

How do you build and use dynamic sql in a MySQL stored procedure?..

How to add a class with React.js?

I need add class "active" after click to button and remove all other "active" classes. Look here please: var Tags = React.createClass({ setFilter: function(fi..

How do I return the SQL data types from my query?

I've a SQL query that queries an enormous (as in, hundreds of views/tables with hard-to-read names like CMM-CPP-FAP-ADD) database that I don't need nor want to understand. The result of this query ne..

Can't find bundle for base name /Bundle, locale en_US

I'm using a library that has a dependency on JSF. When I try to run my project, it show following exception massage.. java.util.MissingResourceException: Can't find bundle for base name /Bundle, lo..

How to use Utilities.sleep() function

What is the exact use of Utilities.sleep() function? Should we use it between function calls or API calls? I use the Utilities.sleep(1000) in-between function calls, is it right? Will it slow down ..

Sorting a Python list by two fields

I have the following list created from a sorted csv list1 = sorted(csv1, key=operator.itemgetter(1)) I would actually like to sort the list by two criteria: first by the value in field 1 and then b..

Upload video files via PHP and save them in appropriate folder and have a database entry

I want the user to be able to upload video files to my site and I want them arranged in proper folders plus a database entry so that later I can know the person who uploaded each particular file. My ..

Switch case on type c#

Possible Duplicate: C# - Is there a better alternative than this to 'switch on type'? Hello suppose i get a big if/else on class type. it's there a way to do it with a switch case ?..

System.currentTimeMillis vs System.nanoTime

Accuracy Vs. Precision What I would like to know is whether I should use System.currentTimeMillis() or System.nanoTime() when updating my object's positions in my game? Their change in movement is d..

SQL "select where not in subquery" returns no results

Disclaimer: I have figured out the problem (I think), but I wanted to add this issue to Stack Overflow since I couldn't (easily) find it anywhere. Also, someone might have a better answer than I do. ..

How to create JSON Object using String?

I want to create a JSON Object using String. Example : JSON {"test1":"value1","test2":{"id":0,"name":"testName"}} In order to create the above JSON I am using this. String message; JSONObject json..

Difference between DOM parentNode and parentElement

Can somebody in explain me in as simple as possible terms, what is the difference between classical DOM parentNode and newly introduced in Firefox 9 parentElement..

How to use JavaScript to change div backgroundColor

The HTML below: <div id="catestory"> <div class="content"> <h2>some title here</h2> <p>some content here</p> </div> <div class="content..

IntelliJ IDEA "cannot resolve symbol" and "cannot resolve method"

What are common causes for IntelliJ IDEA not being able to resolve built-in JVM types and methods? For example, when I mouse over String the tooltip says "Cannot resolve symbol 'String'". It's as if I..

Select something that has more/less than x character

Was wondering if it's possible to select something that has more/less than x characters in SQL. For example, I have an employee table and I want to show all employee names that has more than 4 charac..

Setting Timeout Value For .NET Web Service

I have a web service written in C# that is living on a SharePoint site. I have modified the web.config with the following code: <configuration> <system.web> <httpRuntime executi..

How to extract code of .apk file which is not working?

Actually I was trying to extract code of a .apk file called cloudfilz.apk and wanted to manipulate in its source code so I followed the steps given below:- make a new folder and put .apk file (which y..

VB.NET: Clear DataGridView

I've tried - DataGridView1.DataSource=Nothing and DataGridView1.DataSource=Nothing DataGridView1.Refresh() and DataGridView1.RefreshEdit() None of them works.. I've written a method that set..

Disable scrolling in webview?

Until now I have been an iPhone developer only and now I have decided to give Android a whirl. Something I haven't been able to figure out on Android is how to programmatically prevent scrolling in a ..

Press enter in textbox to and execute button command

I want to execute the code behind my Search Button by pressing Enter. I have the Accept Button property to my search button. However, when i place my button as NOT visible my search doesn't execute. ..

How to directly move camera to current location in Google Maps Android API v2?

Without clicking any button, how to directly get the current location and move the camera to it. Also, I found that there is a button on the right top of the map. When click on it, it will go to curre..

Why should we NOT use sys.setdefaultencoding("utf-8") in a py script?

I have seen few py scripts which use this at the top of the script. In what cases one should use it? import sys reload(sys) sys.setdefaultencoding("utf-8") ..

Generate a range of dates using SQL

I have a SQL query that takes a date parameter (if I were to throw it into a function) and I need to run it on every day of the last year. How to generate a list of the last 365 days, so I can use st..

How can I data bind a list of strings to a ListBox in WPF/WP7?

I am trying to bind a list of string values to a listbox so that their values are listed line by line. Right now I use this: <ListBox Margin="20" ItemsSource="{Binding Path=PersonNames}"> &..

How to stop a thread created by implementing runnable interface?

I have created class by implementing runnable interface and then created many threads(nearly 10) in some other class of my project.How to stop some of those threads?..

How do I calculate someone's age based on a DateTime type birthday?

Given a DateTime representing a person's birthday, how do I calculate their age in years?..

Android Facebook integration with invalid key hash

In one of my apps I need to get data from Facebook... I am doing this: I have created app ID. It logs in successfully, but after logging out, I log in, and then it gives me: What is wrong I am doi..

How do I test which class an object is in Objective-C?

How do I test whether an object is an instance of a particular class in Objective-C? Let's say I want to see if object a is an instance of class b, or class c, how do I go about doing it?..

What is the best way to initialize a JavaScript Date to midnight?

What is the simplest way to obtain an instance of new Date() but set the time at midnight?..

Prevent jQuery UI dialog from setting focus to first textbox

I have setup a jQuery UI modal dialog to display when a user clicks a link. There are two textboxes (I only show the code for 1 for brevity) in that dialog div tag and it is changed to be a jQuery UI..

Auto highlight text in a textbox control

How do you auto highlight text in a textbox control when the control gains focus...

How to access parameters in a Parameterized Build?

How do you access parameters set in the "This build is parameterized" section of a "Workflow" Jenkins job? TEST CASE Create a WORKFLOW job. Enable "This build is parameterized". Add a STRING PARAM..

Can you install and run apps built on the .NET framework on a Mac?

I need to use/continue developing a desktop app developed using .NET on my Mac. Is there a .NET framework 4.0 available for Mac? Would this allow running and developing of .NET-based apps on a Mac? A..

Python: Converting string into decimal number

I have a python list with strings in this format: A1 = [' "29.0" ',' "65.2" ',' "75.2" '] How do I convert those strings into decimal numbers to perform arithmetic operations on the list elements?..

how to reset <input type = "file">

I am developing a metro app with VS2012 and Javascript I want to reset the contents of my file input: <input type="file" id="uploadCaptureInputFile" class="win-content colors" accept="image/*" /&..

Want custom title / image / description in facebook share link from a flash app

Possible Duplicate: How does Facebook Sharer select Images? I am making a flash app that demonstrates potensial traffic injuries when driving at different speeds. I want the user to be able..

In Visual Basic how do you create a block comment

Possible Duplicate: commenting VB code Does anybody know how to do a block comment in Visual Basic? Note: I did a few searches on here and neither those results nor the results for 'Questi..

How to prevent scanf causing a buffer overflow in C?

I use this code: while ( scanf("%s", buf) == 1 ){ What would be the best way to prevent possible buffer overflow so that it can be passed strings of random lengths? I know I can limit the input s..

Plotting images side by side using matplotlib

I was wondering how I am able to plot images side by side using matplotlib for example something like this: The closest I got is this: This was produced by using this code: f, axarr = plt.subpl..

What are MVP and MVC and what is the difference?

When looking beyond the RAD (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called Model-View-Controller, Model-..

Command to collapse all sections of code?

In Visual Studio is there a command to collapse/expand all the sections of code in a file?..

Print ArrayList

I have an ArrayList that contains Address objects. How do I print the values of this ArrayList, meaning I am printing out the contents of the Array, in this case numbers. I can only get it to print ..

Convert timestamp to date in Oracle SQL

How can we convert timestamp to date? The table has a field, start_ts which is of the timestamp format: '05/13/2016 4:58:11.123456 PM' I need to query the table and find the maximum and min timest..

What column type/length should I use for storing a Bcrypt hashed password in a Database?

I want to store a hashed password (using BCrypt) in a database. What would be a good type for this, and which would be the correct length? Are passwords hashed with BCrypt always of same length? EDIT..

Insert line at middle of file with Python?

Is there a way to do this? Say I have a file that's a list of names that goes like this: Alfred Bill Donald How could I insert the third name, "Charlie", at line x (in this case 3), and automatica..

How to place a div below another div?

I have a #slider div with an image. After that, I have a #content div which has text. I have tried position:relative so I think it should come after the previous div, I mean #slider but here it is not..

Function to calculate R2 (R-squared) in R

I have a dataframe with observed and modelled data, and I would like to calculate the R2 value. I expected there to be a function I could call for this, but can't locate one. I know I can write my o..

How do I check for equality using Spark Dataframe without SQL Query?

I want to select a column that equals to a certain value. I am doing this in scala and having a little trouble. Heres my code"state")==="TX").show() this returns the state column wit..

Modifying local variable from inside lambda

Modifying a local variable in forEach gives a compile error: Normal int ordinal = 0; for (Example s : list) { s.setOrdinal(ordinal); ordinal++; } With Lambda int o..

How to create JSON string in JavaScript?

window.onload = function(){ var obj = '{ "name" : "Raj", "age" : 32, "married" : false }'; var val = eval('(' + obj + ')'); alert( "name :..

How can I show/hide a specific alert with twitter bootstrap?

Here's an example of an alert I'm using: <div class="alert alert-error" id="passwordsNoMatchRegister"> <span> <p>Looks like the passwords you entered don't match!</p> ..