Questions Tagged with #Gesture

A gesture is a specific pattern of touch, cursor, or physical movement that may be recognized by an application to perform a specific task.

Draw on HTML5 Canvas using a mouse

I want to draw on a HTML Canvas using a mouse (for example, draw a signature, draw a name, ...) How would I go about implementing this?..

Are HTTP headers case-sensitive?

In a blog post I use the following PHP to set the content-type of a response: header('content-type: application/json; charset=utf-8'); I just got a comment on that post saying that content-type nee..

Visual C++ executable and missing MSVCR100d.dll

I know this has been asked in other places and answered, but I'm having issues with MS Visual Studio 2010. I've developed a C++ executable but if I run the Release version on a machine that doesn't ha..

Uploading Files in ASP.net without using the FileUpload server control

How can I get an ASP.net web form (v3.5) to post a file using a plain old <input type="file" />? I am not interested in using the ASP.net FileUpload server control...

How do I check if a cookie exists?

What's a good way to check if a cookie exist? Conditions: Cookie exists if cookie1=;cookie1=345534; //or cookie1=345534;cookie1=; //or cookie1=345534; Cookie doesn't exist if cookie=; //or <b..

Function to return only alpha-numeric characters from string?

I'm looking for a php function that will take an input string and return a sanitized version of it by stripping away all special characters leaving only alpha-numeric. I need a second function that d..

intelliJ IDEA 13 error: please select Android SDK

I have installed Android SDK 22.3 and JDK 1.7 update 21 on Win7 x64. Now I created an empty android application project using intelliJ 13.0.1 (also use Emulator as target device) and tried to build th..

How to grant remote access to MySQL for a whole subnet?

I can easily grant access to one IP using this code: $ mysql -u root -p Enter password: mysql> use mysql mysql> GRANT ALL ON *.* to root@'192.168.1.4' IDENTIFIED BY 'your-root-password'..

I am getting an "Invalid Host header" message when connecting to webpack-dev-server remotely

I am using as an environment, a Cloud9.io ubuntu VM Online IDE and I have reduced by troubleshooting this error to just running the app with Webpack dev server. I launch it with: webpack-dev-server..

Docker Repository Does Not Have a Release File on Running apt-get update on Ubuntu

I am using Ubuntu 16.10 and recently installed Docker (v1.12.4) using the Xenial build by following the instructions found here. I haven't encountered any problems creating containers, ensuring they r..

Django template how to look up a dictionary value with a variable

mydict = {"key1":"value1", "key2":"value2"} The regular way to lookup a dictionary value in a Django template is {{ mydict.key1 }}, {{ mydict.key2 }}. What if the key is a loop variable? ie: {% fo..

Angular HttpClient "Http failure during parsing"

I try to send an POST request from Angular 4 to my Laravel backend. My LoginService has this method: login(email: string, password: string) { return this.http.post(`http://10.0.1.19/login`, { em..

How to copy a file to another path?

I need to copy a file to another path, leaving the original where it is. I also want to be able to rename the file. Will FileInfo's CopyTo method work?..

Calculate mean and standard deviation from a vector of samples in C++ using Boost

Is there a way to calculate mean and standard deviation for a vector containing samples using Boost? Or do I have to create an accumulator and feed the vector into it?..

Oracle Partition - Error ORA14400 - inserted partition key does not map to any partition

I'm trying to insert information in a partition table, but I don't know what I'm doing wrong! Show me this error: ORA-14400: inserted partition key does not map to any partition" The table dba_tab_pa..

Switching from zsh to bash on OSX, and back again?

So Im learning to develop in Rails, and have discovered the power of zsh. However, for some of my other tasks, I wish to use normal Bash. Although they are the same, I just feel comfortable with the l..

Setting up Eclipse with JRE Path

I have downloaded and extracted Eclipse. I have Eclipse in the following directory: C:\Applications\eclipse. When I try and run the executable , I get the following message : I currently have the f..

kubectl apply vs kubectl create?

What I understood by the documentation is that: kubectl create = Creates a new k8s resource in the cluster kubectl replace = Updates a resource in the live cluster kubectl apply = If I want to do cr..

Create an Oracle function that returns a table

I'm trying to create a function in package that returns a table. I hope to call the function once in the package, but be able to re-use its data mulitple times. While I know I create temp tables in ..

inherit from two classes in C#

Possible Duplicate: Multiple Inheritance in C# I have two classes Class A and Class B. These two classes cannot inherit each other. I am creating new class called Class C. Now, I want to implement ..

Change color of PNG image via CSS?

Given a transparent PNG displaying a simple shape in white, is it possible to somehow change the color of this through CSS? Some kind of overlay or what not?..

Push method in React Hooks (useState)?

How to push element inside useState array React hook? Is that as an old method in react state? Or something new? E.g. setState push example ?..

Difference between Python's Generators and Iterators

What is the difference between iterators and generators? Some examples for when you would use each case would be helpful...

How do change the color of the text of an <option> within a <select>?

I am trying to change the color of the first option to grey color, that only the text (select one option) but here it's not working here: _x000D_ _x000D_ .grey_color {_x000D_ color: #ccc;_x000D_ ..

set option "selected" attribute from dynamic created option

I have a dynamically created select option using a javascript function. the select object is <select name="country" id="country"> </select> when the js function is executed, the "countr..

Format output string, right alignment

I am processing a text file containing coordinates x, y, z 1 128 1298039 123388 0 2 .... every line is delimited into 3 items using words = line.split() After processing..

How to add a classname/id to React-Bootstrap Component?

Suppose we are using Row from React-Bootstrap... How do we style it without using a wrapper or inner element: <Row> <div className='some-style'> ... </Row> Ideally, we could ju..

Retrieve data from website in android app

How can we retrieve data from a website and parse it into a readable format in the Android application? This means I want to extract data from website and use it in my android application, formatted i..

PHP cURL GET request and request's body

i'm trying using cURL for a GET request like this: function connect($id_user){ $ch = curl_init(); $headers = array( 'Accept: application/json', 'Content-Type: application/json', ..

Clear Cache in Android Application programmatically

what is the correct way to clear cache in android Application programmatically. I already using following code but its not look work for me @Override protected void onDestroy() { // TODO Auto-gen..

Can I remove the URL from my print css, so the web address doesn't print?

I have written some stylesheets - including a print.css - and it's working fine. I'd like to remove the URL from printing out on each of the pages. I am beginning to wonder if it is impossible. Is t..

VBA: activating/selecting a worksheet/row/cell

Hello Stackoverflowers, I'm trying to use a button, that first goes to another excel file in a specific directory. While performing something, I want to add a row in a sheet the excel file i'm runnin..

Serial Port (RS -232) Connection in C++

I have done serial port RS-232 connection in C++ using 16-bit compiler (I was using Turbo C++ IDE). It included header file bios.h which contain all the required functions for reading values from the ..

Excel VBA - Delete empty rows

I would like to delete the empty rows my ERP Quotation generates. I'm trying to go through the document (A1:Z50) and for each row where there is no data in the cells (A1-B1...Z1 = empty, A5-B5...Z5 = ..

Excel Calculate the date difference from today from a cell of "7/6/2012 10:26:42"

So I have a cell with 7/6/2012 10:26:42 inputted, I want to show the date difference from today in another cell. I tried to extract 7/6/2012 with =LEFT(A1, Find(" ", A1, 1) -1) but turned out theres..

Android, How to limit width of TextView (and add three dots at the end of text)?

I have a TextView that I want to limit characters of it. Actually, I can do this but the thing that I'm looking for is how to add three dots (...) at the end of string. This one shows the text has con..

In LINQ, select all values of property X where X != null

Is there a shorter way to write the following? (Something that would check for null without explicitly writing != null) from item in list where item.MyProperty != null select item.MyProperty ..

Python - Get path of root project structure

I've got a python project with a configuration file in the project root. The configuration file needs to be accessed in a few different files throughout the project. So it looks something like: <..

Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM

Is it possible to create user-defined exceptions and be able to change the SQLERRM? For example: DECLARE ex_custom EXCEPTION; BEGIN RAISE ex_custom; EXCEPTION WHEN ex_custom THEN ..

How do I clone a range of array elements to a new array?

I have an array X of 10 elements. I would like to create a new array containing all the elements from X that begin at index 3 and ends in index 7. Sure I can easily write a loop that will do it for me..

What is the difference between C# and .NET?

May I know what is the difference between C# and .NET? When I think of C#, right away I would say it is a .NET language, but when I search for job posts, they require candidates to have C# and .NET ex..

document.getElementById().value and document.getElementById().checked not working for IE

I tried to assign a new value into the hidden input and checkbox of an input form. It's working fine in Firefox but not in IE (I'm using IE 7). Does anyone know what is wrong with my code? HTML: <..

How to check if std::map contains a key without doing insert?

The only way I have found to check for duplicates is by inserting and checking the std::pair.second for false, but the problem is that this still inserts something if the key is unused, whereas what I..

Javascript: 'window' is not defined

I'm trying to learn JavaScript, but the following code has been giving me a lot of trouble: window.onload = function () { for ( var i = 0; i < seats.length; i++) { for ( var j = 0; j &..

What is the purpose of the word 'self'?

What is the purpose of the self word in Python? I understand it refers to the specific object created from that class, but I can't see why it explicitly needs to be added to every function as a parame..

Can a table row expand and close?

Is it possible to make a table row expand and collapse? Can anyone refer me to a script or an example? I prefer jQuery if possible. I have a drawing concept I would like to achieve: ..

What do column flags mean in MySQL Workbench?

In MySQL Workbench table editor there are 7 column flags available: PK, NN, UQ, BIN, UN, ZF, AI. PK obviously stands for Primary Key. What about others?..

How to base64 encode image in linux bash / shell

I'm trying to base64 encode an image in a shell script and put it into variable: test="$(printf DSC_0251.JPG | base64)" echo $test RFNDXzAyNTEuSlBH I've also tried something like this: test=\`echo..

Creating CSS Global Variables : Stylesheet theme management

Is there a way to set global variables in css such as: @Color1 = #fff; @Color2 = #b00; h1 { color:@Color1; background:@Color2; } ..

libstdc++.so.6: cannot open shared object file: No such file or directory

I want to run Cilkscreen command with a cilk++ program but I'v got this error /usr/local/cilk/bin/../lib32/pinbin: error while loading shared libraries: libstdc++.so.6: cannot open shared objec..

PHP "pretty print" json_encode

Possible Duplicate: Pretty-Printing JSON with PHP I'm working on a script that creates a JSON file. Right now I'm just using json_encode (PHP 5.2.x) to encode an array into JSON output. The..

TypeScript: Property does not exist on type '{}'

I am using Visual Studio 2013 fully patched. I am trying to use JQuery, JQueryUI and JSRender. I am also trying to use TypeScript. In the ts file I'm getting an error as follows: Property 'fadeDiv' ..

INSERT VALUES WHERE NOT EXISTS

OK so I'm trying to improve my asp data entry page to ensure that the entry going into my data table is unique. So in this table I have SoftwareName and SoftwareType. I'm trying to get it so if the e..

How do you convert an entire directory with ffmpeg?

How do you convert an entire directory/folder with ffmpeg via command line or with a batch script?..

IF function with 3 conditions

I'm looking to create a formula with 3 conditions. It is currently only working with 2 conditions. Here's what I'm looking for: E9 has a number If the number is 21+ then I want it to show Text 1 I..

How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as - struct node { int data; struct node *left; struct node *right; }; The maximum solu..

combining results of two select statements

I'm using T-SQL with ASP.NET, and c# and i'm pretty new to SQL. I was wondering how i could combine the results of two queries Query1: SELECT tableA.Id, tableA.Name, [tableB].Username AS Owner, [t..

Access Form - Syntax error (missing operator) in query expression

I am receiving a syntax error in a form that I have created over a query. I created the form to restrict access to changing records. While trying to set filters on the form, I receive syntax errors ..

How can I use a C++ library from node.js?

How can I use a C++ library from node.js?..

How to import component into another root component in Angular 2

I am trying to import component from one file another root component file. it give error as .. zone.js:484 Unhandled Promise rejection: Template parse errors: 'courses' is not a known element: ..

Ruby 2.0.0p0 IRB warning: "DL is deprecated, please use Fiddle"

I just uninstalled my older versions of Ruby, removed all of my gems (including Rails), and installed Ruby 2.0. In other words, a totally clean re-install. Upon starting IRB, I received this message: ..

What's the difference between Thread start() and Runnable run()

Say we have these two Runnables: class R1 implements Runnable { public void run() { … } … } class R2 implements Runnable { public void run() { … } … } Then what's the diffe..

Relative Paths in Javascript in an external file

So I'm running this javascript, and everything works fine, except the paths to the background image. It works on my local ASP.NET Dev environment, but it does NOT work when deployed to a server in a v..

String to Dictionary in Python

So I've spent way to much time on this, and it seems to me like it should be a simple fix. I'm trying to use Facebook's Authentication to register users on my site, and I'm trying to do it server side..

Extracting specific columns in numpy array

This is an easy question but say I have an MxN matrix. All I want to do is extract specific columns and store them in another numpy array but I get invalid syntax errors. Here is the code: extractedD..

Hamcrest compare collections

I'm trying to compare 2 lists: assertThat(actual.getList(), is(Matchers.containsInAnyOrder(expectedList))); But idea java: no suitable method found for assertThat(java.util.List<Agent>,org...

failed to lazily initialize a collection of role

Hi I have two classes like this: public class Indicator implements Serializable { ... @OneToMany(mappedBy = "indicator",fetch=FetchType.LAZY) private List<IndicatorAlternateLabel> ind..

Failed to load resource: the server responded with a status of 404 (Not Found) error in server

I'm trying to load up image in my Image Folder, but it's not working. Upon debugging, I see this error: Failed to load resource: the server responded with a status of 404 (Not Found) My image..

How to to send mail using gmail in Laravel?

I try again and again to test sending an email from localhost but I still cannot. I don't know anymore how to do it. I try search to find solution but I cannot find one. I edited config/mail.php: &l..

How do you do a ‘Pause’ with PowerShell 2.0?

OK, I'm losing it. PowerShell is annoying me. I'd like a pause dialog to appear, and it won't. PS W:\>>> $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") Exception calling "ReadKey" with "1" ..

Compress files while reading data from STDIN

Is it possible to compress (create a compressed archive) data while reading from stdin on Linux?..

simple way to display data in a .txt file on a webpage?

Working on a project, one of the webpages will display a list of people (specifically, a list of people from a graduation class that haven't been located yet). Instead of manually updating these lists..

JSR 303 Validation, If one field equals "something", then these other fields should not be null

I'm looking to do a little custom validation with JSR-303 javax.validation. I have a field. And If a certain value is entered into this field I want to require that a few other fields are not null. ..

jQuery ajax error function

I have an ajax call passing data to a page which then returns a value. I have retrieved the successful call from the page but i have coded it so that it raises an error in the asp. How do i retrieve ..

How do I turn off Oracle password expiration?

I'm using Oracle for development. The password for a bootstrap account that I always use to rebuild my database has expired. How do I turn off password expiration for this user (and all other users)..

Performing Breadth First Search recursively

Let's say you wanted to implement a breadth-first search of a binary tree recursively. How would you go about it? Is it possible using only the call-stack as auxiliary storage?..

How to perform a LEFT JOIN in SQL Server between two SELECT statements?

I have two SELECT statements in SQL Server like these: (SELECT [UserID] FROM [User]) (SELECT [TailUser], [Weight] FROM [Edge] WHERE [HeadUser] = 5043) I want to perform a LEFT JOIN between these tw..

How to include the reference of DocumentFormat.OpenXml.dll on Mono2.10?

I am using C#.net Windows Desktop Application.I want to run these application with other platform also. So, i am using Mono 2.10 as a cross compiler.While running,unexpectedly my Application is termin..

Parse XML document in C#

Duplicate: This is a duplicate of Best practices to parse xml files with C#? and many others (see https://stackoverflow.com/search?q=c%23+parse+xml). Please close it and do not answer. How do you p..

.autocomplete is not a function Error

below is my My Code <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> ..

How to read an http input stream

The code pasted below was taken from java docs on HttpURLConnection. I get the following error: readStream(in) as there is no such method. I see this same thing in the Class Overview for URLC..

Local dependency in package.json

I want to do something like this, so npm install also installs the package.json of ../somelocallib or more importantly its dependencies. "dependencies": { "express": "*", "../somelocallib": "..

Python ValueError: too many values to unpack

I am getting that exception from this code: class Transaction: def __init__ (self): self.materials = {} def add_material (self, m): self.materials[m.type + m.purity] = m ..

Any way to make plot points in scatterplot more transparent in R?

I have a 3 column matrix; plots are made by points based on column 1 and column 2 values, but colored based on column 2 (6 different groups). I can successfully plot all points, however, the last plot..

WCF service startup error "This collection already contains an address with scheme http"

I built a web application containing a WCF service contract and a Silverlight control which makes calls to that WCF service. On my development and test servers it works great. When I deploy to our l..

"Please try running this command again as Root/Administrator" error when trying to install LESS

I'm trying to install LESS on my machine and have installed node already. However, when I enter "node install -g less" I get the following error and am not sure what to do? FPaulMAC:bin paul$ npm ins..

How does collections.defaultdict work?

I've read the examples in python docs, but still can't figure out what this method means. Can somebody help? Here are two examples from the python docs >>> from collections import defaultdic..

How do I request and process JSON with python?

I am trying to send a GET request to a URL that I know returns data in the form of JSON using python. I would like to know how to send this request to http://someurl/path/to/json, and how to parse i..

Component based game engine design

I have been looking at game engine design (specifically focused on 2d game engines, but also applicable to 3d games), and am interested in some information on how to go about it. I have heard that ma..

Is it possible to use Visual Studio on macOS?

I want to install Visual Studio on macOS. Is this possible?..

Setting transparent images background in IrfanView

I have some PNG images which consist of a black shape and a transparent background. Unfortunately, IrfanView shows transparent background as black color, so I see just black on black. I've found in Ir..

Getting unix timestamp from Date()

I can convert a unix timestamp to a Date() object by putting the long value into the Date() constructor. For eg: I could have it as new Date(1318762128031). But after that, how can I get back the un..

SSIS package creating Hresult: 0x80004005 Description: "Login timeout expired" error

I have an SSIS package that is being executed by an SQL Job which runs twice a day. I recently updated the SSIS package by removing a where clause of a Select statement in it. Now the results have aro..

How to check if a database exists in SQL Server?

What is the ideal way to check if a database exists on a SQL Server using TSQL? It seems multiple approaches to implement this...

Subtract two dates in Java

Possible Duplicate: Calculating the Difference Between Two Java Date Instances I know this might be a duplicate thread. But I am trying to figure out a way to compute the difference between..

How can I force a hard reload in Chrome for Android

In Chrome for desktop I have options in the dev tools to disable cache completely when dev tools are opened and I have the options to manually do a hard reload when long clicking on the reload button ..

How can I open the interactive matplotlib window in IPython notebook?

I am using IPython with --pylab=inline and would sometimes like to quickly switch to the interactive, zoomable matplotlib GUI for viewing plots (the one that pops up when you plot something in a termi..

How to solve "sign_and_send_pubkey: signing failed: agent refused operation"?

Configuring a new Digital Ocean droplet with SSH keys. When I run ssh-copy-id this is what I get: ssh-copy-id [email protected] /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), ..

How to check for palindrome using Python logic

I'm trying to check for a palindrome with Python. The code I have is very for-loop intensive. And it seems to me the biggest mistake people do when going from C to Python is trying to implement C log..

'const int' vs. 'int const' as function parameters in C++ and C

Consider: int testfunc1 (const int a) { return a; } int testfunc2 (int const a) { return a; } Are these two functions the same in every aspect or is there a difference? I'm interested in an a..

How to use mysql JOIN without ON condition?

Is it possible to write join query without ON statement? and how do these joins differ LEFT JOIN, RIGHT JOIN works...

CSS : center form in page horizontally and vertically

How can i center the form called form_login horizontally and vertically in my page ? Here is the HTML I'm using right now: <body> <form id="form_login"> <p> ..

How to create range in Swift?

In Objective-c we create range by using NSRange NSRange range; So how to create range in Swift?..

MySQL and PHP - insert NULL rather than empty string

I have a MySQL statement that inserts some variables into the database. I recently added 2 fields which are optional ($intLat, $intLng). Right now, if these values are not entered I pass along an emp..

VBA array sort function?

I'm looking for a decent sort implementation for arrays in VBA. A Quicksort would be preferred. Or any other sort algorithm other than bubble or merge would suffice. Please note that this is to work ..

Generate sha256 with OpenSSL and C++

I'm looking to create a hash with sha256 using openssl and C++. I know there's a similar post at Generate SHA hash in C++ using OpenSSL library, but I'm looking to specifically create sha256. UPDATE:..

Javac is not found

I'm running Windows 8 and I can not get javac to work. I have set my PATH in environmental variables to C:\Program Files (x86)\Java\jdk1.7.0_17\bin I have tried both with and without ';' but to ..

Java8: HashMap<X, Y> to HashMap<X, Z> using Stream / Map-Reduce / Collector

I know how to "transform" a simple Java List from Y -> Z, i.e.: List<String> x; List<Integer> y = x.stream() .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()..

How to write "Html.BeginForm" in Razor

If I write like this: form action="Images" method="post" enctype="multipart/form-data" it works. But in Razor with '@' it doesn't work. Did I make any mistakes? @using (Html.BeginForm("Upload..

Objects inside objects in javascript

I'm somewhat new to Javascript, so maybe this is just a noob mistake, but I haven't found anything that specifically helps me while looking around. I'm writing a game, and I'm trying to build an objec..

How to do joins in LINQ on multiple fields in single join

I need to do a LINQ2DataSet query that does a join on more than one field (as var result = from x in entity join y in entity2 on x.field1 = y.field1 and x.field2 = y.field2 I ha..

Getting the error "Missing $ inserted" in LaTeX

I try to write the following in latex: \begin{itemize} \item \textbf{insert(element|text)} inserts the element or text passed at the start of the selection. \item \textbf{insert_after(element..

How do I install Java on Mac OSX allowing version switching?

I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK's since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path but that is hard to maintain...

registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later

When trying to register for push notifications under iOS 8.x: application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType..

Insert variable into Header Location PHP

The question is: How do i insert the variable (echo $url_endpoint;) as a part of the link in the last line: header('Location: http://linkhere.com/HERE_I_WANT_THE_VARIABLE'); <?php $url_endpoint = ..

How do I share variables between different .c files?

beginner question about C declaration: In a .c file, how to use variables defined in another .c file?..

How to generate XML from an Excel VBA macro?

So, I've got a bunch of content that was delivered to us in the form of Excel spreadsheets. I need to take that content and push it into another system. The other system takes its input from an XML fi..

Int to byte array

I thought .net had some kind of easy conversion method to use for converting an int into a byte array? I did a quick search and all solutions are bit masking/shifting one byte at a time, like "the goo..

how to delete installed library form react native project

I have installed a third party library in my project but it is not working , so I want to delete that library from my project , How can I do that ?..

Android: How to handle right to left swipe gestures

I want my app to recognize when a user swipes from right to left on the phone screen. How to do this?..

Calling a function when ng-repeat has finished

What I am trying to implement is basically a "on ng repeat finished rendering" handler. I am able to detect when it is done but I can't figure out how to trigger a function from it. Check the fiddle:..

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document.g..

Git mergetool generates unwanted .orig files

When I do a merge conflict resolution with Kdiff3 (and other merge tool I tried) I noticed that on resolution a *.orig file is created. Is there a way for it to not create that extra file?..

undefined reference to 'std::cout'

Shall this be the example: #include <iostream> using namespace std; int main() { cout << "Hola, moondo.\n"; } It throws the error: gcc -c main.cpp gcc -o edit main.o main.o: In fu..

Changing the action of a form with JavaScript/jQuery

I'm having an issue that is driving me crazy. I'm trying to modify the openid-selector to support facebook. I'm using RPXNow as my provider so it requires the form to be submitted to a different url t..

How to visualize an XML schema?

I have made an XML Schema - all the code basically - and was wondering if there is a way that the code can generate something like this: If so how can I do it?..

Json.net serialize/deserialize derived types?

json.net (newtonsoft) I am looking through the documentation but I can't find anything on this or the best way to do it. public class Base { public string Name; } public class Derived : Base { ..

How do I apply the for-each loop to every character in a String?

So I want to iterate for each character in a string. So I thought: for (char c : "xyz") but I get a compiler error: MyClass.java:20: foreach not applicable to expression type How can I do this?..

Python FileNotFound

I am fairly new to python. I am trying to make a script that will read sudoku solutions and determent if they are correct or not. Things I need: 1] Prompt the user to enter a file/file path which i..

Initial size for the ArrayList

You can set the initial size for an ArrayList by doing ArrayList<Integer> arr=new ArrayList<Integer>(10); However, you can't do arr.add(5, 10); because it causes an out of bounds exc..

CSS Div stretch 100% page height

I have a navigation bar on the left hand side of my page, and I want it to stretch to 100% of the page height. Not just the height of the viewport, but including the areas hidden until you scroll. I d..

How to Install Font Awesome in Laravel Mix

I've tried to install Font Awesome using Laravel Mix but when executing run npm dev I get the following message: ERROR Failed to compile with 1 errors error in ./~/font-awesome/scss/font-aweso..

Thin Black Border for a Table

I need to have such thin line for the whole table as seen above. The above image is a sample only. My solution, doesn't work. The table shows no border at all. Here is my CSS: table { border-w..

Amazon Linux: apt-get: command not found

I'm trying to install an apache server on my AWS instance, however, it seems that it doesn't have the apt package installed. I googled and all I found was some broken links to this package. I am usin..

MySQL Data Source not appearing in Visual Studio

I just installed the ADO.NET connector from here http://dev.mysql.com/downloads/connector/net/ Yet MySQL doesn't appear as a data source like it should. I tried restarting Visual Studio. It doesn't f..

Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function

I'm trying to send a call using Ajax but in Chrome it is rising error but in Firefox there is no error. But still it can't calling the method. I tried to record my call in Firebug but there is no call..

Image.open() cannot identify image file - Python?

I am running Python 2.7 in Visual Studio 2013. The code previously worked ok when in Spyder, but when I run: import numpy as np import scipy as sp import math as mt import matplotlib.pyplot as plt im..

Dialog throwing "Unable to add window — token null is not for an application” with getApplication() as context

My Activity is trying to create an AlertDialog which requires a Context as a parameter. This works as expected if I use: AlertDialog.Builder builder = new AlertDialog.Builder(this); However, I am l..

Storing and retrieving datatable from session

How to store a datatable in session and to retrieve the values from the session in c#.net?..

How to mock location on device?

How can I mock my location on a physical device (Nexus One)? I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device...

How to delete a record by id in Flask-SQLAlchemy

I have users table in my MySql database. This table has id, name and age fields. How can I delete some record by id? Now I use the following code: user = User.query.get(id) db.session.delete(user) ..

How to set Sqlite3 to be case insensitive when string comparing?

I want to select records from sqlite3 database by string matching. But if I use '=' in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-ins..

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..

Ajax using https on an http page

My site uses http and https protocol; it doesn't affect the content. My site uses jQuery ajax calls, which fills some areas on the page, too. Now, I would like to do all ajax calls over https. (plea..

C/C++ check if one bit is set in, i.e. int variable

int temp = 0x5E; // in binary 0b1011110. Is there such a way to check if bit 3 in temp is 1 or 0 without bit shifting and masking. Just want to know if there is some built in function for this, or ..

R numbers from 1 to 100

Possible Duplicate: How to generate a vector containing a numeric sequence? In R, how can I get the list of numbers from 1 to 100? Other languages have a function 'range' to do this. R's ra..

SQL Server IIF vs CASE

I recently came to know about the availability of IIF function in SQL Server 2012. I always use nested CASE in my queries. I want to know the exact purpose of the IIF statement and when should we pref..

Turn a number into star rating display using jQuery and CSS

I have been looking at jquery plugin and was wondering how to adapt that plugin to turn a number (like 4.8618164) into a 4.8618164 stars filled out of 5. Basically interpreting a number <5 into sta..

OpenCV & Python - Image too big to display

I have an image that is 6400 × 3200, while my screen is 1280 x 800. Therefore, the image needs to be resized for display only. I am using Python and OpenCV 2.4.9. According to OpenCV Documentation, ..

How to change the DataTable Column Name?

I have one DataTable which has four columns such as StudentID CourseID SubjectCode Marks ------------ ---------- ------------- -------- 1 ..

jQuery count number of divs with a certain class?

Considering something like this; <div class="wrapper"> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div cla..

Running Python from Atom

In Sublime, we have an easy and convent way to run Python or almost any language for that matter using ? + b (or ctrl + b) Where the code will run in a small window below the source code and can easi..

how to set mongod --dbpath

very new to mongodb and databases in general. whenever i run mongo i receive this error message: ​​​ MongoDB shell version: 2.4.9 connecting to: test Thu Jan 30 13:03:33.170 Error: ..

How to update PATH variable permanently from Windows command line?

If I execute set PATH=%PATH%;C:\\Something\\bin from the command line (cmd.exe) and then execute echo %PATH% I see this string added to the PATH. If I close and open the command line, that new string ..

What is the Java equivalent for LINQ?

What is Java equivalent for LINQ?..

SASS :not selector

I have a :not css selector in SASS mixin but it doesn't do anything: Code Snippet: @mixin dropdown-pos($pos:right) { &:not(.notip) { @if $comp-tip == true{ @if $pos == right { ..

Why is IoC / DI not common in Python?

In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web applicat..

angularjs make a simple countdown

I would like make a countDown with Angular js. this is my code: Html File <div ng-app ng-controller = "countController"> {{countDown}} <div>??????????????????????????????????????????????..

Setting the target version of Java in ant javac

I need to compile a jar file using ant (1.7.0) to run under a specific version of Java (1.5). I currently have Java 1.6 on my machine. I have tried setting: <target name="compile"> <javac ..

What is the reason for the error message "System cannot find the path specified"?

I have folder run in folder system32. When I run cmd from within Total Commander opening a command prompt window with C:\Users\admin as current directory and want to go into that folder, the following..

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 ..

How do I get 'date-1' formatted as mm-dd-yyyy using PowerShell?

How does one get date-1 and format it to mm-dd-yyyy in PowerShell? Example: If today is November 1, 2013, and I need 10-31-2013 in my code. I've used AddDays(-1) before, but I can't seem to get it t..

Custom method names in ASP.NET Web API

I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web API. I have a UsersController, and I want to have a method named Authenticate. I see examples of how to do GetAll, GetOne, Post, and De..

Git: How to reset a remote Git repository to remove all commits?

How can I reset a remote and local Git repository to remove all commits? I would like to start fresh with the current Head as the initial commit...

SecurityError: The operation is insecure - window.history.pushState()

I'm getting this error in Firefox's Console: SecurityError: The operation is insecure and the guilty is HTML5 feature: window.history.pushState() when I try to load something with AJAX. It is supposed..

Browser detection in JavaScript?

How do I determine the exact browser and version using JavaScript?..

How to get access token from FB.login method in javascript SDK

I need to get the access token from FB.login method in Javascript SDK. My login code is FB.login(function(response) { if (response.session) { if (response.perms) { } else { ..

RuntimeWarning: DateTimeField received a naive datetime

I m trying to send a simple mail using IPython. I have not set up any models still getting this error. What can be done? Error : /home/sourabh/Django/learn/local/lib/python2.7/site-packages/djan..

How can I count the number of elements with same class?

I have a main div in my page with a specific id. Now some input elements of the same class are present in this div. So how can I count the number of these elements of same class in this div using jQue..

Remove all special characters with RegExp

I would like a RegExp that will remove all special characters from a string. I am trying something like this but it doesn’t work in IE7, though it works in Firefox. var specialChars = "!@#$^&%*..

Python urllib2: Receive JSON response from url

I am trying to GET a URL using Python and the response is JSON. However, when I run import urllib2 response = urllib2.urlopen('https://api.instagram.com/v1/tags/pizza/media/XXXXXX') html=response.rea..

How to install a node.js module without using npm?

There are quite a few modules which are listed on node's github page but are not published with the npm-registry. These modules can't be installed using npm. What is the correct way to install these..

Disable and enable buttons in C#

I am working on something fairly simple, well I thought it would be. What I want is when button1 is clicked I want it to disable button1 and enable button2. I get the error below: Error 1 Only ass..

Extracting a parameter from a URL in WordPress

I am trying to pass a parameter to a WordPress site using a URL - for instance: www.fioriapts.com/?ppc=1 will be the URL. I am intending to write a function in the functions.php file but the mecha..

DISTINCT clause with WHERE

How can I use the DISTINCT clause with WHERE? For example: SELECT * FROM table WHERE DISTINCT email; -- email is a column name I want to select all columns from a table with distinct email addresse..

break/exit script

I have a program that does some data analysis and is a few hundred lines long. Very early on in the program, I want to do some quality control and if there is not enough data, I want the program to..

Iterating through a variable length array

How do I iterate over a Java array of variable length. I guess I would setup a while loop, but how would I detect that I have reached the end of the array. I guess I want something like this [just ..

Java Wait and Notify: IllegalMonitorStateException

I don't completely understand how wait and notify (of Object) work, and as a result I'm forced to slim down my attempts into the following section of code. Main.java: import java.util.ArrayList; cl..

How to get the position of a character in Python?

How can I get the position of a character inside a string in python?..

Eclipse "this compilation unit is not on the build path of a java project"

I can't get autocompletion to work on Eclipse. I'm working on the project on svn. I set up project in Eclipse by going into File -> Import -> Checkout As a Project -> New Project Wizard. I choos..

How to install OpenSSL for Python

I need to install OpenSSL on my python2.7. I tried $ pip install pyopenssl And I got the following /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'..

Where does Jenkins store configuration files for the jobs it runs?

I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirel..

Crop image in PHP

The code below crops the image well, which is what i want, but for larger images, it wotn work as well. Is there any way of 'zooming out of the image' Idealy i would be able to have each image roughl..

Changing the space between each item in Bootstrap navbar

How can I create a larger space between each link on my navbar, so they are further apart? Is it something I change the CSS or HTML? Here's how I've implemented my navbar in the html: <div class="..

How can I open Windows Explorer to a certain directory from within a WPF app?

In a WPF application, when a user clicks on a button I want to open the Windows explorer to a certain directory, how do I do that? I would expect something like this: Windows.OpenExplorer("c:\test")..

Comparing two maps

I have two maps declared as Map<String, Object>. The Object here could be another Map<String, Object> (and so on). I want to check if two maps are exactly the same without knowing their de..

TypeError: unhashable type: 'dict', when dict used as a key for another dict

I have this piece of code: for element in json[referenceElement].keys(): When I run that code, I get this error: TypeError: unhashable type: 'dict' What is the cause of that error and what ca..

What happens to a declared, uninitialized variable in C? Does it have a value?

If in C I write: int num; Before I assign anything to num, is the value of num indeterminate?..

How to install toolbox for MATLAB

I am just wondering, if I need a toolbox which not available in my MATLAB, how do I do that? For example: if I need image processing toolbox, how do I get it?..

Sql Server equivalent of a COUNTIF aggregate function

I'm building a query with a GROUP BY clause that needs the ability to count records based only on a certain condition (e.g. count only records where a certain column value is equal to 1). SELECT UID..

Pass Array Parameter in SqlCommand

I am trying to pass array parameter to SQL commnd in C# like below, but it does not work. Does anyone meet it before? string sqlCommand = "SELECT * from TableA WHERE Age IN (@Age)"; SqlConnection sq..

Iterate over each line in a string in PHP

I have a form that allows the user to either upload a text file or copy/paste the contents of the file into a textarea. I can easily differentiate between the two and put whichever one they entered in..

AttributeError: 'str' object has no attribute 'strftime'

I am using the following code to use the date in a specific format and running into following error..how to put date in m/d/y format? from datetime import datetime, date def main (): cr_date = '..

How to terminate a process in vbscript

How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process) Thanks,..

How to load image (and other assets) in Angular an project?

I'm pretty new to Angular so I'm not sure the best practice to do this. I used angular-cli and ng new some-project to generate a new app. In it created an "images" folder in the "assets" folder, s..

Powershell Error "The term 'Get-SPWeb' is not recognized as the name of a cmdlet, function..."

I just typed the follow to try and get my SharePoint site: $spWeb = Get-SPWeb -Identity "http://nycs00058260/sites/usitp" It gave me the following error The term 'Get-SPWeb' is not recognized a..

Postgres FOR LOOP

I am trying to get 25 random samples of 15,000 IDs from a table. Instead of manually pressing run every time, I'm trying to do a loop. Which I fully understand is not the optimum use of Postgres, but ..

Merging arrays with the same keys

In a piece of software, I merge two arrays with array_merge function. But I need to add the same array (with the same keys, of course) to an existing array. The problem: $A = array('a' => 1, 'b'..

Open file by its full path in C++

I want the user to give me the full path where the file exists and not just the file name. How do I open the file this way? Is it something like this: ifstream file; file.open("C:/Demo.txt", ios::in..

Exclude all transitive dependencies of a single dependency

In Maven2, to exclude a single transitive dependency, I have to do something like this: <dependency> <groupId>sample.group</groupId> <artifactId>sample-artifactB</artif..

Why do I need 'b' to encode a string with Base64?

Following this python example, I encode a string as Base64 with: >>> import base64 >>> encoded = base64.b64encode(b'data to be encoded') >>> encoded b'ZGF0YSB0byBiZSBlbmNvZ..