Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 111/269 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • contenteditable realtime replace youtube url

    - by pimz
    so the problem is, i have a contenteditable div, with a keyup function binded. everytime somebody puts a youtube url in it, it has to be replaced by an embedded movie. i came up with a regex like this : content.match(/http:\/\/\w{0,3}.?youtube+\.\w{2,3}\/watch\?v=.*?(?=\s)/g); firefox wil do the replace after a whitespace, but in ie it won't work. any suggestions? thnx in advance!

    Read the article

  • Grouped Select in Rails

    - by Neil Middleton
    Simple question really - how do I use the select(ActionView::Helpers::FormOptionsHelper) with grouped options? I have got it working with a select_tag (ActionView::Helpers::FormTagHelper) but I would really like to have it using a select tag to match the rest of the form. Is this possible? My options look like this: [ ['Group 1', ["Item 1", "Item 2", "Item 3"]], ['Group 2',["Item 1", "Item 2", "Item 3", "Item 4"]] ] whilst my view is currently: %tr#expense %td = f.text_field :value = f.hidden_field :type, :value => mode

    Read the article

  • File Upload Validator always show error message

    - by Space Cracker
    i add asp.net file upload control as following <asp:FileUpload ID="filesFileUpload" runat="server" /> <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="file types not supported" ValidationExpression="\.(zip.rar|jpg|gif|png|eps|ai|psd|pdf)$" ControlToValidate="filesFileUpload"></asp:RegularExpressionValidator> and always when i upload file that match the reg expression it show the error .. could any help me why this done ?

    Read the article

  • Silverlight 4 Datagrid Sorting

    - by DavyMac23
    I'm having a heck of a time trying to get a silverlight datagrid to properly sort, and do so quickly (sub 1/10 second). Here's the scenario: -WCF callback every 1/5 of a second -Take the callback, match up to the existing record in an ObservableCollection -Update the ObservableCollection's properties -Bind the grid. I've tried a linq query, PagedCollectionView, and observablecollection.select(), all are waaaaaaay too slow, and introduce 12+ second delays in processing. Anyone else experience this?

    Read the article

  • Nokogiri find only inbound links

    - by astropanic
    I have an html document located on http://somedomain.com/somedir/example.html The document contains of four links: http://otherdomain.com/other.html http://somedomain.com/other.html /only.html test.html How I can get the full urls for the links in the current domain ? I mean I should get: http://somedomain.com/other.html http://somedomain.com/only.html http://somedomain.com/somedir/test.html The first link should be ignored because it does'nt match my domain

    Read the article

  • Renaming nodes and values with xslt

    - by T.K.
    Hello world, I'm new to xslt, and have a task that I'm not really sure where to go with. I want to rename nodes, but maintain the format all node declarations. In the actual context I'll be applying this to, I'll be doing a series of renames like this, but for the sake of brevity, the sample I've written up only involves renaming one node. I am using XSL 1.0. Input: <variables> <var> <RENAME> a </RENAME> </var> <var RENAME='b'/> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH='d'/> </variables> Desired Output: <variables> <var> <DONE> a </DONE> </var> <var DONE='b'/> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH='d'/> </variables> My xslt: <xsl:template match="RENAME"> <RENAMED> <xsl:apply-templates select="@*|node()"/> </RENAMED> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> Current Output <variables> <var> <RENAMED> a </RENAMED> </var> <var RENAME="b"> </var> <var> <DO_NOT_TOUCH> c </DO_NOT_TOUCH> </var> <var DO_NOT_TOUCH="d"> </var> </variables>

    Read the article

  • Combined sign in and registration page?

    - by Ryan
    This is somewhat against rails convention but I am trying to have one controller that manages both user session authentication and user registration. I am having troubles figuring out how to go about this. So far I am merging the User Controller and the Sessions Controller and having the 'new' method deliver both a new usersession and a new user instance. With the new routes in rails 3 though, I am having trouble figuring out how to generate forms for these items. Below is the code: user_controller.rb class UserController < ApplicationController def new @user_session = UserSession.new @user = User.new end def create_user @user = User.new(params[:user]) if @user.save flash[:notice] = "Account Successfully Registered" redirect_back_or_default signup_path else render :action => new end end def create_session @user_session = UserSession.new(params[:user_session]) if @user_session.save flash[:notice] = "Login successful!" redirect_back_or_default login_path else render :action => new end end end views/user/new.html.erb <div id="login_section"> <% form_for @user_session do |f| -%> <%= f.label :email_address, "Email Address" %> <%= f.text_field :email %> <%= f.label :password, "Password" %> <%= f.text_field :password %> <%= f.submit "Login", :disable_with => 'Logining...' %> <% end -%> </div> <div id="registration_section"> <% form_for @user do |f| -%> <%= f.label :email_address, "Email Address" %> <%= f.text_field :email %> <%= f.label :password, "Password" %> <%= f.text_field :password %> <%= f.label :password_confirmation, "Password Confirmation" %> <%= f.text_field :password_confirmation %> <%= f.submit "Register", :disable_with => 'Logining...' %> <% end -%> </div> I imagine I will need to use :url = something for those forms, but I am unsure how to specify. Within routes.rb I have yet to specify either Usersor UserSessions as resources (not convinced that this is the best way to do it... but I could be). I would like, however, the registration and login on the same page and have implemented this by doing the following: routes.rb match 'signup' => 'user#new' match 'login' => 'user#new' What's the best way to go about solving this?

    Read the article

  • Linq query challenge - can this be done?

    - by vdh_ant
    My table structure is as follows: Person 1-M PesonAddress Person 1-M PesonPhone Person 1-M PesonEmail Person 1-M Contract Contract M-M Program Contract M-1 Organization At the end of this query I need a populated object graph where each person has their: PesonAddress's PesonPhone's PesonEmail's PesonPhone's Contract's - and this has its respective Program's Now I had the following query and I thought that it was working great, but it has a couple of problems: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") where people.Contract.Any( contract => (param.OrganizationId == contract.OrganizationId) && contract.Program.Any( contractProgram => (param.ProgramId == contractProgram.ProgramId))) select people; The problem is that it filters the person to the criteria but not the Contracts or the Contract's Programs. It brings back all Contracts that each person has not just the ones that have an OrganizationId of x and the same goes for each of those Contract's Programs respectively. What I want is only the people that have at least one contract with an OrgId of x with and where that contract has a Program with the Id of y... and for the object graph that is returned to have only the contracts that match and programs within that contract that match. I kinda understand why its not working, but I don't know how to change it so it is working... This is my attempt thus far: from people in ctx.People.Include("PersonAddress") .Include("PersonLandline") .Include("PersonMobile") .Include("PersonEmail") .Include("Contract") .Include("Contract.Program") let currentContracts = from contract in people.Contract where (param.OrganizationId == contract.OrganizationId) select contract let currentContractPrograms = from contractProgram in currentContracts let temp = from x in contractProgram.Program where (param.ProgramId == contractProgram.ProgramId) select x where temp.Any() select temp where currentContracts.Any() && currentContractPrograms.Any() select new Person { PersonId = people.PersonId, FirstName = people.FirstName, ..., ...., MiddleName = people.MiddleName, Surname = people.Surname, ..., ...., Gender = people.Gender, DateOfBirth = people.DateOfBirth, ..., ...., Contract = currentContracts, ... }; //This doesn't work But this has several problems (where the Person type is an EF object): I am left to do the mapping by myself, which in this case there is quite a lot to map When ever I try to map a list to a property (i.e. Scholarship = currentScholarships) it says I can't because IEnumerable is trying to be cast to EntityCollection Include doesn't work Hence how do I get this to work. Keeping in mind that I am trying to do this as a compiled query so I think that means anonymous types are out.

    Read the article

  • Code Sign error after renewing my certificate

    - by thierryb
    Hello, my certificate has just expired. I renewed it on Team section, then renew provisioning profile, and reinstall them on my keychain and xcode, and then I get this error : Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the login keychain What should I do ? Thanks a lot Thierry

    Read the article

  • Distributions and hashes

    - by Don Mackenzie
    Has anyone ever had an incidence of downloading software from a genuine site, where an MD5 or SHA series hash for the download is also supplied and then discovered that the hash calculated from the downloaded artifact doesn't match the published hash? I understand the theory but am curious how prevalent the problem is. Many software publishers seem to discount the threat.

    Read the article

  • validate linqtosql mapping to a model

    - by Coppermill
    I have generated a LinqtoSQL mapping xml file, which I have a valid XSD schema that I check to make sure the XML is correct. Now I want to check that the field type match the Model/Interface for example: checking that the nullable fields are nullable that int are int etc anyone got any ideas if I can do this?

    Read the article

  • Sanitizing DB inputs with XSLT

    - by azathoth
    Hello I've been looking for a method to strip my XML content of apostrophes (') like: <name> Jim O'Connor</name> since my DBMS is complaining of receiving those. By looking at the example described here, that is supposed to replace ' with '', I constructed the following script: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes" /> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*" /> </xsl:copy> </xsl:template> <xsl:template name="sqlApostrophe"> <xsl:param name="string" /> <xsl:variable name="apostrophe">'</xsl:variable> <xsl:choose> <xsl:when test="contains($string,$apostrophe)"> <xsl:value-of select="concat(substring-before($string,$apostrophe), $apostrophe,$apostrophe)" disable-output-escaping="yes" /> <xsl:call-template name="sqlApostrophe"> <xsl:with-param name="string" select="substring-after($string,$apostrophe)" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string" disable-output-escaping="yes" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="node()|@*"> <xsl:apply-templates name="sqlApostrophe"/> </xsl:template> </xsl:stylesheet> However, the processor isn't accepting it. What am I missing here? Is there a better way to get rid of the apostrophes? Perhaps another approach for sanitizing DB inputs by using XSLT? Thanks for your help

    Read the article

  • Making skype like token field for adding users to a chat

    - by Miraaj
    Hi all, In Mac, in skype when we add users to an existing chat, by clicking '+' button on top, a beak like window appears carrying a token field like control. When an user types some name in it and a match is found then a list appears carrying user icon , status icon and his/her name. Also the width of dynamic list is same as beak window. Can any one suggest some way to create similar control? Thanks in advance, Miraaj

    Read the article

  • Google street view URL question:

    - by Rhythmic Algorithm
    Hi I have the address of a property and my application can launch a browser to go to http://maps.google.com?q=searchStringHere. If a good match is found it will take it directly there. Is there any thing I can append to the url to make it switch to streetview without having the exact coordinates? I dont't want to code any javascript or flash.

    Read the article

  • Is it necessary to look, website same in all browser?

    - by metal-gear-solid
    Is it necessary to look, website same in all browser? are some client mad? isn't it need of pixel perfection ( to inch to inch match with Design) a madness? isn't it asking IE6 Pixel perfection, as of now, is a madness? Is it sin to to use JavaScript for visual enhancement, like to enable border radius in IE using Javascript and from CSS in other browsers?

    Read the article

  • sql query not executing

    - by sarah
    Hi, Not able to execute a query ,i need to check if end date is greater than today in the following query Getting an error invalid query select * from table1 where user in ('a') and END_DATE >'2010-05-22' getting an error liter string does not match

    Read the article

  • Send activation email to user

    - by Martin
    How would I do to check if a email actially exists? Cant understand how sites do to send mails with a unique link that the users clicks to validate that he is the owner of email =/ Make a 2 new columns called activationkey and activated and store some random string, send an email with the activationkey, and update the users activated =1 that match that activation link register.php?a=activate&key=9cdfb439c7876e703e307864c9167a15 Any better ideas?

    Read the article

  • VB.NET Use With keyword on existing object?

    - by ropstah
    Is it somehow possible to use the 'With' keyword on an existing object? I would like to do the following using LINQ to objects and can't seem to find a way: From m as Product in Me _ Select m With {.Match = m.Name.IndexOf(query)} _ Where m.Name.IndexOf(query) > 0

    Read the article

  • Django - urls.py - Filenames with a hash/pound (#) sign?

    - by miya
    I'm using django and realized that when the filename that the user wants to access (let's say a photo) has the pound sign, the entry in the url.py does not match. Any ideas? url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': MEDIA_ROOT}, it just says: "/home/user/project/static/upload/images/hello" does not exist when actually the name of the file is: hello#world.jpg Thanks, Nico

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >