Questions Tagged with #Web services

A "web service" is a software system designed to support interoperable machine-to-machine interaction over the World Wide Web.

Best/Most Comprehensive API for Stocks/Financial Data

What is the most recommended free/public API for accessing financial market stats and stock quotes (preferrably real-time quotes)? I'm not too picky about how it's exposed (SOAP, REST, some proprietar..

How to call a RESTful web service from Android?

I have written a REST web service in Netbean IDE using Jersey Framework and Java. For every request the user needs to provide a username and a password, I know that this authentication is not a best..

How to do a SOAP Web Service call from Java class?

I'm relative new to the webservices world and my research seems to have confused me more than enlighten me, my problem is that I was given a library(jar) which I have to extend with some webservice fu..

How to access parameters in a RESTful POST method

My POST method looks like this: @POST @Consumes({"application/json"}) @Path("create/") public void create(String param1, String param2){ System.out.println("param1 = " + param1); System.out.p..

Multiple contexts with the same path error running web service in Eclipse using Tomcat

This is the error that I got when I created my first Axis2 web service using Eclipse. After I wrote the class, I created the web service with Apache Axis2. When I click the start server button in ecli..

What is the difference between Document style and RPC style communication?

Can somebody explain to me the differences between Document and RPC style webservices? Apart from JAX-RPC, the next version is JAX-WS, which supports both Document and RPC styles. I also understand d..

Can a WSDL indicate the SOAP version (1.1 or 1.2) of the web service?

Is it possible to see if a web service uses SOAP 1.1 or 1.2, based on the information in the WSDL?..

Large WCF web service request failing with (400) HTTP Bad Request

I've encountered this apparently common problem and have been unable to resolve it. If I call my WCF web service with a relatively small number of items in an array parameter (I've tested up to 50), ..

Secure Web Services: REST over HTTPS vs SOAP + WS-Security. Which is better?

I'm not a security expert by any means, but I favor creating REST-style web services. In creating a new service which needs to have the data it transmits secure. We've entered a debate over which ..

Tool to monitor HTTP, TCP, etc. Web Service traffic

What's the best tool that you use to monitor Web Service, SOAP, WCF, etc. traffic that's coming and going on the wire? I have seen some tools that made with Java but they seem to be a little crappy. W..

Postman Chrome: What is the difference between form-data, x-www-form-urlencoded and raw

I am using the Postman Chrome extension for testing a web service. There are three options available for data input. I guess the raw is for sending JSON. What is the difference between the other tw..

What is a "web service" in plain English?

I've been reading about "web services" here on SO, on Wikipedia, Google, etc., and I don't quite understand what they are. What is the plain English definition/description? If I make a simple websit..

How to consume REST in Java

Using Java tools, wscompile for RPC wsimport for Document etc.. I can use WSDL to generate the stub and Classes required to hit the SOAP Web Service. But I have no idea how I can do the same in RE..

Loop through JSON object List

I am returning a List<> from a webservice as a List of JSON objects. I am trying to use a for loop to iterate through the list and grab the values out of the properties. This is a sample of the ret..

Working Soap client example

I'm trying to find a simple (ha) SOAP example in JAVA with a working service, any I seem to be finding are not working. I have tried this one from this example but it's just not working, it's asking ..

Difference between OData and REST web services

What is the difference between OData and REST-ful web services?..

How to add custom Http Header for C# Web Service Client consuming Axis 1.4 Web service

I'm trying to write a web service client in c# which the webservice is Java Axis 1.4. Axis service requires the Authorization: Basic Base64EncodedToken header value in the HTTP Headers. I can't find ..

How to generate service reference with only physical wsdl file

I have been creating and consuming web services for years and always have been able to use Visual Studio to create a service reference from the client. I have a third party service I need to work with..

Understanding REST: Verbs, error codes, and authentication

I am looking for a way to wrap APIs around default functions in my PHP-based web applications, databases and CMSs. I have looked around and found several "skeleton" frameworks. In addition to the an..

Recommendations of Python REST (web services) framework?

Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons. Please feel free to add..

jQuery .ajax() POST Request throws 405 (Method Not Allowed) on RESTful WCF

I am sending a post request to a RESTFUL WCF service application. I am able to successfully send a POST request through Fiddler. However when I do this through the jQuery Ajax method the function r..

Restful API service

I'm looking to make a service which I can use to make calls to a web-based REST API. Basically I want to start a service on app init then I want to be able to ask that service to request a url and re..

how to send an array in url request

My requirement is as follows: I want to give actor name, start date, end date and get all the films he acted in that period. For that reason, my service request is like this. http://localhost:8..

What is a web service endpoint?

Let's say my web service is located at http://localhost:8080/foo/mywebservice and my WSDL is at http://localhost:8080/foo/mywebservice?wsdl. Is http://localhost:8080/foo/mywebservice an endpoint, i.e..

Difference between a SOAP message and a WSDL?

I am confused about how SOAP messages and WSDL fit together? I have started looking into SOAP messages such as: POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; c..

IntelliJ, can't start simple web application: Unable to ping server at localhost:1099

I'm trying to make a simple web app in IntelliJ by following this tutorial: http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_for_Tomcat_in_IntelliJ_IDEA_12 I believe my Tomcat is ..

What are WSDL, SOAP and REST?

What is WSDL? How is it related to SOAP? Where does REST fit in all of that?..

what is the difference between XSD and WSDL

What is the difference between an XML Schema and WSDL? The difference I noticed is that WSDL contains XSD and in WSDL we can declare operations, but not in XSD. Is that correct?..

500 internal server error at GetResponse()

I have a heavy traffic aspx page calling a web service upon every user`s request as follows. string uri = "Path.asmx"; string soap = "soap xml string"; HttpWebRequest request = (HttpWebRequest)WebRe..

How can the error 'Client found response content type of 'text/html'.. be interpreted

I'm using C# and connecting to a WebService via an auto-generated C# proxy object. The method I'm calling can be long running, and sometimes times out. I get different errors back, sometimes I get a S..

Create a asmx web service in C# using visual studio 2013

Hy, how can I create a asmx web service in Visual Studio 2013? I have found this short tutorial about that, but when I follow this in Visual Studio 2013 I get an error that says "the type 'Service1'..

Create web service proxy in Visual Studio from a WSDL file

My application needs to talk to a web service that hasn't got an online WSDL definition. The developers however supplied me with a WSDL file. With a public WSDL Visual Studio can generate this code f..

How to pass a JSON array as a parameter in URL

I have an requirement to pass a some values from mobile to server in a web service call and so I am planning to pass all the values in JSON format like the below { "nameservice": [ { ..

Could not establish secure channel for SSL/TLS with authority '*'

I must consume a PHP webservice which has a SSL certificate. My .net 3.5 Class library references the webservice with 'Add Service references' in Visualstudio 2010 (WCF right?). When calling the main..

what's the correct way to send a file from REST web service to client?

I've just started to develop REST services, but I've come across a difficult situation: sending files from my REST service to my client. So far I've gotten the hang of how to send simple data types (s..

How to deploy ASP.NET webservice to IIS 7?

How can I deploy an ASP.NET web service to IIS 7? I have deployed my webservice to IIS-5 installed on windows server 2008. However, I am not well versed with configuration options in IIS-7. For IIS-..

Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASPNET'

I have created a web service which is saving some data into to db. But I am getting this error: Cannot open database "test" requested by the login. The login failed. Login failed for user 'xyz\ASP..

How to generate java classes from WSDL file

I am working towards an android application. I need to use a web service. I have a wsdl file but I want to convert that into java so that I can use its functions in my Java programs. Is there any way..

How can I get the named parameters from a URL using Flask?

When the user accesses this URL running on my flask app, I want the web service to be able to handle the parameters specified after the question mark: http://10.1.1.1:5000/login?username=alex&pas..

java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of

I've created an app that loads a question from my web services, and it works fine. But, sometimes it crashes and I do not get the reason why this is happening, especially because I have also given it ..

SoapUI "failed to load url" error when loading WSDL

I keep having some weird problems. The main one is that I keep getting the following error when trying to add a WSDL to a new project: Error loading [https://.../token?wsdl]: java.lang.Exception: Fai..

Java String to JSON conversion

i am getting data from restful api in String variable now i want to convert to JSON object but i am having problem while conversion it throws exception .Here is my code : URL url = new URL("SOME URL"..

How correctly produce JSON by RESTful web service?

I am writing a web service the first time. I created a RESTful web service based on Jersey. And I want to produce JSON. What do I need to do to generate the correct JSON type of my web service? Here'..

Cannot deserialize instance of object out of START_ARRAY token in Spring Webservice

I'm currently having trouble connecting to my webservice on android. I use jackson-core/databind/annotation-2.2.4 and Spring RESTWebService. If I access the URL from the browser I can see the JSON res..

How to create a Restful web service with input parameters?

I am creating restful web service and i wanted to know how do we create a service with input parameters and also how to invoke it from a web browser. For example @Path("/todo") public class TodoReso..

Maximum length of HTTP GET request

What's the maximum length of an HTTP GET request? Is there a response error defined that the server can/should return if it receives a GET request that exceeds this length? This is in the context of..

JAXB Exception: Class not known to this context

When I call a particular restful service method, which is built using CXF, I get the following error, anyone know why and how to resolve it? JAXBException occurred : class com.octory.ws.dto.Prof..

Generating Request/Response XML from a WSDL

Is there a way to generate Request & Response XML formats from just a WSDL file - if the webservice is not live right now. SoapUI doesn't give me the response unless it contacts the Webservic..

Value does not fall within the expected range

I am using the following code to update a listbox, this recieving a list from a Web service: client.userKeywordsCompleted += new EventHandler<userKeywordsCompletedEventArgs>(client_userKeywords..

WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically. However, when I try..

Error 415 Unsupported Media Type: POST not reaching REST if JSON, but it does if XML

I am actually new to REST WS but really I don't get this 415 Unsupported Media Type. I am testing my REST with Poster on Firefox and the GET works fine for me, also the POST (when it's a application..

A message body writer for Java type, class myPackage.B, and MIME media type, application/octet-stream, was not found

I am new at RESTful webservices and was trying to update my @OneToMany relationship from a standalone client application, but I am not able to do that. I am using the Jersey implementation of JAX-RS t..

Is it possible to specify proxy credentials in your web.config?

I need to configure a website to access a webservice on another machine, via a proxy. I can configure the website to use a proxy, but I can't find a way of specifying the credentials that the proxy r..

Default username password for Tomcat Application Manager

Starting web services in Netbeans just Hello World Program , but this Application Manager makes hectic on this to start , Facing this alert message in NetBeans also Tomcat Application Manager Messa..

Setting Timeout Value For .NET Web Service

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

How to add soap header in java

i have a NO-.net webservice from oracle To access i need to add the soap header. How can i add the soap header in java? Authenticator.setDefault(new ProxyAuthenticator("username", "password")); ..

how to fix java.lang.IndexOutOfBoundsException

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) in line of arraylist.java private void rangeCheck(int in..

How to send post request to the below post method using postman rest client

I just want to know, how to send JSON object to createTrackInJSON(Track track) method, with @Post annotation through postman rest client. here,how to pass JSON object to createTrackInJSON(Track track..

ASP.Net which user account running Web Service on IIS 7?

I want to know which account running my Web Service/Application so that I can assign the read/write access to that account. I have researched and see most of the sources mentions about ASPNET account,..

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

How to post SOAP Request from PHP

Anyone know how can I post a SOAP Request from PHP?..

EOFError: end of file reached issue with Net::HTTP

I am using ruby-1.8.7-p302/Rails 2.3.11. I am trying to use FQL (Facebook API) to get stats for a link. Here's my code: def stats(fb_post_url) url = BASE_URI + "?query=#{URI.encode("select like_cou..

How to call a SOAP web service on Android

I am having a lot of trouble finding good information on how to call a standard SOAP/WSDL web service with Android. All I've been able to find are either very convoluted documents and references to "k..

How to change webservice url endpoint?

I generated a web-service client using JBoss utils (JAX-WS compatible) using Eclipse 'web service client from a wsdl'. So, the only thing I provided was a url to a web-service WSDL. Now, the web ser..

How to increase the timeout period of web service in asp.net?

I've created one web service which is of asmx type. And I'm using my web service in the .net windows application. Web method from the web service receives byte array conversion of the object & ..

How to POST URL in data of a curl request

I am trying to post two parameters using curl, path and fileName: curl --request POST 'http://localhost/Service' --data "path='/xyz/pqr/test/'&fileName='1.doc'" I know something is wrong in thi..

What are the differences between WCF and ASMX web services?

I am totally confused between WCF and ASMX web services. I have used a lot of web services in my earlier stage, and now there is this new thing introduced called WCF. I can still create WCF that fun..

How do I set the timeout for a JAX-WS webservice client?

I've used JAXWS-RI 2.1 to create an interface for my web service, based on a WSDL. I can interact with the web service no problems, but haven't been able to specify a timeout for sending requests to t..

How can I dynamically switch web service addresses in .NET without a recompile?

I have code that references a web service, and I'd like the address of that web service to be dynamic (read from a database, config file, etc.) so that it is easily changed. One major use of this wil..

How to call a Web Service Method?

I have a web service that contains this method: [WebMethod] public static List<string> GetFileListOnWebServer() { DirectoryInfo dInfo = new DirectoryInfo(HostingEnvironment.MapPath("~/Upload..

What should a JSON service return on failure / error

I'm writing a JSON service in C# (.ashx file). On a successful request to the service I return some JSON data. If the request fails, either because an exception was thrown (e.g. database timeout) or b..

How do I solve this error, "error while trying to deserialize parameter"

I have a web service that is working fine in one environment but not in another. The web service gets document meta data from SharePoint, it running on a server where I cant debug but with logging I ..

Tracing XML request/responses with JAX-WS

Is there an easy way (aka: not using a proxy) to get access to the raw request/response XML for a webservice published with JAX-WS reference implementation (the one included in JDK 1.5 and better) ? B..

How to add parameters into a WebRequest?

I need to call a method from a webservice, so I've written this code: private string urlPath = "http://xxx.xxx.xxx/manager/"; string request = urlPath + "index.php/org/get_org_form"; WebRequest we..

How to easily consume a web service from PHP

Is there available any tool for PHP which can be used to generate code for consuming a web service based on its WSDL? Something comparable to clicking "Add Web Reference" in Visual Studio or the Eclip..

Connect HTML page with SQL server using javascript

I have one HTML page in which I have 3 textbox fields name, address, age and I want to save data from these textboxes in my SQL server database. I got one reference to perform this task by using web ..

WCF Error "This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case"

I'm having a problem using a WCF call from a Windows service to my WCF service running on my web server. This call has been working for a number of weeks, but then stopped working all of a sudden, an..

API vs. Webservice

What is the difference between a webservice and an API? Is the difference more than the protocol used to transfer data? thanks. ..

WCF Exception: Could not find a base address that matches scheme http for the endpoint

I'm trying to host a WCF web service on a separate Website in IIS with https at 443 as the only binding. The following configurations works well when I use it in a website which uses both the bindin..

CXF: No message body writer found for class - automatically mapping non-simple resources

I am using the CXF rest client which works well for simple data types (eg: Strings, ints). However, when I attempt to use custom Objects I get this: Exception in thread "main" org.apache.cxf.intercep..

How to send/receive SOAP request and response using C#?

private static string WebServiceCall(string methodName) { WebRequest webRequest = WebRequest.Create("http://localhost/AccountSvc/DataInquiry.asmx"); HttpWebRequest httpRequest = (HttpW..

PUT and POST getting 405 Method Not Allowed Error for Restful Web Services

I am trying to set up a simple Restful Web-Service which returns either JSON or XML according to the Accept header. I am using Spring, Maven and WebLogic Server. I took the example from this post http..

jQuery Call to WebService returns "No Transport" error

I have the following web service; [WebMethod] public string HelloWorld() { return "Hello World"; } It's stock standard with no alterations to the class decorators. I have t..

Server did not recognize the value of HTTP Header SOAPAction

[SoapRpcMethod(Action = "http://cyberindigo/TempWebService/InsertXML", RequestNamespace = "http://cyberindigo/TempWebService/Request", RequestElementName = "InsertXMLRequest", ResponseN..

Compare and contrast REST and SOAP web services?

I currently figure out the similar is both using internet protocol (HTTP) to exchange data between consumer and provider. The difference is: SOAP is a XML-based message protocol, while REST is an ..

Setting HttpContext.Current.Session in a unit test

I have a web service I am trying to unit test. In the service it pulls several values from the HttpContext like so: m_password = (string)HttpContext.Current.Session["CustomerId"]; m_userID = (stri..

Guid is all 0's (zeros)?

I'm testing out some WCF services that send objects with Guids back and forth. In my web app test code, I'm doing the following: var responseObject = proxy.CallService(new RequestObject { Data = ..

RESTful web service - how to authenticate requests from other services?

I am designing a RESTful web service that needs to be accessed by users, but also other web services and applications. All of the incoming requests need to be authenticated. All communication takes pl..

What is the difference between a web API and a web service?

Is there any difference between a web API and a web service ? Or are they one and the same ? ..

Where to find free public Web Services?

I want some usefull free public WebServices like Weather, Currency Converter, Mathematics etc. Please tell me where I can get them Thanks in advance!..

The type or namespace name 'Entity' does not exist in the namespace 'System.Data'

I'm using WS class and it gave me error when I run the application: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' I have a reference to the System.Data; and to ..

How do I upload a file with metadata using a REST web service?

I have a REST web service that currently exposes this URL: http://server/data/media where users can POST the following JSON: { "Name": "Test", "Latitude": 12.59817, "Longitude": 52.1287..

Message Queue vs. Web Services?

Under what conditions would one favor apps talking via a message queue instead of via web services (I just mean XML or JSON or YAML or whatever over HTTP here, not any particular type)? I have to tal..

Call web service in excel

In a VBA module in excel 2007, is it possible to call a web service? If so, any code snippets? How would I add the web reference?..

Enable ASP.NET ASMX web service for HTTP POST / GET requests

I would like to enable a ASP.NET classic (ASMX) web service for HTTP POST and GET requests. I realise this can be done on a machine or application level by adding ... <webServices> <prot..

WSDL/SOAP Test With soapui

I have tested my web services (wsdl/soap) with soapui. and i have the errors : http/log : error 400 BAD REQUEST. What can be the error please with my wsdl ? error/log : un Jun 05 14:10:37 CEST 2011..

How to check task status in Celery?

How does one check whether a task is running in celery (specifically, I'm using celery-django)? I've read the documentation, and I've googled, but I can't see a call like: my_example_task.state() ==..

SOAP vs REST (differences)

I have read articles about the differences between SOAP and REST as a web service communication protocol, but I think that the biggest advantages for REST over SOAP are: REST is more dynamic, no ne..

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.`

EDIT: After I modified the web.config and I don't get error that's good.... then I add a new page (html) and write this small code to consume the service like this: $("#btn12").click(function (even..

WSDL validator?

Is there any online service available to validate Web Service WSDL file?..

asp.net: Invalid postback or callback argument

I am getting this error: Server Error in '/' Application. Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or &l..

Close a div by clicking outside

I want to hide a div by clicking on the close link in it, or by clicking anywhere outside that div. I am trying following code, it opens and close the div by clicking close link properly, but if I ha..

How to convert hex to rgb using Java?

How can I convert hex color to RGB code in Java? Mostly in Google, samples are on how to convert from RGB to hex...

Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)

I am developing a web page using JavaScript and HTML, everything was working good when I have received this list of errors from my HTML page: The resource from “https://raw.githubusercontent.com/da..

How to add headers to a multicolumn listbox in an Excel userform using VBA

Is it possible to set up the headers in a multicolumn listbox without using a worksheet range as the source? The following uses an array of variants which is assigned to the list property of the list..

Skip over a value in the range function in python

What is the pythonic way of looping through a range of numbers and skipping over one value? For example, the range is from 0 to 100 and I would like to skip 50. Edit: Here's the code that I'm using ..

CURLOPT_RETURNTRANSFER set to true doesnt work on hosting server

I'm trying to process result from $data = curl_exec($ch); instead of printing it on the screen. In order to achieve that I set the option CURLOPT_RETURNTRANSFER to true like this: curl_setopt($ch, CU..

How to create unit tests easily in eclipse

I want to create unit tests easily by just selecting method. Is there a tool in eclipse that does that. It should support templates. I should be able to create positive test as well as negative tests...

jquery smooth scroll to an anchor?

Is there a way to scroll down to an anchor link using jQuery? Like: $(document).ready(function(){ $("#gotomyanchor").click(function(){ $.scrollSmoothTo($("#myanchor")); }); }); ?..

How to evaluate http response codes from bash/shell script?

I have the feeling that I'm missing the obvious, but have not succeeded with man [curl|wget] or google ("http" makes such a bad search term). I'm looking for a quick&dirty fix to one of our webser..

How to create an HTTPS server in Node.js?

Given an SSL key and certificate, how does one create an HTTPS service?..

How to use __doPostBack()

I'm trying to create an asyncrhonous postback in ASP.NET using __doPostBack(), but I have no idea how to do it. I want to use vanilla JavaScript. Something simple like a button click can cause the _..

Regex for not empty and not whitespace

I am trying to create a regex that will return false if the String pattern contains whitespace or is empty. So far I have this [^\s] I think that will make sure the string does not contain whitesp..

PostgreSQL function for last inserted ID

In PostgreSQL, how do I get the last id inserted into a table? In MS SQL there is SCOPE_IDENTITY(). Please do not advise me to use something like this: select max(id) from table ..

Are arrays in PHP copied as value or as reference to new variables, and when passed to functions?

1) When an array is passed as an argument to a method or function, is it passed by reference, or by value? 2) When assigning an array to a variable, is the new variable a reference to the original ar..

How do ACID and database transactions work?

What is the relationship between ACID and database transaction? Does ACID give database transaction or is it the same thing? Could someone enlighten this topic...

Copy file from source directory to binary directory using CMake

I'm trying to create a simple project on CLion. It uses CMake (I'm new here) to generate Makefiles to build project (or some sort of it) All I need to is transfer some non-project file (some sort of ..

.net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible

I have a .net core 2.0 console app. I'm trying to read files from TFS using the following: How to get a file from TFS directly into memory (i.e., don't want to read from file system into memory..

How to check the Angular version?

I installed @angular/cli package via npm, using this command: npm install -g @angular/cli The version 1.4.2 of @angular/cli has been successfully installed. But that is not the Angular version, but..

Javascript - removing undefined fields from an object

Is there a clean way to remove undefined fields from an object? i.e. > var obj = { a: 1, b: undefined, c: 3 } > removeUndefined(obj) { a: 1, c: 3 } I came across two solutions: _.each(query..

How do I include a newline character in a string in Delphi?

I want to create a string that spans multiple lines to assign to a Label Caption property. How is this done in Delphi?..

How to override Bootstrap's Panel heading background color?

I'm using a Panel from Bootstrap however for the heading I want to use my own background color for the heading. When I don't put panel-heading class for the div, the layout gets screwed. So I thought ..

Get the time of a datetime using T-SQL?

How to get the time for a given datetime value? I have a datetime in database like this: 2010-09-06 17:07:28.170 and want only the time portion: 17:07:28.170 Is there a function for that or s..

How can I upload files asynchronously?

I would like to upload a file asynchronously with jQuery. _x000D_ _x000D_ $(document).ready(function () {_x000D_ $("#uploadbutton").click(function () {_x000D_ var filename = $("#file").v..

What is the simplest way to convert array to vector?

What is the simplest way to convert array to vector? void test(vector<int> _array) { ... } int x[3]={1, 2, 3}; test(x); // Syntax error. I want to convert x from int array to vector in sim..

Using % for host when creating a MySQL user

My MySQL database needs two users: appuser and support. One of the application developers insists that I create four accounts for these users: appuser@'%' appuser@'localhost' support@'%' support@'loc..

Mongoose limit/offset and count query

Bit of an odd one on query performance... I need to run a query which does a total count of documents, and can also return a result set that can be limited and offset. So, I have 57 documents in tota..

Make selected block of text uppercase

Can I make a multi-line selection of text all capitals in Visual Studio Code? In full Visual Studio it's CTRL+SHIFT+U to do this. The extension that exists that I have seen only do non-multi-line bl..

Error 5 : Access Denied when starting windows service

I'm getting this error when I try to start a windows service I've created in C#: My Code so far: private ServiceHost host = null; public RightAccessHost() { InitializeComponent(); } protecte..

Regex allow a string to only contain numbers 0 - 9 and limit length to 45

I am trying to create a regex to have a string only contain 0-9 as the characters and it must be at least 1 char in length and no more than 45. so example would be 00303039 would be a match, and 03933..

Java 8 LocalDate Jackson format

For java.util.Date when I do @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd/MM/yyyy") private Date dateOfBirth; then in JSON request when I send { {"dateOfBirth":"01/01/2000"}..

How do I find which transaction is causing a "Waiting for table metadata lock" state?

I am trying to perform some DDL on a table and SHOW PROCESSLIST results in a " Waiting for table metadata lock " message. How can I find out which transaction is not yet closed? I'm using MySQL v5.5..

Why is my CSS bundling not working with a bin deployed MVC4 app?

I have bin deployed an MVC4 application to my hosting provider, based on advice given here and one or two on-the-fly fixes, but the most immediately apparent problem is that the bundling for css doesn..

How to install the Sun Java JDK on Ubuntu 10.10 (Maverick Meerkat)?

I've tried to add the Canonical Partner repository, but I still can't find the sun-java6-jdk package. What is the right way to install the Oracle Sun JDK instead of OpenJDK on Ubuntu 10.10 (Maverick M..

Is there a simple way to remove multiple spaces in a string?

Suppose this string: The fox jumped over the log. Turning into: The fox jumped over the log. What is the simplest (1-2 lines) to achieve this, without splitting and going into lists?..

Angular 2: Can't bind to 'ngModel' since it isn't a known property of 'input'

I'm trying to implement Dynamic Forms in Angular 2. I've added additional functionalities like Delete and Cancel to the dynamic forms. I've followed this documentation: https://angular.io/docs/ts/late..

How can I check if mysql is installed on ubuntu?

I need to check if mysql is installed on a ubuntu server. Is there a way to determine if mySql has been installed ? Thanks...

Reset Excel to default borders

Ok, so you know what a spreadsheet looks like when you open a new on in Excel; the borders are a light blue. These are only on the screen though, if you print the sheet it will not have borders. Say y..

Hive: Filtering Data between Specified Dates when Date is a String

I'm trying to filter data between September 1st, 2010 and August 31st, 2013 in a Hive table. The column containing the date is in string format (yyyy-mm-dd). I can use month() and year() on this colum..

What is href="#" and why is it used?

On many websites I see links that have href="#". What does it mean? What is it used for?..

Add padding to HTML text input field

I want to add some space to the right of an <input type="text" /> so that there's some empty space on the right of the field. So, instead of , I'd get . So, same behavior just some empty space..

Explanation of polkitd Unregistered Authentication Agent

In /var/log/secure every time a user logs in or logs out I notice the messages shown below stating Unregistered and Registered Authentication Agent. I have not been able to figure out why these messag..

How to call a MySQL stored procedure from within PHP code?

I have stored procedure that I created in MySQL and want PHP to call that stored procedure. What is the best way to do this? -MySQL client version: 4.1.11 -MySQL Server version: 5.0.45 Here is my..

How do I set the offset for ScrollSpy in Bootstrap?

I have a site with the navbar fixed on top and 3 divs underneath in the main content area. I'm trying to use scrollspy from the bootstrap framework. I have it succesfully highlighting the different ..

DNS problem, nslookup works, ping doesn't

I am setting up a development server in my flat. I have set up an Ubuntu DNS server on it and have added the zone weddinglist (just weddinglist - no TLD. It's just an internal domain.) This works fin..

What is the maximum recursion depth in Python, and how to increase it?

I have this tail recursive function here: def recursive_function(n, sum): if n < 1: return sum else: return recursive_function(n-1, sum+n) c = 998 print(recursive_function..

What is the fastest factorial function in JavaScript?

Looking for a really fast implementation of factorial function in JavaScript. Any suggests?..

Draw path between two points using Google Maps Android API v2

Google changed its map API for Android and introduced API V2. The previous codes for drawing path are not working with API V2. I have managed to draw a path with API V2. I had searched a lot for the ..

Dynamic height for DIV

I have the following DIV <div id="products"> </div> #products { height: 102px; width: 84%; padding:5px; margin-bottom:8px; border: 1px solid #EFEFEF; } Now inside the DIV,..

Docker build gives "unable to prepare context: context must be a directory: /Users/tempUser/git/docker/Dockerfile"

I have a Dockerfile that is supposed to build an Ubuntu image. But whenever I run docker build -t ubuntu-test:latest ./Dockerfile it shows the following error on the console unable to prepare contex..

jQuery - find table row containing table cell containing specific text

I need to get a tr element which contains a td element which contains specific text. The td will contain that text and only that text (so I need text = 'foo' not text contains 'foo' logic). So I need..

Open multiple Eclipse workspaces on the Mac

How can I open multiple Eclipse workspaces at the same time on the Mac? On other platforms, I can just launch extra Eclipse instances, but the Mac will not let me open the same application twice. Is ..

What is a software framework?

Can someone please explain me what a software framework is? Why do we need a framework? What does a framework do to make programming easier?..

Removing unwanted table cell borders with CSS

I have a peculiar and frustrating problem. For the simple markup: <table> <thead> <tr><th>1</th><th>2</th><th>3</th></tr> ..

Asyncio.gather vs asyncio.wait

asyncio.gather and asyncio.wait seem to have similar uses: I have a bunch of async things that I want to execute/wait for (not necessarily waiting for one to finish before the next one starts). They u..

How to change navbar/container width? Bootstrap 3

The default width for my navbar is too wide 1170px. I would like to reduce it down to 940px - but I want to keep the responsiveness. I tried to change the container width in CSS and it looks ok with ..

How do I exclude Weekend days in a SQL Server query?

How do I exclude values in a DateTime column that are Saturdays or Sundays? For example, given the following data: date_created '2009-11-26 09:00:00' -- Thursday '2009-11-27 09:00:00' -- Friday '2..

Convert integers to strings to create output filenames at run time

I have a program in Fortran that saves the results to a file. At the moment I open the file using OPEN (1, FILE = 'Output.TXT') However, I now want to run a loop, and save the results of each iter..

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

I have built an application using Spring with Eclipse IDE. When I launch the project from Eclipse IDE everything is fine but when I package the maven project as a war file and deployed to separate tom..

Jquery in React is not defined

Hi I just want to receive ajax request, but the problem is that jquery is not defined in React. React version is 14.0 Error message Uncaught ReferenceError: $ is not defined I have two files : i..

How do I put variables inside javascript strings?

s = 'hello %s, how are you doing' % (my_name) That's how you do it in python. How can you do that in javascript/node.js?..

How can I render a list select box (dropdown) with bootstrap?

Is there anything out of the box that bootstrap supports to render a "regular" defacto drop down list select box? That is, where the drop down box is a list of values and if selected populate the con..

Change multiple files

The following command is correctly changing the contents of 2 files. sed -i 's/abc/xyz/g' xaa1 xab1 But what I need to do is to change several such files dynamically and I do not know the file nam..

How to copy multiple files in one layer using a Dockerfile?

The following Dockerfile contains four COPY layers: COPY README.md ./ COPY package.json ./ COPY gulpfile.js ./ COPY __BUILD_NUMBER ./ How to copy these files using one layer instead? The following ..

How to get last N records with activerecord?

With :limit in query, I will get first N records. What is the easiest way to get last N records?..

How to pass arguments to addEventListener listener function?

The situation is somewhat like- var someVar = some_other_function(); someObj.addEventListener("click", function(){ some_function(someVar); }, false); The problem is that the value of someVar is..

Reading entire html file to String?

Are there better ways to read an entire html file to a single string variable than: String content = ""; try { BufferedReader in = new BufferedReader(new FileReader("mypage.html")); ..

Trim specific character from a string

What's the JavaScript equivalent to this C# Method: var x = "|f|oo||"; var y = x.Trim('|'); // "f|oo" C# trims the selected character only at the beginning and end of the string!..

How can I avoid Java code in JSP files, using JSP 2?

I'm new to Java EE and I know that something like the following three lines <%= x+1 %> <%= request.getParameter("name") %> <%! counter++; %> is an old school way of coding..

Get href attribute on jQuery

I have some table rows <tr class="b_row"> <td> <div class="cpt"> <h2> <a href="/ref/ref/1.html">example</a> <..

How can I extract the folder path from file path in Python?

I would like to get just the folder path from the full path to a file. For example T:\Data\DBDesign\DBDesign_93_v141b.mdb and I would like to get just T:\Data\DBDesign (excluding the \DBDesign_93_v141..

Best way to work with transactions in MS SQL Server Management Studio

Let's say I have an SQL statement that's syntactically and semantically correct so it executes. In Management Studio (or any other query tool) how can I test SQL statements, and if I notice that the..

How to send a HTTP OPTIONS request from the command line?

I tried to use cURL but it seems that by default (Debian) is not compiled with HTTPS support and I dont want to build it myself. wget seems to have SSL support but I found no information on how to ge..

Java: is there a map function?

I need a map function. Is there something like this in Java already? (For those who wonder: I of course know how to implement this trivial function myself...)..

Linux command to translate DomainName to IP

Is there any Linux command to translate domain name to IP?..

Checking if an input field is required using jQuery

What would be the easiest way to check if an input is required? I have been trying stuff along these lines but always comes up with all required (only 4/6 are). $('form#register').find('input').each(..

Disable beep of Linux Bash on Windows 10

Having a Linux Bash on Windows 10 is pretty cool, but as far as I've got to struggle with the not-so-good terminal provided from Microsoft I'm gonna get stuck with Ubuntu for everything. Anyway, is t..

tkinter: how to use after method

Hey I am new to python and am using tkinter for my gui. I am having trouble using the "after" method. The goal is to make a random letter appear every 5 seconds. Here is my code: import random impor..

Convert string (without any separator) to list

I have a phone number(string), e.g. "+123-456-7890", that I want to turn into a list that looks like: [+, 1, 2, 3, -, ...., 0]. Why? So I can go iterate through the list and remove all the symbols, ..

How can I bring my application window to the front?

How to bring my application window to front? For example whan my app needs attention. This is for my personal program. I need that functionality. This is what I got. But it's NOT working 100% times...

Marker in leaflet, click event

var map = L.map('map'); var marker = L.marker([10.496093,-66.881935]).on('click', onClick); function onClick(e) {alert(e.latlng);} marker.addTo(map) When I do click in the marker, the alert message ..

How to change MySQL timezone in a database connection using Java?

MySQL runs with timezone "GMT+8", but Tomcat with "GMT". When I save datetime to my database, everything seems to be OK, but when I check the datetime value in the database, I see the "GMT" value. Al..

Regex pattern for checking if a string starts with a certain substring?

What's the regular expression to check if a string starts with "mailto" or "ftp" or "joe" or... Now I am using C# and code like this in a big if with many ors: String.StartsWith("mailto:") String.St..

Bash if statement with multiple conditions throws an error

I'm trying to write a script that will check two error flags, and in case one flag (or both) are changed it'll echo-- error happened. My script: my_error_flag=0 my_error_flag_o=0 do something..... if..

JQuery - $ is not defined

I have a simple jquery click event <script type="text/javascript"> $(function() { $('#post').click(function() { alert("test"); }); }); &l..

How to replace DOM element in place using Javascript?

I am looking to replace an element in the DOM. For example, there is an <a> element that I want to replace with a <span> instead. How would I go and do that?..

No suitable records were found verify your bundle identifier is correct

I have created an app in App Store Connect and it has been in the "prepare for submission" state for more than 3 days. When I try to archive my app, and submit it to the app store it, displays this me..

Using Java with Microsoft Visual Studio 2012

I started as a C++ programmer, and Visual studio has worked splendedly for me. However, I recently have wanted to branch out to C# and Java. Visual studio supports C# and I now have some experience wi..

How to create an empty array in Swift?

I'm really confused with the ways we create an array in Swift. Could you please tell me how many ways to create an empty array with some detail?..

Call a function after previous function is complete

I have the following JavaScript code: $('a.button').click(function(){ if (condition == 'true'){ function1(someVariable); function2(someOtherVariable); } else { doT..

How does JPA orphanRemoval=true differ from the ON DELETE CASCADE DML clause

I am a little confused about the JPA 2.0 orphanRemoval attribute. I think I can see it is needed when I use my JPA provider's DB generation tools to create the underlying database DDL to have an ON D..

How to get base url in CodeIgniter 2.*

In config.php $config['base_url'] = 'http://localhost/codeigniter/'; In View <link rel="stylesheet" href="<?php base_url(); ?>css/default.css" type="text/css" /> => Error: Call ..

Using NULL in C++?

Possible Duplicate: Do you use NULL or 0 (zero) for pointers in C++? Is it a good idea to use NULL in C++ or just the value 0? Is there a special circumstance using NULL in C code calling ..

Installing Java 7 on Ubuntu

to install java I have always used the classic way from the terminal. I would like to install java manually. I placed the folder of the JDK on the desk and I set environment variables (PATH, CLASSPATH..

C# Create New T()

You can see what I'm trying (but failing) to do with the following code: protected T GetObject() { return new T(); } Any help would be greatly appreciated. EDIT: The context was as follows. ..

How to read xml file contents in jQuery and display in html elements?

I am new to Jquery.I am trying to read data from "sampleXML.xml" file and display that data in Html "li" elements. so far I have done is, I have created html file as follows:file name-"Cloudtags.html"..

What does ${} (dollar sign and curly braces) mean in a string in Javascript?

I haven't seen anything here or on MDN. I'm sure I'm just missing something. There's got to be some documentation on this somewhere? Functionally, it looks like it allows you to nest a variable insid..

How to set image in imageview in android?

I want to show an image in imageview so I made a folder - drawable in res and put my image there. Something like apple.png. Then I use this code: ImageView iv= (ImageView)findViewById(R.id.img_select..

How do you get the string length in a batch file?

There doesn't appear to be an easy way to get the length of a string in a batch file. E.g., SET MY_STRING=abcdefg SET /A MY_STRING_LEN=??? How would I find the string length of MY_STRING? Bonus p..

Visual Studio can't build due to rc.exe

I've searched online and couldn't find anything that resembled to my issue. I created an empty C++ project and added a main.cpp with a return and I can't get it to build. Here is the message I receiv..

Round up value to nearest whole number in SQL UPDATE

I'm running SQL that needs rounding up the value to the nearest whole number. What I need is 45.01 rounds up to 46. Also 45.49 rounds to 46. And 45.99 rounds up to 46, too. I want everything up one w..

Setting up JUnit with IntelliJ IDEA

Familiar with Java but unfamiliar with IntelliJ, how does one "get started" with JUnit integration? Inspired by Looking for a tutorial on using JUnit with Intellij IDEA 9.x which didn't answer my que..

MySQL Query to select data from last week?

Hi I have a table with a date field and some other information. I want to select all entries from the past week, (week start from Sunday). table values: id date 2 2011-05-14 09:17:25 5 2011-05-..

max(length(field)) in mysql

If I say: select max(length(Name)) from my_table I get the result as 18, but I want the concerned data also. So if I say: select max(length(Name)), Name from my_table ...it does n..

How to install 2 Anacondas (Python 2 and 3) on Mac OS

I'm relatively new in Mac OS. I've just installed XCode (for c++ compiler) and Anaconda with the latest Python 3 (for myself). Now I'm wondering how to install properly second Anaconda (for work) with..

Is it .yaml or .yml?

According to yaml.org, the official file extension is .yaml. Quote: Is there an official extension for YAML files? Please use ".yaml" when possible. However there seems to be a disagreem..

Mac SQLite editor

I am aware of CocoaMySQL but I have not seen a Mac GUI for SQLite, is there one? My Google search didn't turn up any Mac related GUI's which is why I'm asking here rather than Google...

Getting error: ISO C++ forbids declaration of with no type

I'm getting the following errors: ISO C++ forbids declaration of ttTreeInsert with no type ISO C++ forbids declaration of ttTreeDelete with no type ISO C++ forbids declaration of ttTreePrint with no ..

Is it possible to set a number to NaN or infinity?

Is it possible to set an element of an array to NaN in Python? Additionally, is it possible to set a variable to +/- infinity? If so, is there any function to check whether a number is infinity or no..

OSError [Errno 22] invalid argument when use open() in Python

def choose_option(self): if self.option_picker.currentRow() == 0: description = open(":/description_files/program_description.txt","r") self.information_shower.setText(..

Insert php variable in a href

I am planning to insert a PHP variable which holds the directory path for a file stored on my Windows machine. How can I include this variable in the a href tag inside my php script such that when the..

How can I create tests in Android Studio?

Just downloaded Android Studio which is based off of the Intellij Idea. How would one create tests? I notice there is a option for create a Test Module but this doesn't seem to do anything, only cre..

How do I add 24 hours to a unix timestamp in php?

I would like to add 24 hours to the timestamp for now. How do I find the unix timestamp number for 24 hours so I can add it to the timestamp for right now? I also would like to know how to add 48 ho..

How to launch a Google Chrome Tab with specific URL using C#

Is there a way I can launch a tab (not a new Window) in Google Chrome with a specific URL loaded into it from a custom app? My application is coded in C# (.NET 4 Full). I'm performing some actions v..

Play/pause HTML 5 video using JQuery

I am trying to control HTML5 videos using JQuery. I have two clips in a tabbed interface, there are six tabs in total, the others just have images. I am trying to make the video clips play when their ..

Split a List into smaller lists of N size

I am attempting to split a list into a series of smaller lists. My Problem: My function to split lists doesn't split them into lists of the correct size. It should split them into lists of size 30 bu..

MySQL "incorrect string value" error when save unicode string in Django

I got strange error message when tried to save first_name, last_name to Django's auth_user model. Failed examples user = User.object.create_user(username, email, password) user.first_name = u'Rytis'..

How to make HTML code inactive with comments

I have some HTML code on a page that I don't want to erase, but make inactive for the short term. How can I make the browser ignore parts of the page in the same way the // works in some programming l..

Throwing multiple exceptions in a method of an interface in java

I wanted to ask that how to mention this in my interface public class find(int x) throws A_Exception, B_Exception{ ---- ---- --- } i want to say that i can mention One exception in an interface bu..

Determine whether a Access checkbox is checked or not

Such a simple question, but I cannot find the answer (Google, MS help, SO): How can I check by VBA whether an unbound checkbox on an Access form is checked by the user or not? Can't find the right pr..

How to check if the URL contains a given string?

How could I do something like this: <script type="text/javascript"> $(document).ready(function () { if(window.location.contains("franky")) // This doesn't work, any suggestions? { ..

Swift - How to hide back button in navigation item?

Right now I have two view controllers. My problem is I don't know how to hide the back button after transitioning to the second view controller. Most references that I found are in Objective-C. How do..

Psexec "run as (remote) admin"

I wrote some c# code that uses PSexe. I want it to run a remote exe on a machine connected to my LAN. That exe creates a new local user. When I run that exe locally on the remote machine (after right..

Clearing state es6 React

I am trying to clear a components state but can't find a reference for the es6 syntax. I was using: this.replaceState(this.getInitialState()); however this does not work with the es6 class synta..

Efficient way to apply multiple filters to pandas DataFrame or Series

I have a scenario where a user wants to apply several filters to a Pandas DataFrame or Series object. Essentially, I want to efficiently chain a bunch of filtering (comparison operations) together th..

how to iterate through dictionary in a dictionary in django template?

My dictionary looks like this(Dictionary within a dictionary): {'0': { 'chosen_unit': <Unit: Kg>, 'cost': Decimal('10.0000'), 'unit__name_abbrev': u'G', 'supplier__supplier': u"..

Adding a UISegmentedControl to UITableView

How do I add a UISegmentedControl to a UITableView? Similar to the image found here: http://cdn.imore.com/sites/imore.com/files/styles/large/public/field/image/2012/08/iHomework-for-iPhone-managing-as..

How do I get the calling method name and type using reflection?

Possible Duplicate: How can I find the method that called the current method? I'd like to write a method which obtains the name of the calling method, and the name of the class containing t..

Get integer value of the current year in Java

I need to determine the current year in Java as an integer. I could just use java.util.Date(), but it is deprecated...

PHP/MySQL Insert null values

I'm struggling with some PHP/MySQL code. I am reading from 1 table, changing some fields then writing to another table, nothing happens if inserting and one of the array values is null when I would l..

Force download a pdf link using javascript/ajax/jquery

suppose we have a pdf link "http://manuals.info.apple.com/en/iphone_user_guide.pdf"(just for example and to let u know that file is not on my server, i only have the link)...now i have to provide a bu..

How do I find out what type each object is in a ArrayList<Object>?

I have a ArrayList made up of different elements imported from a db, made up of strings, numbers, doubles and ints. Is there a way to use a reflection type technique to find out what each type of data..

Include of non-modular header inside framework module

I am using Xcode 6, 1) Firstly I am creating a dynamic library (CoreLibrary). This library contain RequestPoster.h file. 2) Then I create a Cocoa Touch Framework and added this dynamic library (Core..

How do I get the path to the current script with Node.js?

How would I get the path to the script in Node.js? I know there's process.cwd, but that only refers to the directory where the script was called, not of the script itself. For instance, say I'm in /h..

#1045 - Access denied for user 'root'@'localhost' (using password: YES)

This might seem redundant but I was unable to find a correct solution. I was unable to login to mysql using the mysql console.It is asking for a password and I have no clue what I actually entered.(I..

Closing JFrame with button click

I have the jButton1 private member of JFrame and i wanted to close the frame when the button is clicked. jButton1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ..

Input type "number" won't resize

Why won't my input resize when I change the type to type="number" but it works with type="text"? EXAMPLE Email: <input type="text" name="email" size="10"><br/> number: <input ty..

Using querySelectorAll to retrieve direct children

I am able to do this: <div id="myDiv"> <div class="foo"></div> </div> myDiv = getElementById("myDiv"); myDiv.querySelectorAll("#myDiv > .foo"); That is, I can succes..

Generate GUID in MySQL for existing Data?

I've just imported a bunch of data to a MySQL table and I have a column "GUID" that I want to basically fill down all existing rows with new and unique random GUID's. How do I do this in MySQL ? I t..

Cannot implicitly convert type 'int' to 'short'

I wrote the following small program to print out the Fibonacci sequence: static void Main(string[] args) { Console.Write("Please give a value for n:"); Int16 n = Int16.Parse(Console.ReadLine(..

Using AES encryption in C#

I can't seem to find a nice clean example of using AES 128 bit encryption. Does anyone have some sample code?..

Pass Arraylist as argument to function

I have an arraylist A of Integer type. I created it as: ArrayList<Integer> A = new ArrayList<Integer>(); Now, I want to pass it as an argument to function AnalyseArray(). How can I a..

How to remove non-alphanumeric characters?

I need to remove all characters from a string which aren't in a-z A-Z 0-9 set or are not spaces. Does anyone have a function to do this?..

How to display HTML tags as plain text

I have an input form on my website where HTML is allowed and I'm trying to add instructions about the use of HTML tags. I'd like the text to <strong>Look just like this line - so then know how ..

Disable submit button when form invalid with AngularJS

I have my form like this: <form name="myForm"> <input name="myText" type="text" ng-model="mytext" required /> <button disabled="{{ myForm.$invalid }}">Save</button> &l..

Vertically aligning a checkbox

I have looked at the different questions regarding this issue, but couldn't find anything that works due to limitations in my markup. My markup looks like so (unfortunately as this is generated by so..

Bootstrap 4, how to make a col have a height of 100%?

how can I make a column take up 100% height of the browser w bootstrap 4? See the following: https://codepen.io/johnpickly/pen/dRqxjV Note the yellow div, I need this div/column to take up a height ..

From Now() to Current_timestamp in Postgresql

In mysql I am able to do this: SELECT * FROM table WHERE auth_user.lastactivity > NOW() - 100 now in postgresql I am using this query: SELECT * FROM table WHERE auth_user.lastactivity > CURR..

When can I use a forward declaration?

I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file: Am I allowed to do it for a base class, for a class held as a member, for a c..

How do I get the XML root node with C#?

I know that it's possible to get any XML node using C# if you know the node name, but I want to get the root node so that I can find out the name. Is this possible? Update: I'm using XMLTextReader to..

Primefaces valueChangeListener or <p:ajax listener not firing for p:selectOneMenu

I am using Primefaces 3.4.2. I have the following in my JSF page <p:selectOneMenu id="emp" value="#{mymb.emp.employeeName}" valueChangeListener="#{mymb.handleChange}" required="..

RHEL 6 - how to install 'GLIBC_2.14' or 'GLIBC_2.15'?

I need these 2 packages installed on RHEL 6 linux system. They are required by several other programs. When I do: sudo yum install glibc-devel this is output: Loaded plugins: product-id, securit..

Setting a WebRequest's body data

I'm creating a web request in ASP.NET and I need to add a bunch of data to the body. How do I do that? var request = HttpWebRequest.Create(targetURL); request.Method = "PUT"; response = (HttpWebRespo..

What is the difference between an expression and a statement in Python?

In Python, what is the difference between expressions and statements?..

Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.

I have used xuggle library in my project to trans code the video from mp4 to flv. I have used slf4j libraries also to support logging end. import com.xuggle.mediatool.IMediaReader; import com.xuggle...

How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

I want to use Oracle SQL Developer to generate an ER diagram for my DB tables but I am new to Oracle and this tool. What is the process for creating an ER diagram in SQL Developer?..

Python to print out status bar and percentage

To implement a status bar like below: [========== ] 45% [================ ] 60% [==========================] 100% I want to this to be printed out to stdout, and keep refr..

Most efficient way to increment a Map value in Java

I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times. Say I'm creating a..

mysql - move rows from one table to another

If i have two tables that are identical in structure, how can i move a set of rows from 1 table to the other? The set of rows will be determined from a select query. for example: customer table pe..

How to delete file from public folder in laravel 5.1

I want to delete a News from database and when I hit the delete button all data from database deleted but the image is remains in upload folder. So, how do I this to work. thanks This is my functio..

How can I clear the input text after clicking

Using jQuery, how can I clear the input text after I made a click? By default, the value remains in the input field. For example, I have an input text and the value is TEXT. When I perform a click, I..

CSS to line break before/after a particular `inline-block` item

Let's say I have this HTML: <h3>Features</h3> <ul> <li><img src="alphaball.png">Smells Good</li> <li><img src="alphaball.png">Tastes Great</..

How to list physical disks?

How to list physical disks in Windows? In order to obtain a list of "\\\\.\PhysicalDrive0" available...

What exactly is node.js used for?

Is it a web server or a programming language for server-side scripts?..

Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method

I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com. If I try to call it, I get the expected...: Origin http:..

Neither user 10102 nor current process has android.permission.READ_PHONE_STATE

I am trying to call getCallCapablePhoneAccounts() method of android.telecom.TelecomManager class. Though i have added required user-permission, i am getting Security exception. Here is the line of co..

User GETDATE() to put current date into SQL variable

I'm trying to get the current date into a variable inside a SQL stored procedure using the following commands DECLARE @LastChangeDate as date SET @LastChangeDate = SELECT GETDATE() This gives me th..

MySQL show current connection info

I am in a MySQL terminal session but I don't know what server I am connected to, or what database I am connected to. Is there a MySQL command that will tell me the host, port, and username and datab..

how to fix Cannot call sendRedirect() after the response has been committed?

I am trying to pass values from servlet to jsp page using the code below: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Pr..

How to insert newline in string literal?

In .NET I can provide both \r or \n string literals, but there is a way to insert something like "new line" special character like Environment.NewLine static property?..

To show only file name without the entire directory path

ls /home/user/new/*.txt prints all txt files in that directory. However it prints the output as follows: [me@comp]$ ls /home/user/new/*.txt /home/user/new/file1.txt /home/user/new/file2.txt /ho..

Code signing is required for product type 'Application' in SDK 'iOS5.1'

I am using xCode 4.3.1. After i created a project, i build it and tried to Archive. Then i got an error saying; (This is my first project in xCode 4.3.1) CodeSign error: code signing is required f..

CSS display:table-row does not expand when width is set to 100%

I'm having a bit of a problem. I'm using FireFox 3.6 and have the following DOM structure: <div class="view-row"> <div class="view-type">Type</div> <div class="view-name"..

Scheduling recurring task in Android

I'm designing an app that has a recurring task of sending presence to a dedicated server as long as the app is in foreground. In my searches across the web I saw a few different approaches and wanted..

Figure out size of UILabel based on String in Swift

I am trying to calculate the height of a UILabel based on different String lengths. func calculateContentHeight() -> CGFloat{ var maxLabelSize: CGSize = CGSizeMake(frame.size.width - 48, CGFlo..

If statement in select (ORACLE)

Hi I have simply select and works great: select 'CARAT Issue Open' issue_comment, i.issue_id, i.issue_status, i.issue_title, i.ISSUE_summary ,i.issue_description, i.severity, gcrs.Area_name, gcrs.sec..

How to change link color (Bootstrap)

<div class="collapse navbar-collapse"> <ul class="nav pull-right"> <li class="active"><a href="#">? ???</a></li> ..

Message 'src refspec master does not match any' when pushing commits in Git

I clone my repository with: git clone ssh://xxxxx/xx.git But after I change some files and add and commit them, I want to push them to the server: git add xxx.php git commit -m "TEST" git push or..

org.xml.sax.SAXParseException: Content is not allowed in prolog

I have a Java based web service client connected to Java web service (implemented on the Axis1 framework). I am getting following exception in my log file: Caused by: org.xml.sax.SAXParseException:..

How to write to an existing excel file without overwriting data (using pandas)?

I use pandas to write to excel file in the following fashion: import pandas writer = pandas.ExcelWriter('Masterfile.xlsx') data_filtered.to_excel(writer, "Main", cols=['Diff1', 'Diff2']) writer.s..

TypeError: only length-1 arrays can be converted to Python scalars while plot showing

I have such Python code: import numpy as np import matplotlib.pyplot as plt def f(x): return np.int(x) x = np.arange(1, 15.1, 0.1) plt.plot(x, f(x)) plt.show() And such error: TypeError: onl..

Index of duplicates items in a python list

Does anyone know how I can get the index position of duplicate items in a python list? I have tried doing this and it keeps giving me only the index of the 1st occurrence of the of the item in the lis..

plot different color for different categorical levels using matplotlib

I have this data frame diamonds which is composed of variables like (carat, price, color), and I want to draw a scatter plot of price to carat for each color, which means different color has different..

How can I present a file for download from an MVC controller?

In WebForms, I would normally have code like this to let the browser present a "Download File" popup with an arbitrary file type, like a PDF, and a filename: Response.Clear() Response.ClearHeaders() ..

How does a Breadth-First Search work when looking for Shortest Path?

I've done some research, and I seem to be missing one small part of this algorithm. I understand how a Breadth-First Search works, but I don't understand how exactly it will get me to a specific path,..

Is there a way to make npm install (the command) to work behind proxy?

Read about a proxy variable in a .npmrc file but it does not work. Trying to avoid manually downloading all require packages and installing...

HTML 5 video or audio playlist

Can I use a <video> or <audio> tag to play a playlist, and to control them? My goal is to know when a video/song has finished to play and take the next and change its volume...

What causes "Unable to access jarfile" error?

I want to execute my program without using an IDE. I've created a jar file and an exectuable jar file. When I double click the exe jar file, nothing happens, and when I try to use the command in cmd..

Android Crop Center of Bitmap

I have bitmaps which are squares or rectangles. I take the shortest side and do something like this: int value = 0; if (bitmap.getHeight() <= bitmap.getWidth()) { value = bitmap.getHeight(); }..

AngularJS Error: $injector:unpr Unknown Provider

I'm trying to build my own service by following the example in the documentation for the factory methodology. I think I've done something wrong however because I continue to get the unknown provider ..

Text vertical alignment in WPF TextBlock

How do I assign vertical center alignment to the text inside a TextBlock? I found TextAlignment property but it is for horizontal text alignment. How do I do it for vertical text alignment?..

Optional Parameters in Go?

Can Go have optional parameters? Or can I just define two functions with the same name and a different number of arguments?..

How to split a delimited string into an array in awk?

How to split the string when it contains pipe symbols | in it. I want to split them to be in array. I tried echo "12:23:11" | awk '{split($0,a,":"); print a[3] a[2] a[1]}' Which works fine. If my ..

MySQL: How to reset or change the MySQL root password?

How do I change the MySQL root password and username in ubuntu server? Do I need to stop the mysql service before setting any changes? I have a phpmyadmin setup as well, will phpmyadmin get updated..

the getSource() and getActionCommand()

What is getSource? and what does it return? and what is getActionCommand() and what does it return?? I am getting confused between these two can anyone give or differentiate them to me? what's the u..

prevent property from being serialized in web API

I'm using an MVC 4 web API and asp.net web forms 4.0 to build a rest API. It's working great: [HttpGet] public HttpResponseMessage Me(string hash) { HttpResponseMessage httpResponseMessage; L..

PHP remove all characters before specific string

I need to remove all characters from any string before the occurrence of this inside the string: "www/audio" Not sure how I can do this...

Checking if an Android application is running in the background

By background, I mean none of the application's activities are currently visible to the user?..

How do I check if a string is valid JSON in Python?

In Python, is there a way to check if a string is valid JSON before trying to parse it? For example working with things like the Facebook Graph API, sometimes it returns JSON, sometimes it could re..

Make an html number input always display 2 decimal places

I'm making a form where the user can enter a dollar amount using an html number input tag. Is there a way to have the input box always display 2 decimal places?..