Questions Tagged with #Sp executesql

EXEC sp_executesql with multiple parameters

How to pass the parameters to the EXEC sp_executesql statement correctly? This is what I have now, but i'm getting errors: alter PROCEDURE [dbo].[usp_getReceivedCases] -- Add the parameters for..

How to select data from 30 days?

I have query: SELECT name FROM ( SELECT name FROM Hist_answer WHERE id_city='34324' AND datetime >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) UNION ALL SELECT name FROM Hist_internet WHERE id_cit..

Regular expression for only characters a-z, A-Z

I don't know how to create a regular expression in JavaScript or jQuery. I want to create a regular expression that will check if a string contains only characters between a-z and A-Z with any arrang..

How would I create a UIAlertView in Swift?

I have been working to create a UIAlertView in Swift, but for some reason I can't get the statement right because I'm getting this error: Could not find an overload for 'init' that accepts the su..

VBA copy rows that meet criteria to another sheet

I am new to VBA...I want to copy a row from Sheet2 to Sheet1 if the first cell in this row says X and then do so for all the rows that meet this criteria. I have an error in the If condition...I don't..

How to allow user to pick the image with Swift?

I am writing my first iOS application (iPhone only) with Swift. The main application view should allow user to choose the image from the photo gallery. I've found the following sample code of ViewCo..

Set time to 00:00:00

I have a problem resetting hours in Java. For a given date I want to set the hours to 00:00:00. This is my code : /** * Resets milliseconds, seconds, minutes and hours from the provided date ..

How can I get npm start at a different directory?

I usually cd into the app directory and then run npm start. It is my feeling that there ought to be some way to run npm start with a path parameter. But, the npm start documentation contains no such ..

How do I convert a Swift Array to a String?

I know how to programmatically do it, but I'm sure there's a built-in way... Every language I've used has some sort of default textual representation for a collection of objects that it will spit ou..

How do I check if a Socket is currently connected in Java?

I'm trying to find out whether a Java TCP Socket is currently connected, the following just seems to tell me whether the socket has been connected at some point - not whether it is currently still con..


I am trying to convert a date to datetime but am getting errors. The datatype I'm converting from is (float,null) and I'd like to convert it to DATETIME. The first line of this code works fine, but I ..

JPA Criteria API - How to add JOIN clause (as general sentence as possible)

I am trying to construct queries dynamically, and my next target is add JOIN clauses (I don't know how can I use the API). By now, for example, this code work for me : ... Class baseClass; ... Cr..

How to know if an object has an attribute in Python

Is there a way in Python to determine if an object has some attribute? For example: >>> a = SomeClass() >>> a.someProperty = value >>> Traceback (most recent ca..

How to secure an ASP.NET Web API

I want to build a RESTful web service using ASP.NET Web API that third-party developers will use to access my application's data. I've read quite a lot about OAuth and it seems to be the standard, bu..

Jackson overcoming underscores in favor of camel-case

I retrieve a JSON string from internet; like most JSON I've seen it includes long keys that are separated by underscores. Essentially, my goal is to deserialize JSON into java-objects, but I don't use..

Git - How to use .netrc file on Windows to save user and password

Is it possible to use a .netrc file on Windows when I'm using Git to clone a remote repository with HTTP and user - password?..

How can I scale the content of an iframe?

How can I scale the content of an iframe (in my example it is an HTML page, and is not a popup) in a page of my web site? For example, I want to display the content that appears in the iframe at 80% ..

VBScript to send email without running Outlook

I have written an automated test that runs each night, and I would like to email the results each night once the test is finished. In order to do this I attempted to put the following at the end of m..

What is the difference between RTP or RTSP in a streaming server?

I'm thinking about developing a streaming server and I have the following question, do over RTSP (example url: rtsp:// or RTP (example url: rtp:// As I have u..

What's the difference between an Angular component and module

I've been watching videos and reading articles but this specific article make me so confused, at the start of the article it says The applications in Angular follow modular structure. The Angular app..

How to escape special characters in building a JSON string?

Here is my string { 'user': { 'name': 'abc', 'fx': { 'message': { 'color': 'red' }, 'user': { 'color': 'blue' ..

Could not load file or assembly 'System.Data.SQLite'

I've installed ELMAH 1.1 .Net 3.5 x64 in my ASP.NET project and now I'm getting this error (whenever I try to see any page): Could not load file or assembly 'System.Data.SQLite, Version=

Back to previous page with header( "Location: " ); in PHP

The title of this question kind of explains my question. How do I redirect the PHP page visitor back to their previous page with the header( "Location: URL of previous page" );..

How do I extract value from Json

I am getting a response String from server like below { "name": "Json", "detail": { "first_name": "Json", "last_name": "Scott", "age": "23" }, "status": "success" } I want to ge..

Powershell: count members of a AD group

RECIEVED AN EXAMPLE I COULD USE AND CORRECTED CODE My current question is how to count amount of members in a group versus printing out all members of a group (which includes their ID name or PC name..

Tomcat 7: How to set initial heap size correctly?

I was trying to adjust initial heap size of a tomcat 7 (CentOS, java -version: 1.6.0_25-b06) instance by adding the following line to export CATALINA_OPTS="-Xms=512M -Xmx=1024M" Starti..

how can select from drop down menu and call javascript function

I have a drop down which has many options. I want that when I select any option then it calls a function through JavaScript. the code which I used is here <select name="aa" onchange="report(this...

how to make div click-able?

<div><span>shanghai</span><span>male</span></div> For div like above,when mouse on,it should become cursor:pointer,and when clicked,fire a javascript function,h..

Setting a backgroundImage With React Inline Styles

I'm trying to access a static image to use within an inline backgroundImage property within React. Unfortunately, I've run up dry on how to do this. Generally, I thought you just did as follows: impor..

Pass a string parameter in an onclick function

I would like to pass a parameter (i.e. a string) to an Onclick function. For the moment, I do this: '<input type="button" onClick="gotoNode(' + + ')" />' with re..

Maven: How to rename the war file for the project?

I have a project bird with following components in pom.xml <groupId>com.myorg</groupId> <artifactId>bird</artifactId> <version>1.0-SNAPSHOT</version> ..

org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused in android

I am making an application that uploads images to server and updates its database to server in android while executing it, it shows an error Connection to http://localhost refused and many more er..

Iterate through 2 dimensional array

I have a "connect four board" which I simulate with a 2d array (array[x][y] x=x coordinate, y = y coordinate). I have to use "System.out.println", so I have to iterate through the rows. I need a way..

Jquery: how to sleep or delay?

i want move up the object, delay 1000ms , then hide it, i get the code: $("#test").animate({"top":"-=80px"},1500) .animate({"top":"-=0px"},1000) .animate({"opacity":"0"},500); i use "...

LINQ - Left Join, Group By, and Count

Let's say I have this SQL: SELECT p.ParentId, COUNT(c.ChildId) FROM ParentTable p LEFT OUTER JOIN ChildTable c ON p.ParentId = c.ChildParentId GROUP BY p.ParentId How can I translate this into LI..

How to force DNS refresh for a website?

I'm moving my web application to another server and in the next few days I'll refresh the DNS to point to the new IP location. Unfortunately some browsers and SOs keep a DNS cache that will make user..

How to print GETDATE() in SQL Server with milliseconds in time?

I want to print GETDATE() in SQL Server 2008, I need the time with milliseconds (this is for debugging purpose - to find sp's execution time ) I find this Difference SELECT GETDATE() returns 2011-..

Color picker utility (color pipette) in Ubuntu

I'am looking for a color picker utility on Ubuntu/Debian. Anything simple and easy to use...

How to read data from java properties file using Spring Boot

I have a spring boot application and I want to read some variable from my file. In fact below codes do that. But I think there is a good method for this alternative. Properties..

ImageMagick security policy 'PDF' blocking conversion

The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the ima..

Difference between Date(dateString) and new Date(dateString)

I have some code that tries to parse a date string. When I do alert(Date("2010-08-17 12:09:36")); It properly parses the date and everything works fine but I can't call the methods associated with D..

iterating quickly through list of tuples

I wonder whether there's a quicker and less time consuming way to iterate over a list of tuples, finding the right match. What I do is: # this is a very long list. my_list = [ (old1, new1), (old2, ne..

Getting Textbox value in Javascript

I am trying to get the value of the textbox in a javascript, but its not working. Given below is the code of my test page <%@ Page Title="" Language="VB" MasterPageFile="~/Site.Master" AutoEventWi..

Set cellpadding and cellspacing in CSS?

In an HTML table, the cellpadding and cellspacing can be set like this: <table cellspacing="1" cellpadding="1"> How can the same be accomplished using CSS?..

Cannot create a connection to data source Error (rsErrorOpeningConnection) in SSRS

I'm working on integrating a report into a browser, and I get this error: An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'dsFederatedS..

CSV with comma or semicolon?

How is a CSV file built in general? With commas or semicolons? Any advice on which one to use?..

How to determine if object is in array

I need to determine if an object already exists in an array in javascript. eg (dummycode): var carBrands = []; var car1 = {name:'ford'}; var car2 = {name:'lexus'}; var car3 = {name:'maserati'}; var..

How to list files inside a folder with SQL Server

How do I list files inside a folder in SQL Server without using the xp_cmdshell stored procedure?..

How to resolve the C:\fakepath?

<input type="file" id="file-id" name="file_name" onchange="theimage();"> This is my upload button. <input type="text" name="file_path" id="file-path"> This is the text field where I h..

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

web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="" xmlns="" xsi:schemaLocation="http:/..

git rebase: "error: cannot stat 'file': Permission denied"

I'm using git, and made a small commit followed by a large one. I decided to use git rebase to squash the two commits together before pushing them. (I've never done this before.) So I did: git rebas..

How to select last child element in jQuery?

How to select last child element in jQuery? Just the last child, not its descendants...

How can I store HashMap<String, ArrayList<String>> inside a list?

My hashmap stores the string as key and arraylist as the values. Now, I need to embed this into a list. That is, it will be of the following form: List<HashMap<String, ArrayList<String>&g..

How to add row in JTable?

Do you know how I can add a new row to a jTable?..

Get name of currently executing test in JUnit 4

In JUnit 3, I could get the name of the currently running test like this: public class MyTest extends TestCase { public void testSomething() { System.out.println("Current test is " + ..

How to create a numeric vector of zero length in R

I wonder, how can I create a numeric zero-length vector in R?..

How to set the timeout for a TcpClient?

I have a TcpClient which I use to send data to a listener on a remote computer. The remote computer will sometimes be on and sometimes off. Because of this, the TcpClient will fail to connect often. I..

Difference between database and schema

What's the difference between a Database and a Schema in SQL Server? Both are the containers of tables and data. If a Schema is deleted, then are all the tables contained in that schema also deleted ..

session handling in jquery

I am using following code to store value in session object in jQuery but i get error $.session function is not a function. I also add plugin "jquery.session.js" from githhub site but it is not work. ..

What's your favorite "programmer" cartoon?

Personally I like this one: P.S. Do not hotlink the cartoon without the site's permission please. ..

How to find event listeners on a DOM node when debugging or from the JavaScript code?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event? Events ..

how to loop through json array in jquery?

I have a php page from which I get response in json: [{'com':'something'},{'com':'some other thing'}] I want to loop it and append each to a div. This is what I tried: var obj = jQuery.parseJSON(..

Python try-else

What is the intended use of the optional else clause of the try statement?..

Fast and Lean PDF Viewer for iPhone / iPad / iOS - tips and hints?

There has been many Questions recently about drawing PDF's. Yes, you can render PDF's very easily with a UIWebView but this cant give the performance and functionality that you would expect from a g..

Flutter - Layout a Grid

I am trying to layout a 4x4 grid of tiles in flutter. I managed to do it with columns and rows. But now I found the GridView component. Could anyone provide an example on how to do it using it? I can..

Cmake is not able to find Python-libraries

Getting this error: sudo: unable to resolve host coderw@ll -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandle..

Insertion sort vs Bubble Sort Algorithms

I'm trying to understand a few sorting algorithms, but I'm struggling to see the difference in the bubble sort and insertion sort algorithm. I know both are O(n2), but it seems to me that bubble sort..

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

Opening A Specific File With A Batch File?

I'm would like to know how I can open a specific file using a specific program with a batch file. So far, my batch file can open the program, but I'm not sure how to open a file with that program. @..

Convert a number range to another range, maintaining ratio

I'm trying to convert one range of numbers to another, maintaining ratio. Maths is not my strong point. I have an image file where point values may range from -16000.00 to 16000.00 though the typical..

Good beginners tutorial to

I am very new to the world of webdevelopment and jumped into the bandwagon because I find the concept of HTML5 very interesting. I am fairly confident on working with canvas and would now like to move..

Create Generic method constraining T to an Enum

I'm building a function to extend the Enum.Parse concept that Allows a default value to be parsed in case that an Enum value is not found Is case insensitive So I wrote the following: public stat..

The apk must be signed with the same certificates as the previous version

I had uploaded my app to Google Play (back when it was called Android Market) some time ago. Today I updated the app, but I had deleted the previous keystore and created a new one. When uploading, it..

React-router: How to manually invoke Link?

I'm new to ReactJS and to React-Router. I have a component that receives through props a <Link/> object from react-router. Whenever the user clicks on a 'next' button inside this component I wan..

How to get label of select option with jQuery?

<select> <option value="test">label </option> </select> The value can be retrieved by $select.val(). What about the label? Is there a solution that will work in IE6?..

Switch case: can I use a range instead of a one number

I want to use switch, but I have many cases, is there any shortcut? So far the only solution I know and tried is: switch (number) { case 1: something; break; case 2: other thing; break; ... case 9:..

Bitbucket git credentials if signed up with Google

I have an account on that I created by signing up with my Google account. Now everytime I log in I just click "Log in with Google" and that's fine. How can I access my repos from git co..

How do I move a file (or folder) from one folder to another in TortoiseSVN?

I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Usi..

How To Change DataType of a DataColumn in a DataTable?

I have: DataTable Table = new DataTable; SqlConnection = new System.Data.SqlClient.SqlConnection("Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + ";Integrated Security=SSPI; Connect..

Toggle button using two image on different state

I need to make a toggle button using two image instead of ON/OFF state. At off state i set a background image.But the OFF text can not removed while i use background image. And i can not set another..

The Completest Cocos2d-x Tutorial & Guide List

I'm developing a game using Cocos2d-x to Android and iPhone. At the beggining, I had a lot of problems to start using this library, so, in this question, I want to collect all basic, medium and expert..

Android getText from EditText field

I have a problem with getting text from EditText field to insert it in Email composer with intent. I've declared EditText field in layout file (@+id/vnosEmaila): <?xml version="1.0" encoding="utf-..

Eclipse won't compile/run java file

I am just trying to compile and run a simple java program. When I go to run my tester class it says select what to run and it gives me Ant Build which when highlighted says "Launches an Ant build with..

Creating a script for a Telnet session?

Does anyone know of an easy way to create a script that can connect to a telnet server, do some usual telnet stuff, and then log off? I am dealing with users who are not familiar with telnet and the ..

What is the difference between Amazon SNS and Amazon SQS?

When would I use SNS versus SQS, and why are they always coupled together?..

What is JavaScript garbage collection?

What is JavaScript garbage collection? What's important for a web programmer to understand about JavaScript garbage collection, in order to write better code?..

Convert string to boolean in C#

I need help converting a string to a bool value: I've been trying to get the value (true or false) from the TopMost for my program and save it in my settings. Settings1.Default["tm"] = ; Settings1.D..

How to support different screen size in android

I'm developing an app in android and I have to support all different screen sizes and density. So i've created different folder for layout : layout-small layout-large and layout. Then I've created d..

Creating random colour in Java?

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

List supported SSL/TLS versions for a specific OpenSSL build

I have, for example, OpenSSL version 1.0.0o on my Linux system, and I want to know which SSL/TLS versions are supported with this build. Is there a shell command to accomplish this?..

How to unzip a file using the command line?

Which commands can be used via the command line to unzip a file? Preferably something built into Windows or open source/free tools...

How to give ASP.NET access to a private key in a certificate in the certificate store?

I have an ASP.NET application that accesses private key in a certificate in the certificates store. On Windows Server 2003 I was able to use winhttpcertcfg.exe to give private key access to the NETWOR..

Windows batch: echo without new line

What is the Windows batch equivalent of the Linux shell command echo -n which suppresses the newline at the end of the output? The idea is to write on the same line inside a loop...

Exception thrown in catch and finally clause

On a question for Java at the university, there was this snippet of code: class MyExc1 extends Exception {} class MyExc2 extends Exception {} class MyExc3 extends MyExc2 {} public class C1 { pub..

Get unique values from a list in python

I want to get the unique values from the following list: ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow'] The output which I require is: ['nowplaying', 'PBS', 'job', 'deba..

Emulate/Simulate iOS in Linux

I'm developing a web app that apparently is having problems in iOS devices. The problem is that I don't own an iOS device and I develop in Linux Ubuntu. I'm looking for a way to emulate/simulate this ..

How to execute a function when page has fully loaded?

I need to execute some JavaScript code when the page has fully loaded. This includes things like images. I know you can check if the DOM is ready, but I don’t know if this is the same as when the p..

What's is the difference between train, validation and test set, in neural networks?

I'm using this library to implement a learning agent. I have generated the training cases, but I don't know for sure what the validation and test sets are. The teacher says: 70% should be train c..

Specify JDK for Maven to use

I am trying to build a Hudson plugin I've modified and it requires jdk1.6. This is fine, but I don't see how I can tell maven where the different jdk is. I've found few mentions on the internet but th..

Loop through an array in JavaScript

In Java you can use a for loop to traverse objects in an array as follows: String[] myStringArray = {"Hello", "World"}; for (String s : myStringArray) { // Do something } Can you do the same in..

How do I use checkboxes in an IF-THEN statement in Excel VBA 2010?

I need to use the value of checkboxes for an IF-THEN statement. Based on what the user checks, the way I have to calculate things changes. However, I can't figure out how to use the checkbox values, o..

What is the simplest method of inter-process communication between 2 C# processes?

I want to create a communication between a parent and a child process, both written in C#. It should be asynchronous, event-driven. I don't want to run a thread in every process to handle the very rar..

How do I create an HTML table with a fixed/frozen left column and a scrollable body?

I need a simple solution. I know it's similar to some other questions, like: HTML table with fixed headers and a fixed column? How can I lock the first row and first column of a table when scrolling..

Flutter- wrapping text

I want wrap text as text grows. I searched through and tried wrap with almost everything but still text stays one line and overflows from the screen. Does anyone know how to achieve this? Any help is..

How to 'update' or 'overwrite' a python list

aList = [123, 'xyz', 'zara', 'abc'] aList.append(2014) print aList which produces o/p [123, 'xyz', 'zara', 'abc', 2014] What should be done to overwrite/update this list. I want the o/p to be [2..

PHP Composer behind http proxy

I use composer on a network where the only way to access the internet is using HTTP or socks proxy. I have http_proxy and https_proxy environment variables. When compose tries to access HTTPS URLs I g..

How could I use requests in asyncio?

I want to do parallel http request tasks in asyncio, but I find that python-requests would block the event loop of asyncio. I've found aiohttp but it couldn't provide the service of http request using..

ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)

I created a Windows 2003 R2 Virtual Machine running on VirtualBox and I installed Oracle (10201_database_win32). I assigned a static IP on the Virtual Ethernet too. Everything worked great right aft..

How to create relationships in MySQL

In class, we are all 'studying' databases, and everyone is using Access. Bored with this, I am trying to do what the rest of the class is doing, but with raw SQL commands with MySQL instead of using A..

Copy rows from one table to another, ignoring duplicates

I have 2 tables (srcTable1 & destTable) that have identical schemas. I am trying to copy all rows from srcTable to destTable and ignore the duplicates. I thought I could just add a WHERE clause wi..

How to take a first character from the string

Using VB.Net & SQL Server 2005 Dim S as string s = "Rajan" s = "Sajan" I want to take a first character from the string (s) Expected Output R S Need VB.Net Code Help..

Labels for radio buttons in rails form

My question is similar to this one but for a Rails app. I have a form with some radio buttons, and would like to associate labels with them. The label form helper only takes a form field as a paramet..

How do you post data with a link

I have a database which holds the residents of each house in a certain street. I have a 'house view' php web page which can display an individual house and residents when given the house number using ..

How can I find out which server hosts LDAP on my windows domain?

I am trying develop an application (C#) to query an LDAP server. I don't know the actual server named to query - is there a way to find out using standard windows tools or something in .net? I've al..

Why does Eclipse complain about @Override on interface methods?

I have an existing project that uses @Override on methods that override interface methods, rather than superclass methods. I cannot alter this in code, but I would like Eclpse to stop complaining abou..

Create a custom View by inflating a layout?

I am trying to create a custom View that would replace a certain layout that I use at multiple places, but I am struggling to do so. Basically, I want to replace this: <RelativeLayout android:id..

Making a Sass mixin with optional arguments

I am writing a mixin like this: @mixin box-shadow($top, $left, $blur, $color, $inset:"") { -webkit-box-shadow: $top $left $blur $color $inset; -moz-box-shadow: $top $left $blur $color $inset;..

Extract a subset of a dataframe based on a condition involving a field

I have a large CSV with the results of a medical survey from different locations (the location is a factor present in the data). As some analyses are specific to a location and for convenience, I'd li..

What are callee and caller saved registers?

I'm having some trouble understanding the difference between caller and callee saved registers and when to use what. I am using the MSP430 : procedure: mov.w #0,R7 mov.w #0,R6 add.w R6,R7 inc.w..

Changing all files' extensions in a folder with one command on Windows

How can I use the Windows command line to change the extensions of thousands of files to *****.jpg?..

How to load all modules in a folder?

Could someone provide me with a good way of importing a whole directory of modules? I have a structure like this: /Foo I tried just converting it to a package by ..

How do I uninstall a package installed using npm link?

When installing a node package using sudo npm link in the package's directory, how can I uninstall the package once I'm done with development? npm link installs the package as a symbolic link in the ..

How to get all of the immediate subdirectories in Python

I'm trying to write a simple Python script that will copy a index.tpl to index.html in all of the subdirectories (with a few exceptions). I'm getting bogged down by trying to get the list of subdire..

How to disable scrolling the document body?

I have a HTML which has lot of content and a vertical scrollbar appears as soon as the HTML is loaded. Now from this HTML a full screen IFRAME is loaded. The problem is when the IFRAME is loaded, the ..

format a number with commas and decimals in C# ( MVC3)

I Need to display a number with commas and decimal point. Eg: Case 1 : Decimal number is 432324 (This does not have commas or decimal Points) Need to display it as 432,324.00 but not 432,324 Ca..

How to get selected value of a html select with

I have code below: <select id="testSelect"> <option value="1">One</option> <option value="2">Two</option> </select> <asp:Button ID="btnTest" runat="serv..

phpMyAdmin allow remote users

I need to modify the file /etc/httpd/conf.d/phpMyAdmin.conf in order to allow remote users (not only localhost) to login # phpMyAdmin - Web based MySQL browser written in php # # Allows only localho..

Write output to a text file in PowerShell

I've compared two files using the following code: Compare-Object $(Get-Content c:\user\documents\List1.txt) $(Get-Content c:\user\documents\List2.txt) How can I write the output of this to a new t..

How do I check whether an array contains a string in TypeScript?

Currently I am using Angular 2.0. I have an array as follows: var channelArray: Array<string> = ['one', 'two', 'three']; How can I check in TypeScript whether the channelArray contains a stri..

How to use regex in XPath "contains" function

I would like to match the following text sometext12345_text using the below regex. I'm using this in one of my selenium tests. String expr = "//*[contains(@id, 'sometext[0-9]+_text')]"; driver.find..

Difference between git pull and git pull --rebase

I started using git sometime back and do not fully understand the intricacies. My basic question here is to find out the difference between a git pull and git pull --rebase , since adding the --rebase..

Easiest way to use SVG in Android?

I have found a myriad of libraries in order to use svg in Android and avoid the frustrating creation of different resolutions and dropping files for each resolution, this becomes very annoying when th..

Check OS version in Swift?

I'm trying to check system information in Swift. I figured out, that it could be achieved by code: var sysData:CMutablePointer<utsname> = nil let retVal:CInt = uname(sysData) I have two probl..

Is it possible to indent JavaScript code in Notepad++?

I have some JavaScript code that is written in one line (no carriage returns), it's completely unreadable... With Notepad++, I tried to replace these characters ({, }, ;) by themselves plus a carriag..

Find kth smallest element in a binary search tree in Optimum way

I need to find the kth smallest element in the binary search tree without using any static/global variable. How to achieve it efficiently? The solution that I have in my mind is doing the operation in..

How can I make a horizontal ListView in Android?

Possible Duplicate: Horizontal ListView in Android? Like many things in Android, you wouldn't think this would be such a hard problem but ohhh, by golly, would you be wrong. And, like many..

Android TextView Justify Text

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-center..

Local file access with JavaScript

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

php.ini & SMTP= - how do you pass username & password

My ISP account requires that I send a username & password for outbound SMTP mail. How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (S..

How to search a specific value in all tables (PostgreSQL)?

Is it possible to search every column of every table for a particular value in PostgreSQL? A similar question is available here for Oracle. ..

java.lang.IllegalStateException: Fragment not attached to Activity

I am rarely getting this error while making an API call. java.lang.IllegalStateException: Fragment not attached to Activity I tried putting the code inside isAdded() method to check whether fragm..

Find by key deep in a nested array

Let's say I have an object: [ { 'title': "some title" 'channel_id':'123we' 'options': [ { 'channel_id':'abc' 'image':'h..

SVN Repository on Google Drive or DropBox

Is it possible to setup SVN repo/server on google drive or dropbox etc? I want to put my PhD project under version control. The data has to stay private and only accessible to me and my supervisors...

How do I get the current mouse screen coordinates in WPF?

How to get current mouse coordination on the screen? I know only Mouse.GetPosition() which get mousePosition of element, but I want to get the coordination without using element...

What does the @Valid annotation indicate in Spring?

In the following example, the ScriptFile parameter is marked with an @Valid annotation. What does @Valid annotation do? @RequestMapping(value = "/scriptfile", method = RequestMethod.POST) public..

How to temporarily exit Vim and go back

How could I exit Vim, not :q, and then go back to continue editing?..

What are all the common ways to read a file in Ruby?

What are all the common ways to read a file in Ruby? For instance, here is one method: fileObj =$fileName, "r") while (line = fileObj.gets) puts(line) end fileObj.close I know Ruby is ..

How to convert interface{} to string?

I'm using docopt to parse command-line arguments. This works, and it results in a map, such as map[<host> <port>:80 --help:false --version:false] Now I would like to conca..

Converting pfx to pem using openssl

How to generate a .pem CA certificate and client certificate from a PFX file using OpenSSL...

Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra/Mojave?

It looks like the launchd.conf does not load my environment variable anymore. Has anyone else noticed that? Is there another solution to permanently set environment variables?..

Turning error reporting off php

I wanted to turn off the error reporting on a website. Googling for it I found that placing the code mentioned below in the website stops the errors from getting displayed on the screen. I placed it i..

How to insert a value that contains an apostrophe (single quote)?

What is the correct SQL syntax to insert a value with an apostrophe in it? Insert into Person (First, Last) Values 'Joe', 'O'Brien' I keep getting an error as I think the apostrophe after the..

How do I set the selenium webdriver get timeout?

When I am using a proxy in webdriver like FirefoxDriver, if the proxy is bad then the get method will block forever. I set some timeout parameters, but this did not work out. This is my code: Firefo..

Excel formula to remove space between words in a cell

I've a huge data in excel file. For eg: say i've a word like paul son,i've to make it as paulson. input:paul son output:paulson. In some cells ,i've data like mic-li,when this type of words come,it..

convert datetime to date format dd/mm/yyyy

I have a DateTime object 2/19/2011 12:00:00 AM. I want to convert this object to a string 19/2/2011. Please help me to convert DateTime to string format...

Splitting on last delimiter in Python string?

What's the recommended Python idiom for splitting a string on the last occurrence of the delimiter in the string? example: # instead of regular split >> s = "a,b,c,d" >> s.split(",") >..

git: How to diff changed files versus previous versions after a pull?

When I run "git pull" I often want to know what changed between the last version of a file and the new one. Say I want to know what someone else committed to a particular file. How is that done? I'..

Couldn't connect to server

I'm getting the following error: alex@alex-K43U:/$ mongo MongoDB shell version: 2.2.0 connecting to: test Thu Oct 11 11:46:53 Error: couldn't connect to server src/mongo/shell/mongo.j..

Align two inline-blocks left and right on same line

How can I align two inline-blocks so that one is left and the other is right on the same line? Why is this so hard? Is there something like LaTeX's \hfill that can consume the space between them to ac..

How to set viewport meta for iPhone that handles rotation properly?

So I've been using: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/> to get my HTML content to display nicely on the iPhone. It works great until t..

How to split a dos path into its components in Python

I have a string variable which represents a dos path e.g: var = "d:\stuff\morestuff\furtherdown\THEFILE.txt" I want to split this string into: [ "d", "stuff", "morestuff", "furtherdown", "THEFILE.t..

JSON post to Spring Controller

Hi I am starting with Web Services in Spring, so I am trying to develop small application in Spring + JSON + Hibernate. I have some problem with HTTP-POST. I created a method: @RequestMapping(value="..

How can I get the height and width of an uiimage?

From the URL Image in Mail I'm adding image to mail view. It will show full image. But I want to calculate, proportionally change the height and width of the image. How can I get the height and widt..

heroku - how to see all the logs

I have a small app on heroku. Whenever I want to see the logs I go to the command line and do heroku logs That only shows me about 100 lines. Is there not a way to see complete logs for our appl..

How to initialize a vector with fixed length in R

How to initialize a vector with fixed length in R ?? For example, I want a vector of characters with length of 10??..

Changing navigation bar color in Swift

I am using a Picker View to allow the user to choose the colour theme for the entire app. I am planning on changing the colour of the navigation bar, background and possibly the tab bar (if that is p..

How do I add a ToolTip to a control?

I would like to display a ToolTip for when the mouse is hovering over a control. How does one create a tooltip in code, but also in the designer?..

remove space between paragraph and unordered list

<p>Text</p> <ul> <li>One</li> </ul> <p>Text 2</p> How do i remove the vertical space between paragraph and the list. To be more specific - how do..

How do I check the difference, in seconds, between two dates?

There has to be an easier way to do this. I have objects that want to be refreshed every so often, so I want to record when they were created, check against the current timestamp, and refresh as neces..

Uncaught TypeError: Cannot read property 'ownerDocument' of undefined

I'm teaching myself AJAX to AJAXify my site. In my template, I have the following JS code to get some JSON data from a view then append the data to a div. function filter(type) { $.getJSON( '/a..

Appending HTML string to the DOM

How to append this HTML string var str = '<p>Just some <span>text</span> here</p>'; to the DIV with the ID 'test' which is in the DOM? (Btw div.innerHTML += str; is not acc..

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for o..

Access Control Origin Header error using Axios in React Web throwing error in Chrome

Im making an API call using Axios in a React Web app. However Im getting the error in Chrome as, XMLHttpRequest cannot load No 'Access-Control-Allow-Origi..

The Eclipse executable launcher was unable to locate its companion launcher jar windows

I am facing a small issue and need help on it. I had to re-install Windows on my laptop. After that I installed Java, extracted Eclipse and set the environment variables, namely Path to the Java bin ..

warning: assignment makes integer from pointer without a cast

When I declare a char * to a fixed string and reuse the pointer to point to another string /* initial declaration */ char *src = "abcdefghijklmnop"; ..... /* I get the "warning: assignment makes i..

Increment counter with loop

This question is related to my previous question : Jsp iterate trough object list I want to insert counter that starts from 0 in my for loop, I've tried several combinations so far : 1. <c:forE..

jQuery Validate Required Select

I am trying to validate html select element using jQuery Validate plugin. I set "required" rule to true but it always passes validation because zero index is chosed by default. Is there any way to def..

Get only the date in timestamp in mysql

On my database under the t_stamp columns I have the date for example 2013-11-26 01:24:34 From that same column I only want to get the date 2013-11-26 How can i do this? Thank You!..

Git merge develop into feature branch outputs "Already up-to-date" while it's not

I checked out a feature branch from develop called branch-x. After a while other people pushed changes to the develop branch. I want to merge those changes into my branch-x. However if I do git me..

How can I loop through a C++ map of maps?

How can I loop through a std::map in C++? My map is defined as: std::map< std::string, std::map<std::string, std::string> > For example, the above container holds data like this: m["na..

Hibernate: in production?

Is it okay to run Hibernate applications configured with to update the database schema in a production environment?..

Add marker to Google Map on Click

I'm surprisingly struggling to find a very simple example of how to add a marker(s) to a Google Map when a user left clicks on the map. I have looked around for the past couple of hours, and consulte..

Difference between "and" and && in Ruby?

What is the difference between the && and and operators in Ruby?..

jQuery get content between <div> tags

This'll probably be easy for someone: var x = '<p>blah</p><div><a href="

How to handle button clicks using the XML onClick within Fragments

Pre-Honeycomb (Android 3), each Activity was registered to handle button clicks via the onClick tag in a Layout's XML: android:onClick="myClickMethod" Within that method you can use view.getId..

How to remove spaces from a string using JavaScript?

How to remove spaces in a string? For instance: Input: '/var/www/site/Brand new document.docx' Output: '/var/www/site/Brandnewdocument.docx' ..

The input is not a valid Base-64 string as it contains a non-base 64 character

I have a REST service that reads a file and sends it to another console application after converting it to Byte array and then to Base64 string. This part works, but when the same stream is received a..

Git Bash is extremely slow on Windows 7 x64

I've been using Git on both Windows and Ubuntu during the development of a small project, frequently flipping back and forth between the two. The issue is that Git Bash consistently becomes slow. Whe..

Python append() vs. + operator on lists, why do these give different results?

Why do these two operations (append() resp. +) give different results? >>> c = [1, 2, 3] >>> c [1, 2, 3] >>> c += c >>> c [1, 2, 3, 1, 2, 3] >>> c = [1, 2..

Error:attempt to apply non-function

I'm trying to run the following code in R, but I'm getting an error. I'm not sure what part of the formula is incorrect. Any help would be greatly appreciated. > censusdata_20$AGB93 = WD * exp(-1..

What is a JavaBean exactly?

I understood, I think, that a "Bean" is a Java class with properties and getters/setters. As much as I understand, it is the equivalent of a C struct. Is that true? Also, is there a real syntactic di..

How to stop process from .BAT file?

So I have process I started from one bat file. How to stop it from another?..

Apache - MySQL Service detected with wrong path. / Ports already in use

I'm getting the following errors when I launch XAMPP. 12:35:23 [main] Initializing Control Panel 12:35:23 [main] Windows Version: 64-bit 12:35:23 [main] XAMPP Version: 1.8.1 12:35:23 [..

What is the different between RESTful and RESTless

What is basic difference between restful and restless, i've been reading a few articles people seem to use them interchangeably...

Access key value from Web.config in Razor View-MVC3 ASP.NET

How do I access a key value from web.config in my Razor view. This is in my web.config in the Web Project root level. <appSettings> <add key="myKey" value="MyValue"/> </appSetting..

How do I find out if a column exists in a VB.Net DataRow

I am reading an XML file into a DataSet and need to get the data out of the DataSet. Since it is a user-editable config file the fields may or may not be there. To handle missing fields well I'd like ..

Count number of occurrences for each unique value

Basically I have a table similar to this: time.....activities.....length 13:00........3.............1 13:15........2.............2 13:00........3.............2 13:30........1.............1 ..

What is the purpose of .PHONY in a Makefile?

What does .PHONY mean in a Makefile? I have gone through this, but it is too complicated. Can somebody explain it to me in simple terms?..

How to update json file with python

I'm trying to update existing Json file, but from some reason, the requested value is not being changed but the entire set of values (with the new value) is being appended to the original file jsonF..

Getting result of dynamic SQL into a variable for sql-server

Executing dynamic SQL as follows in Stored Procedure: DECLARE @sqlCommand nvarchar(1000) DECLARE @city varchar(75) SET @city = 'London' SET @sqlCommand = 'SELECT COUNT(*) FROM customers WHERE City = ..