Modifying the current reg-ex to allow special characters

I have this reg-ex to validate comma separated values: regex = "/^[-\w\s]+(?:,[-\w\s]+)*$/" Currently there are no special characters allowed. What modification to this can be made to allow special characters in each comma separated value?Just a

UIViewController Rotates Methods

What object is responsible for dipatching the UIViewController rotation method calls, i.e: shouldAutorotateToInterfaceOrientation: willRotateToInterfaceOrientation:duration: willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: willAnimateSe

Unable to get the shell script executed from Python

I want to run a script multiple times, with different paths as arguments, and see the output. If I run the script path/lizard with argument path_to_code/code1.cpp in a command prompt path/lizard path_to_code/code1.cpp I get output - and I would like

Evaluation and removal of duplicate rights from a Python list

I've spent a great deal of time trying to figure this out on my own and am now in jeopardy of missing my deadline, so I thought I'd see if anyone here might be able to help. Business problem: I have a list of dicts that represent the given student's

Python - Dummies of addition

I currently have data coming in using the facebook api that looks like this [(9, 0), (10, 0), (11, 0), (12, 0)] [(5, 2), (6, 2), (7, 0), (8, 2), (9, 0), (10, 0), (11, 3), (12, 1)] [(1, 1), (2, 0), (3, 1), (4, 1), (5, 0), (6, 0), (7, 0), (8, 0), (9, 0

Float property in css

I have two p tag and one (id=floating) is having css property {float: right}. This affects the other p tag (id=toCenter) which have the style {text-align: center}. ie. text alignment is only applicable to remaining area. Even though this output is un

Replace the HTML tag with a new label

How can I replace the html tag with a new tag using jQuery? I have many table tags and I want to replace a specific table containing a class. All of its' child nodes should be replaced too. <table class='replace_this'> <tr> <td> All tabl

Unable to access the index of the Bar item using swift tab.

Environment: xcode 6GM, Language Swift. I was setting image color of a tabBar item using this code in xcode 6 beta2 var cameraTab : UITabBarItem = self.tabBar.items[1] as UITabBarItem But now in xcode 6GM it is giving error. Error: [AnyObject]? does

Mongodb: Can not Add to Table Using String Field Name

i am trying to push inside a subarray using $push but got a Mongo error, and not able to get through this after considerable search on google, and findOneAndUpdate didn't worked out so i used find and update separately { [MongoError: can't append to

Empty space under footer

I tried a lot of options, but was unable to to find a solution. Here is a page with a problem. When selected All products, everything ok. When we choose a specific category (eg. Antique Wallets), footer jumps and there is a blank space under it. I ca

DirContextOperations is null

So I have an application that works perfectly on my desktop, and also works perfectly when deployed to tomcat on a windows machine. However, when I attempt to use this application while deployed on the same version of tomcat, but on AIX, it fails to

create a new data framework with existing ones

Suppose I have the following data frames treatmet1<-data.frame(id=c(1,2,7)) treatment2<-data.frame(id=c(3,7,10)) control<-data.frame(id=c(4,5,8,9)) I want to create a new data frame that is the union of those 3 and have an indicator column that t

Facebook Connection for Swift with facebook iOS SDK 4.9.1

I got trouble with facebook iOS SDK 4.9.1 on integrating facebook login using swift. and main trouble is unable to find any guideline regarding it for swift. http:/

Video in the browser: integrating YouTube and others

I want to embed videos from different video sites like YouTube, Vimeo and so on... But I have a problem: The Skins of the players are all different and I want a consistent video skin. Is there any possiblity to get this work? I can't host the videos

jquery prevent fault does not work

I want to change image when user click on a thumb image, and prevent it to jump to the top of page. the first code I wrote: $('#photos-list img').click(function(e) { e.preventDefault(); var imgObj = new Image(); var targetObj = $('#main_image img');

Convert from byte array to hex string c #

This question already has an answer here: byte[] to hex string [duplicate] 19 answers Suppose I have byte array. byte[] a = new byte[] {0x33,0x43,0xFE}; I want to convert it to string. string str = convert(a); My str should look like this: "33 43 FE&

Loading the local html file in webView android

I have to load an existing html file into a WebView that is located at this path in the file system: /data/data/com.example.example/files/file.html But, when the WebView loads it, I don't see anything. Who can help me? WebView code (assuming path is

Laravel 5.1 foreign key migration error

I get this weird error when executing my constraints migration When I execute this migration I get [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1005 Can't create table 'flowtime_dev.#sql-85bb_52' (errno: 121) (SQL: alter table

How to find all the prologue rules in the database

Suppose I have a facts db filled with at least: fact1(A) :- !, A=ok. fact2(B) :- !, B=ok. How can I enumerate through all the facts in this db? Ideally I'd have a predicate that I could use: ?- all_rules( Head :- Tail). Head=fact1(_G100), Tail=(!, _G

Rails 3: User has_many association id?

I have 3 models in my Rails 3 app: User model: has_many :videos, :dependent => :destroy controller: before_filter :signed_in_user def show @user = User.find(params[:id]) end def signed_in_user unless signed_in? store_location redirect_to signin_path,