How to escape regular expression in javascript? [duplicate]

How to escape regular expression in javascript? [duplicate]

This question already has an answer here: Is there a RegExp.escape function in Javascript? 12 answers I have code like:pattern = 'arrayname[1]'; // fet

How to pick an image from gallery (SD Card) for my app?

How to pick an image from gallery (SD Card) for my app?

This question was originally asked for Android 1.6.I am working on photos options in my app. I have a button and an ImageView in my Activity. When I click the button it would redirect to the gallery and I would be able to select an image. T

PHP parse/syntax errors; and how to solve them?

PHP parse/syntax errors; and how to solve them?

Everyone runs into syntax errors. Even experienced programmers make typos. For newcomers it's just part of the learning process. However, it's often easy to interpret error messages such as: PHP Parse error: syntax error, unexpected '{' in

Are 301 redirects possible using javascript or jQuery?

Are 301 redirects possible using javascript or jQuery?

I'm running apache2.0 and I'm just wondering if it is possible to make a 301 redirect using javascript or jQuery. I have an tag with href to a specified location and I'm asked to make a 301 redirect when I click that link. This is for SEO

Java -classpath option

Java -classpath option

Will the use of -classpath option with java, add to or replace the contents of the CLASSPATH env variable? 1:Using the classpath variable it overrides the CLASSPATH of Environment variable but only for that session. If you restart the ap

SharePoint List Scalability

SharePoint List Scalability

I am particularly interested in Document Libraries, but in terms of general SharePoint lists, can anyone answer the following...?What is the maximum number of items that a SharePoint list can contain?What is the maximum number of lists that

Is there any way to integrate OpenCV with PHP?

Is there any way to integrate OpenCV with PHP?

I am trying to develop an application with PHP.There are two possible ways this application will be developed. The first one is to try to do something like www.picnik.com, image processing directly on the browser.The other is to develop CBI

What is the _REENTRANT flag?

What is the _REENTRANT flag?

which compiling a multithreaded program we use gcc like below:gcc -lpthread -D_REENTRANT -o someprogram someprogram.cwhat exactly is the flag -D_REENTRANT doing over here? 1:Defining _REENTRANT causes the compiler to use thread safe (i.e

cannot connect to pc-name\\SQLEXPRESS

cannot connect to pc-name\\SQLEXPRESS

While trying to connect to SQL server 2005 standard edition through SQL Server Management Studio 2005 I get the following error:I put all my effort to solve this problem but there is no solution. On stack overflow in the following post link

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Fedora's yum package management tool has a nice option called whatprovides, which lets you find what package has installed a specific binary or file. What is the equivalent command on Ubuntu?For example, say I'd like to find what package pr

Elliptic Curve Crypto in iOS

Elliptic Curve Crypto in iOS

I'm trying to incorporate ECC into an iPhone app that is being used for secure communications but I'm having a hard time finding a proper library / tutorial on how to do this in objective-c. I read this post:How to use ECC in iOSBut it was

SearchView doesn't filter in each child Tab of TabLayout

SearchView doesn't filter in each child Tab of TabLayout

Here, I have a toolbar in an Activity which contains a SearchView. And that activity has multiple fragments. One main fragment out of them have 10 more fragments inside itself. All 10 fragments are showing data in listviews. Now I'm trying

How to know in which file that defined a js global var in chrome console?

How to know in which file that defined a js global var in chrome console?

How to find out which file and line a variable was defined in using google chrome console?For example, the variable Native (from MooTools) has been defined in global scope. I want to know in which file that defined this variable using googl

add class via jquery but only when not exists

add class via jquery but only when not exists

I would like to add a class (class="bbox") to a ul-list but only if no class exists.This is what i have so far. How do I check with jquery if a class exists in the ul-tag?$("ul").addClass("bbox"); 1:If you want to check if a specific cla

Google Spell check URI not working

Google Spell check URI not working

http://www.google.com/tbproxy/spell?lang=encan any one help me finding google spell check API Url 1:Check this link and replace test with your suggested word - www.google.com/complete/search?output=toolbar&q=test 2:From searching arou

Best way to safely read query string parameters?

Best way to safely read query string parameters?

We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe.For example, the page at

DICOM affine matrix transformation from image space to patient space in Matlab

DICOM affine matrix transformation from image space to patient space in Matlab

From the nifti header its easy to get the affine matrix. However in the DICOM header there are lots of entries, but its unclear to me which entries describe the transformation of which parameter to which new space.I have found a tutorial wh

Sending an ASP.net POST with Python's Requests

Sending an ASP.net POST with Python's Requests

I'm scraping an old ASP.net website using Python's requests module.I've spent 5+ hours trying to figure out how to simulate this POST request to no avail. Doing it the way I do it below, I essentially get a message saying "No item matches t

PDF Manipulation on iPhone SDK

PDF Manipulation on iPhone SDK

I have been reading Apple's docs and they recommend using UIWebView. This is all well and good until you want to go to a page number and also search PDF's.Is there any 3rd Party libraries, (free or paid) that do this at all? As a minimum

Tweepy (Twitter API) Not Returning all Search Results

Tweepy (Twitter API) Not Returning all Search Results

I'm using the search feature with Tweepy for Twitter and for some reason the search results are limited to 15. Here is my coderesults=api.search(q="Football",rpp=1000)for result in results: print "%s" %(clNormalizeString(result.text))pr

How do I edit and delete data in Django?

How do I edit and delete data in Django?

I am using django 1.0 and I have created my models using the example in the Django book. I am able to perform the basic function of adding data; now I need a way of retrieving that data, loading it into a form (change_form?! or something),

Android - Tabs in bottom of screen

Android - Tabs in bottom of screen

I have been looking for about a day for a way to get my android application have tabs in the bottom of the screen.On the Android Developer website in the Styles and Themes section, they seem to have the exact example of what I am trying to

How to Make RichTextBox Text Only? [duplicate]

How to Make RichTextBox Text Only? [duplicate]

Possible Duplicate: How to prevent richTextBox to paste images within it? If you're using Richtextbox, there are several advantages in Richtextbox for example: we can use color font on it Setting custom font in a region Attach fi

Downloading You tube videos?

Downloading You tube videos?

I want to download you tube videos programatically (using Java). How can i convert you tube video link to a downloadable URL. Browser plays youtube videos with following code. I tried downloading from URL http://www.youtube.com/v/OdAE3cWlm

Vim incremental search during substitution

Vim incremental search during substitution

I am terrible at writing vim regular expressions. Whenever I write one to do a substition, it never works the first time because I inevitably end up writing something Perl instead of vim. I fare a lot better when doing a simple search becau