Questions Tagged with #Otp

OTP is a set of useful middle-ware, libraries and tools written in Erlang. It is an integral part of the open source distribution of Erlang. (For the one-time passwords, use [tag:one-time-password])

DeprecationWarning: Buffer() is deprecated due to security and usability issues when I move my script to another server

Getting error when script move to other server. (node:15707) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.alloc..

Error : Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

I am getting the following error while building the project. haven't used CoordinatorLayout in this project. just added as a dependency in build.gradle : I am using Android Studio 3.2 Canary 4. Log..

ReferenceError: fetch is not defined

I have this error when I compile my code in node.js, how can I fix it? RefernceError: fetch is not defined This is the function I am doing, it is responsible for recovering information from a spec..

Could not resolve com.android.support:appcompat-v7:26.1.0 in Android Studio new project

I know about this questions: Failed to resolve: com.android.support:cardview-v7:26.0.0 android Could not resolve com.android.support:appcompat-v7:26.1.0 [duplicate] And I've read this documentation..

No provider for HttpClient

After upgrading from angular 4.4 to 5.0 and after updating all HttpModule and Http to HttpClientModule I started to get this error. I also added HttpModule again to be sure it's not due to some depe..

Unable to merge dex

I have Android Studio Beta. I created a new project with compile my old modules but when I tried launching the app it did not launch with the message: Error:Execution failed for task ':app:transformD..

Kubernetes Pod fails with CrashLoopBackOff

I 'm Following this guide in order to set up a pod using minikube and pull an image from a private repository hosted at: hub.docker.com When trying to set up a pod to pull the image i see CrashLoopBa..

Hide header in stack navigator React navigation

I'm trying to switch screen using both stack and tab navigator. const MainNavigation = StackNavigator({ otp: { screen: OTPlogin }, otpverify: { screen: OTPverification}, userVerifie..

Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci

I update the gradle plugin to the latest : com.android.tools.build:gradle:3.0.0-alpha1 and this error occured : export TERM="dumb" if [ -e ./gradlew ]; then ./gradlew test;else gradle test;fi FAILU..

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details build:gradle(Module:app) buildscript { repositories { maven { url '..

Android: Getting "Manifest merger failed" error after updating to a new version of gradle

After accepting to update the project to new version of gradle I get this error: Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute meta-data#android.supp..

REST API - Use the "Accept: application/json" HTTP Header

When I make a request, I get a response in XML, but what I need is JSON. In the doc it is stated in order to get a JSON in return: Use the Accept: application/json HTTP Header. Where do I find the HT..

Gradle error: Minimum supported Gradle version is 3.3. Current version is 3.2

When I today update Android Studio it write: Minimum supported Gradle version is 3.3. Current version is 3.2 how can I solve this problem? Here is my build.gradle // Top-level build file where you ..

Error:Cause: unable to find valid certification path to requested target

I got the following Error in android Studio 2.2.3 when I sync gradle. Error:Cause: unable to find valid certification path to requested target How can I fix this issue I am Adding my Gradle file al..

Laravel 5.4 redirection to custom url after login

I am using Laravel Framework 5.4.10, and I am using the regular authentication that php artisan make:auth provides. I want to protect the entire app, and to redirect users to /themes after login. ..

Didn't find class "com.google.firebase.provider.FirebaseInitProvider"?

I am getting the below exception on app launch. java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find cla..

How do I access Configuration in any class in ASP.NET Core?

I have gone through configuration documentation on ASP.NET core. Documentation says you can access configuration from anywhere in the application. Below is Startup.cs created by template public clas..

How to upload a file and JSON data in Postman?

I am using Spring MVC and this is my method: /** * Upload single file using Spring Controller. */ @RequestMapping(value = "/uploadFile", method = RequestMethod.POST) public @ResponseBody ResponseEnti..

Could not find method android() for arguments

I've been trying to import a project to Android Studio and this is where I am stuck, there is a similar question on Stack Overflow but it did not provide a solution to my particular error. This is m..

Install pip in docker

I'm not able to install pip in Docker. Here's my Dockerfile: FROM ubuntu:14.04 # Install dependencies RUN apt-get update -y RUN apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcr..

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

I want to compile an open source android project (Netguard) using gradel (gradlew clean build) But I encountered this Error: A problem occurred configuring project ':app'. > Exception thrown while..

File URL "Not allowed to load local resource" in the Internet Browser

I've got a major brainteaser. I want to open a file in classic ASP. I'm using various variables because things can change but the outcome is correct. I know this because I've tested the outcome by co..

OTP (token) should be automatically read from the message

I am working on an Android App, in which the server sends an OTP and the user needs to enter this OTP in the App, to SignUp for my App. What I want is, that my App should be able to automatically read..

Graphviz's executables are not found (Python 3.4)

I am running Python3.4 on Windows 7. I am trying to use the Python interface for graphviz. This is a script I intend to run: from graphviz import Digraph import pydotplus dot = Digraph(comment='The ..

How to give spacing between buttons using bootstrap

I want to give spacing between buttons is there a way to give spacing using bootstrap so that they will be consistent for different screen resolutions. I tried using margin-left But is it the correct..

Bootstrap 3: How do you align column content to bottom of row

I have a row in Bootstrap 3 and 3 columns in that row. I want to align two of the columns to the bottom of the row and keep the first column at the top. When I use the traditional approach with positi..

multiple plot in one figure in Python

I am new to python and am trying to plot multiple lines in the same figure using matplotlib. Value of my Y axis is stored in a dictionary and I make corresponding values in X axis in my following code..

Transparent color of Bootstrap-3 Navbar

I'm having problem with setting bootstrap3 navbar transparency or opacity color. I didin't change anything in bootstrap.css or bootstrap-theme.css In my menu I'm Trying to put image under that and se..

AngularJS- Login and Authentication in each route and controller

I have an AngularJS application created by using yeoman, grunt and bower. I have a login page that has a controller that checks for authentication. If the credentials are correct I reroute to home pa..

CSS property to pad text inside of div

Is there a way to give a div element some padding INSIDE its border? For example, currently all the text inside my main div element goes right to the edge of the element's border. I'd like, as a gener..

Bootstrap 3 Styled Select dropdown looks ugly in Firefox on OS X

When styling a form <select> element in Bootstrap 3, it renders an ugly button on the in Firefox on OS X: (http://bootply.com/98385) This has apparently been a known issue for a while, and t..

Bootstrap 3 collapse accordion: collapse all works but then cannot expand all while maintaining data-parent

I'm using Bootstrap 3 and trying to setup the following accordion/collapse structure: Onload: Each accordion panel in a group is fully collapsed and functions as documented/expected. Button click: E..

PowerShell script to check the status of a URL

Similar to this question here I am trying to monitor if a set of website links are up and running or not responding. I have found the same PowerShell script over the Internet. However, instead of dir..

Twitter Bootstrap 3, vertically center content

I know this has been asked a thousand time but I can't find a way to make the text and image to be centered vertically. I'm using Twitter Bootstrap 3 with dynamic content so therefor, I do not know t..

Bootstrap 3 select input form inline

I'm trying to get input and select option inline attached with each other like this demo using Bootstrap 2 (dead link). Following Bootstrap 3 guidelines I manage to do this: <div class="container..

Bootstrap 3 Multi-column within a single ul not floating properly

I have been encountering problems like this on the current bootstrap 3 for a while now. I have managed to fix them in the past in one way or another but have no clue of how to fix it this time. I nee..

Bootstrap 3 - How to load content in modal body via AJAX?

As you can see here, I have a button that launches a modal. Setting an href url for the button this url is automatically loaded into modal by Bootstrap 3. The fact is this page is loaded into modal ro..

Bootstrap radio button "checked" flag

In case #1 works, in case #2 it do not works. Check the code bellow: <div class="container"> <div class="row"> <h1>Radio Group #1</h1> <label class="rad..

Bootstrap 3 panel header with buttons wrong position

I am using Bootstrap 3 and I would like to add some buttons in panel header, on top-right corner. When trying to add them, they are show below title baseline. Code : http://bootply.com/82631 What ar..

Carousel with Thumbnails in Bootstrap 3.0

I need to make Bootstrap 3.0 Carousel to display a slide of thumbnails. How can I do this? This is an image of what I´m looking for: This is a working example for Bootstrap 2, but I need this for ..

How to simulate POST request?

I'm testing on Windows, trying to simulate POST requests (with different form variables) for load testing. I have tried all kinds of load testing software but failed to get it working. For GET reques..

How to make bootstrap 3 fluid layout without horizontal scrollbar

here is sample link: http://bootply.com/76369 this is html i use. <div class="row"> <div class="col-md-6">.col-md-6</div> <div class="col-md-6">.col-md-6</div> <..

Bootstrap 3 unable to display glyphicon properly

I am migrating from bootstrap 2.3 to bootstrap 3 and everything works well. But when I tried to add some icons, the icon font doesn't displayed properly. I tried to look over here http://bootply.com/6..

How to use vertical align in bootstrap

Simple problem: How do I vertically align a col within a col using bootstrap? Example here (I want to vertically align child1a and child1b): http://bootply.com/73666 HTML <div class="col-lg-12"..

Options for embedding Chromium instead of IE WebBrowser control with WPF/C#

Updated for 2020, I've linked my article where I compare the memory footprints of different approaches to hosting HTML WebView in a basic Windows Desktop application: MSEdge WebView2 WPF Chromely/Cef..

DataTables warning: Requested unknown parameter '0' from the data source for row '0'

Does anybody please know, what is wrong with the very simple HTML file below? I am just trying to use an array of objects as the data source for DataTables: tests.html: <html> <head> ..

Reading a text file using OpenFileDialog in windows forms

I am new to the OpenFileDialog function, but have the basics figured out. What I need to do is open a text file, read the data from the file (text only) and correctly place the data into separate text..

Getting Python error "from: can't read /var/mail/Bio"

I am running a (bio)python script which results in the following error: from: can't read /var/mail/Bio seeing as my script doesn't have anything to with mail, I don't understand why my script is lo..

Spring,Request method 'POST' not supported

First of all say apology to ask this repeated Question.. Actually in my spring Application i have user.jsp and professional.jsp here is my User.jsp: <form:form action="profile/user" modelAttri..

ldap_bind: Invalid Credentials (49)

I'm running OpenLDAP 2.4-28 on XUBUNTU 12.04. I'm reading "Mastering OpenLDAP" and configuring along with the book. When I try to perform the following search (page 47): $ ldapsearch -x -W -D 'cn=M..

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

The following code: Class.forName("com.mysql.jdbc.Driver"); Connection m_connection = DriverManager.getConnection("jdbc:mysql://localhost","root","root"); Throws this exception on getConnection(): ..

Android Image View Pinch Zooming

I am using code sample from Making Sense of Multitouch for zooming image view. On ScaleListener I added ScaleGestureDetector.getFocusX() and getFocusY()for content to zoom about the focal point of the..

How to get the Parent's parent directory in Powershell?

So if I have a directory stored in a variable, say: $scriptPath = (Get-ScriptDirectory); Now I would like to find the directory two parent levels up. I need a nice way of doing: $parentPath = Spl..

Non-resolvable parent POM using Maven 3.0.3 and relativePath notation

After migrating to Mavent 3.0.3 Parent poms in several Projects cannot be resolved anymore. The Projects are structured in a default manner, so I set parent.relativePath to "../pom.xml" supe..

C# Iterate through Class properties

I'm currently setting all of the values of my class object Record. This is the code that I'm using to populate the record at the moment, property by property. // Loop through each field in the resul..

ORA-01008: not all variables bound. They are bound

I have come across an Oracle problem for which I have so far been unable to find the cause. The query below works in Oracle SQL developer, but when running in .NET it throws: ORA-01008: not all va..

Does Git Add have a verbose switch

I am in the process of moving all my private an public repo's over to github. One of the decisions I have made is to only use the console as it means a smaller tooling footprint if I ever need to chan..

Passing parameters to a Bash function

I am trying to search how to pass parameters in a Bash function, but what comes up is always how to pass parameter from the command line. I would like to pass parameters within my script. I tried: myB..

matching query does not exist Error in Django

I have implemented a password recovery functionality in django. With my method, the new password will be sent to the email id entered. It works fine when given the correct email (e-mail id which exist..

Javascript Drag and drop for touch devices

I am looking for a drag & DROP plugin that works on touch devices. I would like similar functionality to the jQuery UI plugin which allows "droppable" elements. The jqtouch plugin supports dragg..

How to remove lines in a Matplotlib plot

How can I remove a line (or lines) of a matplotlib axes in such a way as it actually gets garbage collected and releases the memory back? The below code appears to delete the line, but never releases..

Mysql SELECT CASE WHEN something then return field

I have two field nnmu and nnmi , if nnmu is equal to 1, I need to return naziv_mesta from **mesto_istovara**, else if it's =0 I need to return naziv_mesta from mesto_utovara table and reverse, if ..

Address already in use: JVM_Bind

I'm using Glassfish 3.0.1, JVM 1.6.0_21 on Windows XP Pro; I don't know exactly what has changed in my environment but I get this stacktrace as soon as I try to deploy an enterprise application (ejb ..

Assert that a WebElement is not present using Selenium WebDriver with java

In tests that I write, if I want to assert a WebElement is present on the page, I can do a simple: driver.findElement(By.linkText("Test Search")); This will pass if it exists and it will bomb out i..

Clang vs GCC - which produces faster binaries?

I'm currently using GCC, but I discovered Clang recently and I'm pondering switching. There is one deciding factor though - quality (speed, memory footprint, reliability) of binaries it produces - if ..

Something better than .NET Reflector?

I used to love .NET Reflector back in the day, but ever since Red Gate Software took over it has gone downhill dramatically. Now it forces me to update (which is absolutely ridiculous), half the time ..

Static linking vs dynamic linking

Are there any compelling performance reasons to choose static linking over dynamic linking or vice versa in certain situations? I've heard or read the following, but I don't know enough on the subject..

How to decrypt an encrypted Apple iTunes iPhone backup?

I've been asked by a number of unfortunate iPhone users to help them restore data from their iTunes backups. This is easy when they are unencrypted, but not when they are encrypted, whether or not the..

How can I programmatically check whether a keyboard is present in iOS app?

I need to check the condition of keyboard visibility in my iOS app. Pseudocode: if(keyboardIsPresentOnWindow) { //Do action 1 } else if (keyboardIsNotPresentOnWindow) { //Do action 2 } How..

Java Swing - how to show a panel on top of another panel?

I wish to have an internal (non window) dialog to ask for member input. I would like the dialog to be placed centrally on an existing JPanel. I have looked at layeredpanes and these seem unusable due ..

SQL Server Text type vs. varchar data type

I have variable length character data and want to store in SQL Server (2005) database. I want to learn some best practices about how to choose TEXT SQL type or choose VARCHAR SQL type, pros and cons i..

When should I use a struct rather than a class in C#?

When should you use struct and not class in C#? My conceptual model is that structs are used in times when the item is merely a collection of value types. A way to logically hold them all together in..

Local file access with JavaScript

Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring Adobe AIR. Specifically, I'd like to re..

.NET data structures: ArrayList, List, HashTable, Dictionary, SortedList, SortedDictionary -- Speed, memory, and when to use each?

.NET has a lot of complex data structures. Unfortunately, some of them are quite similar, and I'm not always sure when to use one and when to use another. Most of my C# and Visual Basic books talk abo..

Chain-calling parent initialisers in python

Consider this - a base class A, class B inheriting from A, class C inheriting from B. What is a generic way to call a parent class initialiser in an initialiser? If this still sounds too vague, here's..

In NetBeans how do I change the Default JDK?

Possible Duplicate: Changing Java platform on which Netbeans runs Here is an image of my default JDK (which is 1.6) and the JDK I want to set as default (which is 1.7) http://tinypic.com/v..

Set language for syntax highlighting in Visual Studio Code

Before the confusion begins, this question is about Code, the new lightweight Visual Studio Editor. You can get it from here: https://code.visualstudio.com/ I have a textfile (.txt) with CSS in it an..

Log exception with traceback

How can I log my Python errors? try: do_something() except: # How can I log my exception here, complete with its traceback? ..

Best practice for partial updates in a RESTful service

I am writing a RESTful service for a customer management system and I am trying to find the best practice for updating records partially. For example, I want the caller to be able to read the full rec..

hibernate could not get next sequence value

i have gwt application connect to postgres DB at the backend, and a java class 'Judgement' mapping the table 'judgements' in DB, when i tried to persistent a judgement into db, it threw the following ..

Programmatically center TextView text

I beg some leniency here, I'm just starting with the Android SDK tutorials and I'm attempting something out of interest that's not in the tutorial itself, but I would hope would be easy. I am trying ..

Correct file permissions for WordPress

I've had a look over here but didn't find any details on the best file permissions. I also took a look at some of WordPress's form's questions over here too but anybody that suggests 777 obviously ne..

How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes "Hello World". How is this accomplished in Bash?..

alter the size of column in table containing data

Possible Duplicate: How to make a varchar2 field shorter in Oracle? In Oracle(9i and above) Alter table employee MODIFY ename varchar2(10); I want to alter the column ename of table ..

IPython/Jupyter Problems saving notebook as PDF

So, i've been trying to save a jupyter notebook as PDF but i just can't figure out how to do this. The first thing i try is from the file menu just download as PDF, but doing that results in: nbconve..

Instant run in Android Studio 2.0 (how to turn off)

How to disable Instant Run in Android Studio 2.0 Preview. When I go to the settings I see it: and I can not remove the tick from "Enable Instant Run..." I use Android Studio 2.0 Preview 9, but thi..

Dependent DLL is not getting copied to the build output folder in Visual Studio

I have a visual studio solution. I have many projects in the solution. There is one main project which acts as the start up and uses other projects. There is one project say "ProjectX". Its reference ..

Using setTimeout to delay timing of jQuery actions

I am attempting to delay the swapping of text in a div. It should operate like a slider/carousel for text. I must have the code wrong, as the final text replacement never happens. Also, how would I ..

Multiline TextView in Android?

I did like below in xml <TableRow> <TextView android:id="@+id/address1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="..

Excel function to make SQL-like queries on worksheet data?

I have a largish table in an Excel worksheet: Column_1 | Column_2 | Column_3 ValueA ValueB ValueC .... What I need is a function that will take as input the range and an SQL-like query S..

C++ Matrix Class

In C, if I wanted to create a matrix struct, I would use: struct matrix { int col, row; double data[1]; // I want the matrix entries stored // right after this struct } Then I..

How to remove all non-alpha numeric characters from a string in MySQL?

I'm working on a routine that compares strings, but for better efficiency I need to remove all characters that are not letters or numbers. I'm using multiple REPLACE functions now, but maybe there is..

ActiveMQ or RabbitMQ or ZeroMQ or

We'd be interested to hear any experiences with the pros and cons of ActiveMQ vs RabbitMQ vs ZeroMQ. Information about any other interesting message queues is also welcome...

finding and replacing elements in a list

I have to search through a list and replace all occurrences of one element with another. So far my attempts in code are getting me nowhere, what is the best way to do this? For example, suppose my li..

How can I get the assembly file version

In AssemblyInfo there are two assembly versions: AssemblyVersion: Specify the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for..

Erasing elements from a vector

I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need..

Create SQL identity as primary key?

create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't work. How can I do this?..

How to change the status bar background color and text color on iOS 7?

My current application runs on iOS 5 and 6. The navigation bar is having an orange color and the status bar is having a black background color with white text color. However, when I run the same app..

Rebase array keys after unsetting elements

I have an array: $array = array(1,2,3,4,5); If I were to dump the contents of the array they would look like this: array(5) { [0] => int(1) [1] => int(2) [2] => int(3) [3] => i..

Check if object value exists within a Javascript array of objects and if not add a new object to array

If I have the following array of objects: [ { id: 1, username: 'fred' }, { id: 2, username: 'bill' }, { id: 2, username: 'ted' } ] Is there a way to loop through the array to check whether a partic..

How to export data from Spark SQL to CSV

This command works with HiveQL: insert overwrite directory '/data/home.csv' select * from testtable; But with Spark SQL I'm getting an error with an org.apache.spark.sql.hive.HiveQl stack trace: j..

Python recursive folder read

I have a C++/Obj-C background and I am just discovering Python (been writing it for about an hour). I am writing a script to recursively read the contents of text files in a folder structure. The pro..

Run a string as a command within a Bash script

I have a Bash script that builds a string to run as a command Script: #! /bin/bash matchdir="/home/joao/robocup/runner_workdir/matches/testmatch/" teamAComm="`pwd`/a.sh" teamBComm="`pwd`/b.sh" inc..

Spring Data JPA Update @Query not updating?

I have an update query: @Modifying @Transactional @Query("UPDATE Admin SET firstname = :firstname, lastname = :lastname, login = :login, superAdmin = :superAdmin, preferenceAdmin = :preferenceAdmin, ..

Reading an Excel file in PHP

I'm trying to read an Excel file (Office 2003). There is an Excel file that needs to be uploaded and its contents parsed. Via Google, I can only find answers to these related (and insufficient topics..

How do I find a particular value in an array and return its index?

Pseudo Code: int arr[ 5 ] = { 4, 1, 3, 2, 6 }, x; x = find(3).arr ; x would then return 2. ..

How to calculate number of days between two dates

I have two input dates taking from Date Picker control. I have selected start date 2/2/2012 and end date 2/7/2012. I have written following code for that. I should get result as 6 but I am getting 5...

NuGet Package Restore Not Working

I checked in a project on one computer, checked out on another, and find that the binaries installed by NuGet are missing. I could check them in to source control as well, but it looks like there's a..

The activity must be exported or contain an intent-filter

when I tried to run my application its show the error below Error running Dashboard: The activity must be exported or contain an intent-filter How can I solve this error?..

Git push error: Unable to unlink old (Permission denied)

In the remote server I have a post-receive hook set up in order to make a git checkout of my repository: #!/bin/sh GIT_WORK_TREE=/var/www/<website> git checkout -f But when I make a push from..

How to make JavaScript execute after page load?

I'm executing an external script, using a <script> inside <head>. Now since the script executes before the page has loaded, I can't access the <body>, among other things. I'd like t..

How to delete SQLite database from Android programmatically

I would like to delete the database file from the Android file system programatically? Can I have a shell script launch adb which in turns runs a shell script in the Android space to do the database ..

Pass array to mvc Action via AJAX

I'm trying to pass an array (or IEnumerable) of ints from via AJAX to an MVC action and I need a little help. the javascript is $.get('/controller/MyAction', { vals: arrayOfValues }, function (dat..

Output in a table format in Java's System.out

I'm getting results from a database and want to output the data as a table in Java's standard output I've tried using \t but the first column I want is very variable in length. Is there a way to dis..

Deleting a local branch with Git

I've googled and there are several very long threads on this topic and none of them seem to help. I think I'm doing something wrong. I have a branch called Test_Branch. When I try to delete it using t..

how to draw smooth curve through N points using javascript HTML5 canvas?

For a drawing application, I'm saving the mouse movement coordinates to an array then drawing them with lineTo. The resulting line is not smooth. How can I produce a single curve between all the gat..

Parse error: Syntax error, unexpected end of file in my PHP code

I got an error: Parse error: syntax error, unexpected end of file in the line With this code: <html> <?php function login() { // Login function code ..

Calculate execution time of a SQL query?

I am providing search functionality in my website, when user searches a record then I want to display the time the query taken to get the results same as google does. When we search anything then goog..

ggplot2, change title size

I would like to have my main title and axis title have the same font size as the annotated text in my plot. i used theme_get() and found that text size is 12, so I did that in my theme statement - th..

What is the difference between URI, URL and URN?

What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it. URI: http://www.foo.com/bar.html URL: http://www.foo.com/bar.html URN: bar.ht..

how to remove "," from a string in javascript

original string is "a,d,k" I want to remove all , and make it to "adk". I tried code below but it doesn't work. "a,d,k".replace(/,/,"") ..

Output a NULL cell value in Excel

Possible Duplicate: Return empty cell from formula in Excel I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Suc..

IIS Express gives Access Denied error when debugging ASP.NET MVC

I have created an ASP.NET MVC 3 project, and am using IIS Express as the web server when developing. When I try to debug, I get the error message below. How can this be solved? Server Error in '/..

Which is best data type for phone number in MySQL and what should Java type mapping for it be?

I am using MySQL with Spring JDBC template for my web application. I need to store phone number with only digits (10). I am little bit confused about data type using data type. What is preferable da..

PowerShell : retrieve JSON object by field value

Consider JSON in this format : "Stuffs": [ { "Name": "Darts", "Type": "Fun Stuff" }, { "Name": "Clean Toilet", "Type": "Boring Stuff" } ] In PowerShe..

reading and parsing a TSV file, then manipulating it for saving as CSV (*efficiently*)

My source data is in a TSV file, 6 columns and greater than 2 million rows. Here's what I'm trying to accomplish: I need to read the data in 3 of the columns (3, 4, 5) in this source file The fifth..

html div onclick event

I have one html div on my jsp page, on that i have put one anchor tag, please find code below for that, <div class="expandable-panel-heading"> <h2> <a id="ancherComplaint..

Multiprocessing vs Threading Python

I am trying to understand the advantages of multiprocessing over threading. I know that multiprocessing gets around the Global Interpreter Lock, but what other advantages are there, and can threading ..

Why was the name 'let' chosen for block-scoped variable declarations in JavaScript?

I understand why var takes that name - it is variable, const - it is a constant, but what is the meaning behind the name for let, which scopes to the current block? Let it be?..

Disable Enable Trigger SQL server for a table

I want to create one proc like below but it has error on syntax. Could anyone pointing out the problem? Create PROCEDURE [dbo].[my_proc] AS BEGIN DISABLE TRIGGER dbo.tr_name ON dbo.table_name -- s..

Live-stream video from one android phone to another over WiFi

I have searched the internet for days now on how to implement a video streaming feature from an android phone to another android phone over a WiFi connection but I can't seem to find anything useful. ..

How can I exclude a directory from Visual Studio Code "Explore" tab?

I'm trying to exclude several folders on the "Explore" tab in Visual Studio Code. To do that I have added a following jsconfig.json to the root of my project: { "compilerOptions": { "targ..

Joining two lists together

If I have two lists of type string (or any other type), what is a quick way of joining the two lists? The order should stay the same. Duplicates should be removed (though every item in both links are..

android edittext onchange listener

I know a little bit about TextWatcher but that fires on every character you enter. I want a listener that fires whenever the user finishes editing. Is it possible? Also in TextWatcher I get an instanc..

What's the HTML to have a horizontal space between two objects?

I have been searching for an answer and trying different things without success. Could someone kindly let me know how to put spaces between two objects by using PHP code? (Please note: I use WordPress..

How do I make Java register a string input with spaces?

Here is my code: public static void main(String[] args) { Scanner in = new Scanner(System.in); String question; question = in.next(); if (question.equalsIgnoreCase("howdoyoulikeschool?") ) ..

Latex - Change margins of only a few pages

I have a Latex document where I need to change the margins of only a few pages (the pages where I'm adding a lot of graphics). In particular, I'd like to change the top margins (\voffset). I've tried..

Recursion or Iteration?

Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome. I have seen many prog..

Couldn't process file resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

I am facing an issue while debugging c# API Coding in Visual studio 2017. Debugging not started and showing a error message like Any idea about this error message? ..

Check if inputs are empty using jQuery

I have a form that I would like all fields to be filled in. If a field is clicked into and then not filled out, I would like to display a red background. Here is my code: $('#apply-form input').blu..

Spring MVC: difference between <context:component-scan> and <annotation-driven /> tags?

Some days ago I began to study this Spring Hello World Tutorial: http://viralpatel.net/blogs/spring-3-mvc-create-hello-world-application-spring-3-mvc/ In this tutorial Spring DispatcherServlet is con..

Responsive web design is working on desktop but not on mobile device

I have a website which must be responsive for mobile phones. I've created it using my desktop. When I adjust browser windows it's working perfectly for mobile phone but when I check it on my real mobi..

Assign a synthesizable initial value to a reg in Verilog

I'm an FPGA noob trying to learn Verilog. How can I "assign" a value to a reg in an always block, either as an initial value, or as a constant. I'm trying to do something like this in the code below..

asp.net Button OnClick event not firing

I have problem in asp.net button control. I define a button in form, onclick event of button is not firing when I click on the button. <asp:Button ID="btn_QuaSave" runat="server" Text="SAVE" OnCl..

Spring MVC - HttpMediaTypeNotAcceptableException

I keep getting this HttpMediaTypeNotAcceptableException error for AJAX requests when using with Spring MVC and JSON.. full stack trace of the error is.. org.springframework.web.HttpMediaTypeNotAcce..

How to get JavaScript variable value in PHP

I want the value of JavaScript variable which i could access using PHP. I am using the code below but it doesn't return value of that variable in PHP. // set global variable in javascript profil..

Sorting table rows according to table header column using javascript or jquery

I have something like this <table> <thead> <tr> <th>S.L.</th> <th>name</th> </tr> </thead> &l..

How can I test a PDF document if it is PDF/A compliant?

We write a software that create PDF files. How we can check if the resulting pdf files are PDF/A compatible? Are there any test suite for it available?..

How do you return the column names of a table?

How would I return the column names of a table using SQL Server 2008? i.e. a table contains these columns- id, name, address, country and I want to return these as data...

How do I show running processes in Oracle DB?

Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who..

Line break (like <br>) using only css

Is it possible in pure css, that is without adding additional html tags, to make a line break like <br>? I want the line break after the <h4> element, but not before: HTML <li> T..

What is "string[] args" in Main class for?

In C# the Main class has string[] args parameter. What is that for and where does it get used?..

Get statistics for each group (such as count, mean, etc) using pandas GroupBy?

I have a data frame df and I use several columns from it to groupby: df['col1','col2','col3','col4'].groupby(['col1','col2']).mean() In the above way I almost get the table (data frame) that I need..

Expected corresponding JSX closing tag for input Reactjs

While creating a component in Reactjs with input fields error occurs Error: Parse Error: Line 47: Expected corresponding JSX closing tag for input at http://localhost/chat-react/src/script.js:47:20 &l..

How to concatenate characters in java?

How do you concatenate characters in java? Concatenating strings would only require a + between the strings, but concatenating chars using + will change the value of the char into ascii and hence givi..

Concatenating date with a string in Excel

I have two cells in Excel. one has a string and the other one has a date. in the third cell I want to put the date and the string together. For example: A1 = "This " A2 = "03/03/1982" I want A3 to..

Check if Cell value exists in Column, and then get the value of the NEXT Cell

After checking if a cell value exists in a column, I need to get the value of the cell next to the matching cell. For instance, I check if the value in cell A1 exists in column B, and assuming it matc..

Sort an Array by keys based on another Array?

Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing. $customer['address'] = '123 fake st'; $customer[..

Uncaught TypeError: Object #<Object> has no method 'movingBoxes'

Im trying to use the movingBoxes plugin with my asp.net mvc site and it is not working (obviously). I have the movingboxes.js imported in my head tag in the site.master like so <script src="&..

How to check if "Radiobutton" is checked?

I would like to make a structure with the condition (if-else) RadioButton I want that when the Radiobutton RB1 is selected, this function is active: regAuxiliar = ultimoRegistro; And when the radi..

AngularJS : ng-click not working

I am new in AngularJs, ng-click is not working as expected. I searched on the internet , Follow the tutorial , (that was working) - but this is not working!!! My Code: <div class="row" ng:repeat..

REST API using POST instead of GET

Let's assume a service offers some funcionality that I can use like this: GET /service/function?param1=value1&param2=value2 Is it right to say that I can use it with a POST query? POST /servic..

jQuery date/time picker

I've been looking around for a decent jQuery plugin that can handle both dates and times. The core UI DatePicker is great, but unfortunately I need to be able to take time in as well. I've found a f..

Read file from resources folder in Spring Boot

I'm using Spring Boot and json-schema-validator. I'm trying to read a file called jsonschema.json from the resources folder. I've tried a few different ways but I can't get it to work. This is my code..

What is the most efficient way to get first and last line of a text file?

I have a text file which contains a time stamp on each line. My goal is to find the time range. All the times are in order so the first line will be the earliest time and the last line will be the lat..

How to output (to a log) a multi-level array in a format that is human-readable?

I'm working on a drupal site and when debugging, I am always having to read through long, nested arrays. As a result, a large portion of my life is spent using the arrow, return, and tab keys, to spli..

PowerShell script to check the status of a URL

Similar to this question here I am trying to monitor if a set of website links are up and running or not responding. I have found the same PowerShell script over the Internet. However, instead of dir..

MySQL: Get column name or alias from query

I'm not asking for the SHOW COLUMNS command. I want to create an application that works similarly to heidisql, where you can specify an SQL query and when executed, returns a result set with rows and..

Change hover color on a button with Bootstrap customization

I am trying to style my buttons in a way that the hover makes the button a lighter shade instead of a darker shade. I tried bootstrap customization page(http://getbootstrap.com/customize/) and it does..

Web Reference vs. Service Reference

I just hit a huge brick wall with Paypal. I had created a regular C# project to create some wrapper classes using their WSDL. If you create a non-web project, the only option you get to add a wsdl i..

After installing SQL Server 2014 Express can't find local db

I have downloaded and installed SQL Server 2014 Express (from this site: http://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx#Installation_Options). The pr..

How to get the employees with their managers

This is what I want the output to look like: Employee Emp# Manager Mgr# BLAKE 7698 KING 7839 CLARK 7782 KING 7839 JONES 7566 KING 7839 MARTIN 7654 BLAKE 7698 A..

Close pre-existing figures in matplotlib when running from eclipse

My question is simple: I have a python script that generates figures using matplotlib. Every time i run it it generates new windows with figures. How can I have the script close windows that were open..

What's "P=NP?", and why is it such a famous question?

The question of whether P=NP is perhaps the most famous in all of Computer Science. What does it mean? And why is it so interesting? Oh, and for extra credit, please post a proof of the statement's t..

Creating random colour in Java?

I want to draw random coloured points on a JPanel in a Java application. Is there any method to create random colours?..

HTML Script tag: type or language (or omit both)?

<script type="text/javascript"> /* ... */ </script> vs. <script language="Javascript"> /* ... */ </script> Which should be used and why? Or, the third alternative..

Passing a 2D array to a C++ function

I have a function which I want to take, as a parameter, a 2D array of variable size. So far I have this: void myFunction(double** myArray){ myArray[x][y] = 5; etc... } And I have decla..

Apache won't run in xampp

I have just installed XAMPP and everything works fine except that I can't get apache to run. It seems that port 80 is the problem, I have disabled Skype to use port 80 but it doesn't seem to fix it. ..

Using a dispatch_once singleton model in Swift

I'm trying to work out an appropriate singleton model for usage in Swift. So far, I've been able to get a non-thread safe model working as: class var sharedInstance: TPScopeManager { get { ..

Why does Boolean.ToString output "True" and not "true"

true.ToString() false.toString(); Output: True False Is there a valid reason for it being "True" and not "true"? It breaks when writing XML as XML's boolean type is lower case, and also isn't comp..

How to display the first few characters of a string in Python?

Hi I just started learning Python but I'm sort of stuck right now. I have hash.txt file containing thousands of malware hashes in MD5, Sha1 and Sha5 respectively separated by delimiters in each line..

C# ASP.NET Single Sign-On Implementation

I am tasked with implementing single sign-on for our customers as part of our next release. The flow exists as follows: User logs into their school's main portal system using a student id/password..

Sum all the elements java arraylist

If I had: ArrayList<Double> m = new ArrayList<Double>(); with the double values ??inside, how should I do to add up all the ArrayList elements? public double incassoMargherita() { double..

How to get the number of threads in a Java process

How can I see the number of threads in a Java process? ..

Vue 'export default' vs 'new Vue'

I just installed Vue and have been following some tutorials to create a project using the vue-cli webpack template. When it creates the component, I notice it binds our data inside of the following: ..

How to POST raw whole JSON in the body of a Retrofit request?

This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request? See similar question here. Or is this..

Javascript to stop HTML5 video playback on modal window close

I've got a html5 video element on a modal window. When I close the window the video continues to play. I'm a total newbie to JS. Is there an easy way to tie a video playback stop function to the wi..

Rails 3 execute custom sql query without a model

I need to write a standalone ruby script that is supposed to deal with database. I used code given below in rails 3 @connection = ActiveRecord::Base.establish_connection( :adapter => "mysql2", :ho..

what is the use of $this->uri->segment(3) in codeigniter pagination

hear is my code public function viewdeletedrecords() { if($this->session->userdata('applicant_firstname') == '') { redirect('papplicant/login') ; } $profile = $this-..

Difference between <context:annotation-config> and <context:component-scan>

I'm learning Spring 3 and I don't seem to grasp the functionality behind <context:annotation-config> and <context:component-scan>. From what I've read they seem to handle different annota..

What is an ORM, how does it work, and how should I use one?

Someone suggested I use an ORM for a project that I'm designing, but I'm having trouble finding information on what it is or how it works. Can anyone give me a brief explanation of what an ORM is an..

MSVCP140.dll missing

I just developed my first program in C++ and I wanted to show it with one of my friends. Sadly, when he tries to open the exe it gets an error which says "MSVCP140.dll is missing". Why is this issue h..

What is the 'realtime' process priority setting for?

From what I've read in the past, you're encouraged not to change the priority of your Windows applications programmatically, and if you do, you should never change them to 'Realtime'. What does the 'R..

Reading a string with scanf

I'm a little bit confused about something. I was under the impression that the correct way of reading a C string with scanf() went along the lines of (never mind the possible buffer overflow, it's ju..

C/C++ macro string concatenation

#define STR1 "s" #define STR2 "1" #define STR3 STR1 ## STR2 Is it possible to concatenate STR1 and STR2, to "s1"? You can do this by passing args to anoth..

When should iteritems() be used instead of items()?

Is it legitimate to use items() instead of iteritems() in all places? Why was iteritems() removed from Python 3? Seems like a terrific and useful method. What's the reasoning behind it? Edit: To clar..

Using PHP to upload file and add the path to MySQL database

Upload.php: <?php //This is the directory where images will be saved $target = "pics"; $target = $target . basename( $_FILES['Filename']['name']); //This gets all the other information f..

Convert Unicode to ASCII without errors in Python

My code just scrapes a web page, then converts it to Unicode. html = urllib.urlopen(link).read() html.encode("utf8","ignore") self.response.out.write(html) But I get a UnicodeDecodeError: Traceb..

Calling Oracle stored procedure from C#?

How does one call a stored procedure in oracle from C#?..

Compare two List<T> objects for equality, ignoring order

Yet another list-comparing question. List<MyType> list1; List<MyType> list2; I need to check that they both have the same elements, regardless of their position within the list. Each My..

Creating an array from a text file in Bash

A script takes a URL, parses it for the required fields, and redirects its output to be saved in a file, file.txt. The output is saved on a new line each time a field has been found. file.txt A Cat..

Singleton: How should it be used

Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design o..

Fixed header table with horizontal scrollbar and vertical scrollbar on

I have been trying to figure out this problem i have with html/css sticky header + scrollbars. We are creating a program that requires scrollbars to show up once the containersize reaches a certain po..

Push item to associative array in PHP

I've been trying to push an item to an associative array like this: $new_input['name'] = array( 'type' => 'text', 'label' => 'First name', 'show' => true, 'required' =>..

Generate class from database table

How can I generate a class from a SQL Server table object? I'm not talking about using some ORM. I just need to create the entities (simple class). Something like: public class Person { ..

What is %2C in a URL?

I'm trying to understand the structure of a URL, and I'm seeing a lot of %2C. I'm guessing this is a result of some encoding. What does that stand for?..

Symfony2 and date_default_timezone_get() - It is not safe to rely on the system's timezone settings

I have a Symfony2 project. I updated my php to 5.5.7 today and since then, I am getting the Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *r..

How do I compare two Integers?

I have to compare two Integer objects (not int). What is the canonical way to compare them? Integer x = ... Integer y = ... I can think of this: if (x == y) The == operator only compares refere..

Difference between CLOB and BLOB from DB2 and Oracle Perspective?

I have been pretty much fascinated by these two data types. According to Oracle Docs, they are presented as follows : BLOB : Variable-length binary large object string that can be up to 2GB (2,147,48..

Javascript array search and remove string?

I have: var array = new Array(); array.push("A"); array.push("B"); array.push("C"); I want to be able to do something like: array.remove("B"); but there is no remove function. How do I accomplish..

Non-alphanumeric list order from os.listdir()

I often use python to process directories of data. Recently, I have noticed that the default order of the lists has changed to something almost nonsensical. For example, if I am in a current directory..

How to update nested state properties in React

I'm trying to organize my state by using nested property like this: this.state = { someProperty: { flag:true } } But updating state like this, this.setState({ someProperty.flag: false ..

Sqlite or MySql? How to decide?

Any good rules of thumb on how to decide which of the two to use? And, if you take over an Sqlite database, and the system is expected to "get much larger", how to decide whether to stick with it or ..

To prevent a memory leak, the JDBC Driver has been forcibly unregistered

I am getting this message when I run my web application. It runs fine but I get this message during shutdown. SEVERE: A web application registered the JBDC driver [oracle.jdbc.driver.OracleDriver]..

How do I show a running clock in Excel?

I'd like to show a clock in cell A1 of Excel 2007. I'm familiar with NOW() and TODAY() but it doesn't refresh itself every 1 minute like I want it to. You know, like a running clock. I just want th..

python ValueError: invalid literal for float()

I've a script which reads temperature data: def get_temp(socket, channels): data = {} for ch in channels: socket.sendall('KRDG? %s\n' % ch) time.sleep(0.2) temp = soc..

Injecting @Autowired private field during testing

I have a component setup that is essentially a launcher for an application. It is configured like so: @Component public class MyLauncher { @Autowired MyService myService; //other methods..

How to insert spaces/tabs in text using HTML/CSS

Possible ways: <pre> ... </pre> or style="white-space:pre" Anything else?..

How to convert an entire MySQL database characterset and collation to UTF-8?

How can I convert entire MySQL database character-set to UTF-8 and collation to UTF-8?..

unique() for more than one variable

I have the following data frame in R: > str(df) 'data.frame': 545227 obs. of 15 variables: $ ykod : int 93 93 93 93 93 93 93 93 93 93 ... $ yad : Factor w/ 42 levels "BAKUGAN","BARBIE",..: ..

Sort a Map<Key, Value> by values

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values. Since the values are not unique, I find myself converting the keySet into an array, and sorting ..

How can I switch language in google play?

I'm doing some statistical analysis about Google Play, comparing different languages. Every time I visit the site (http://play.google.com/store), it always opens in my language. I want to change the l..

Generics/templates in python?

How does python handle generic/template type scenarios? Say I want to create an external file "BinaryTree.py" and have it handle binary trees, but for any data type. So I could pass it the type of..

How can I check if a string represents an int, without using try/except?

Is there any way to tell whether a string represents an integer (e.g., '3', '-17' but not '3.14' or 'asfasfas') Without using a try/except mechanism? is_int('3.14') == False is_int('-7') == True ..

Check whether user has a Chrome extension installed

I am in the process of building a Chrome extension, and for the whole thing to work the way I would like it to, I need an external JavaScript script to be able to detect if a user has my extension ins..

How to call an action after click() in Jquery?

I want to load an image and some other actions after I click a certain DOM element, but I want to load them AFTER the clicking action finished. Here is a code example: $("#message_link").click(func..

Identifying and removing null characters in UNIX

I have a text file containing unwanted null characters (ASCII NUL, \0). When I try to view it in vi I see ^@ symbols, interleaved in normal text. How can I: Identify which lines in the file contain ..

Delete statement in SQL is very slow

I have statements like this that are timing out: DELETE FROM [table] WHERE [COL] IN ( '1', '2', '6', '12', '24', '7', '3', '5') I tried doing one at a time like this: DELETE FROM [table] WHERE [CO..

Get the real width and height of an image with JavaScript? (in Safari/Chrome)

I am creating a jQuery plugin. How do I get the real image width and height with Javascript in Safari? The following works with Firefox 3, IE7 and Opera 9: var pic = $("img") // need to remove the..

Initialize empty vector in structure - c++

I have a struct: typedef struct user { string username; vector<unsigned char> userpassword; } user_t; I need to initialize userpassword with an empty vector: struct user r={"",?}; ..

Comparing results with today's date?

Is there a way to use the Now() function in SQL to select values with today's date? I was under the impression Now() would contain the time as well as date, but today's date would have the time set ..

How to convert an NSString into an NSNumber

How can I convert a NSString containing a number of any primitive data type (e.g. int, float, char, unsigned int, etc.)? The problem is, I don't know which number type the string will contain at runti..

bash assign default value

${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Posit..

postgresql - replace all instances of a string within text field

In postgresql, how do I replace all instances of a string within a database column? Say I want to replace all instances of cat with dog, for example. What's the best way to do this?..

IBOutlet and IBAction

What is the purpose of using IBOutlets and IBActions in Xcode and Interface Builder? Does it make any difference if I don't use IBOutlets and IBActions? Swift: @IBOutlet weak var textField: UITex..

How to declare an ArrayList with values?

ArrayList or List declaration in Java has questioned and answered how to declare an empty ArrayList but how do I declare an ArrayList with values? I've tried the following but it returns a syntax err..

Access parent's parent from javascript object

Something like var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls : function(){ this.SOMETHING.kiss(this.boys); }, ..

Passing arguments to require (when loading module)

Is it possible to pass arguments when loading a module using require? I have module, login.js which provides login functionality. It requires a database connection, and I want the same database conne..

SQL Server add auto increment primary key to existing table

As the title, I have an existing table which is already populated with 150000 records. I have added an Id column (which is currently null). I'm assuming I can run a query to fill this column with inc..

SQL - Rounding off to 2 decimal places

I need to convert minutes to hours, rounded off to 2 decimal places.I also need to display only up to 2 numbers after the decimal point. So if I have minutes as 650.Then hours should be 10.83 Here's ..

Is there a "previous sibling" selector?

The plus sign (+) is for the next sibling. Is there an equivalent for the previous sibling?..

Get value of Span Text

I have a span with class="span" and a hidden field class="dropdown". The span text changes, and I need to grab the text and set it as the value of the hidden field's value. I will then use php (I a..

Why is a primary-foreign key relation required when we can join without it?

If we can get data from two tables without having primary and foreign key relation, then why we need this rule? Can you please explain me clearly, with suitable example? It's a test database, don't mi..

VBA check if object is set

I have a global variable that is an instance of my custom class. How do I check if the object is set or if I need to initialize it?..

ES6 modules implementation, how to load a json file

I'm implementing an example from https://github.com/moroshko/react-autosuggest Important code is like this: import React, { Component } from 'react'; import suburbs from 'json!../suburbs.json'; fu..

What is "X-Content-Type-Options=nosniff"?

I am doing some penetration testing on my localhost with OWASP ZAP, and it keeps reporting this message: The Anti-MIME-Sniffing header X-Content-Type-Options was not set to 'nosniff' This c..

How to declare a variable in MySQL?

How to declare a variable in mysql, so that my second query can use it? I would like to write something like: SET start = 1; SET finish = 10; SELECT * FROM places WHERE place BETWEEN start AND fini..

Default value in an asp.net mvc view model

I have this model: public class SearchModel { [DefaultValue(true)] public bool IsMale { get; set; } [DefaultValue(true)] public bool IsFemale { get; set; } } But based on my researc..

How to set a header for a HTTP GET request, and trigger file download?

Update 20140702: The solution Detailed answer as a blog post (but I'm marking one of the other answers as accepted instead of my own, as it got me halfway there, and to reward the effort) It ap..

dyld: Library not loaded ... Reason: Image not found

When trying to run an executable I've been sent in Mac OS X, I get the following error dyld: Library not loaded: libboost_atomic.dylib Referenced from: /Users/"Directory my executable is in" Reas..

How do you disable viewport zooming on Mobile Safari?

I've tried all three of these to no avail: <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;” /> <meta name=”viewport” co..

Can one AngularJS controller call another?

Is it possible to have one controller use another? For example: This HTML document simply prints a message delivered by the MessageCtrl controller in the messageCtrl.js file. <html xmlns:ng="htt..

Scroll Position of div with "overflow: auto"

Given this HTML snippet: <div id="box" style="overflow:auto; width:200px; height:200px; border:1px solid black;"> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8&..

Ajax call Into MVC Controller- Url Issue

I've looked at the previously-posted jQuery/MVC questions and haven't found a workable answer. I have the following JavaScript code: $.ajax({ type: "POST", url: '@Url.Action("Search","Controller")..

Display all dataframe columns in a Jupyter Python Notebook

I want to show all columns in a dataframe in a Jupyter Notebook. Jupyter shows some of the columns and adds dots to the last columns like in the following picture: How can I display all columns? ..

Uncaught syntaxerror: unexpected identifier?

I can't seem to correct the error the console is talking about can anyone help me. My code is below. I created a web form that saves the data to local storage and displays it on screen then deletes al..

Python 3 TypeError: must be str, not bytes with sys.stdout.write()

I was looking for a way to run an external process from python script and print its stdout messages during the execution. The code below works, but prints no stdout output during runtime. When it exit..

Easy way to prevent Heroku idling?

In the Heroku free apps the dynos seem to keep idling - my app has very low traffic but it's also not really acceptable in my case that my users have to wait 20+ seconds to spin up a new dyno. Frank..

Early exit from function?

I have a function: function myfunction() { if (a == 'stop') // How can I stop the function here? } Is there something like exit() in JavaScript?..

syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

I have been staring at this code for hours now and I cannot figure out where my mistake is. I know this syntax error usually comes up because of some missing or out of place curly brace or some issue ..

Change the location of the ~ directory in a Windows install of Git Bash

I am not even sure I am asking the right question. Let me explain my situation: This is about Git on Windows 7. My company sets up the Windows user directory on a network drive, not on the loca..

Getting the index of the returned max or min item using max()/min() on a list

I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min(). In other words, I need to know which move produced the max (at ..

Storage permission error in Marshmallow

In Lollipop, the download functionality works fine in my app, but when I upgraded to Marshmallow, my app crashes and gives this error when I try to download from the internet into the SD card: Neith..

How to save python screen output to a text file

I'm new to Python. I need to query items from a dict and save the result to a text file. Here's what I have: import json import exec.fullog as e input = e.getdata() #input now is a dict() which has ..

What does the "yield" keyword do?

What is the use of the yield keyword in Python, and what does it do? For example, I'm trying to understand this code1: def _get_child_candidates(self, distance, min_dist, max_dist): if self._lef..

Add default value of datetime field in SQL Server to a timestamp

I've got a table that collects forms submitted from our website, but for some reason, when they created the table, they didn't put a timestamp in the table. I want it to enter the exact date and time ..

Check if a string has a certain piece of text

Possible Duplicates: Check if text is in a string JavaScript: string contains I'm trying to check if a string I import into my application has a certain piece of text. I know how to do th..

Batch file to restart a service. Windows

How can I restart a windows service using a .bat file? I am on windows server...

Regex for remove everything after | (with | )

I was trying to find a solution for my problem. Input: This is the sample title | mypcworld Output: This is the sample title I want to remove everything comes after " | " using simple regex on..

c++ Read from .csv file

I have this code which is supposed to cout in console the information from the .csv file; while(file.good()) { getline(file, ID, ','); cout << "ID: " << ID << " " ; g..

How can I rollback an UPDATE query in SQL server 2005?

How can I rollback an UPDATE query in SQL server 2005? I need to do this in SQL, not through code...

Convert a Unicode string to an escaped ASCII string

How can I convert this string: This string contains the Unicode character Pi(p) into an escaped ASCII string: This string contains the Unicode character Pi(\u03a0) and vice versa? The curren..

Callback functions in C++

In C++, when and how do you use a callback function? EDIT: I would like to see a simple example to write a callback function...

How do I SET the GOPATH environment variable on Ubuntu? What file must I edit?

I am trying to do a go get: go get github.com/go-sql-driver/mysql and it fails with the following error: package github.com/go-sql-driver/mysql: cannot download, $GOPATH not set. For more details ..