Search Results

Search found 7529 results on 302 pages for 'replace'.

Page 37/302 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Download and replace Android resource files

    - by Casebash
    My application will have some customisation for each company that uses it. Up until now, I have been loading images and strings from resource files. The idea is that the default resources will be distributed with the application and company specific resources will be loaded from our server after they click on a link from an email to launch the initialisation intent. Does anyone know how to replace resource files? I would really like to keep using resource files to avoid rewriting a lot of code/XML. I would distribute the application from our own server, rather than through the app store, so that we could have one version per company, but unfortunately this will give quite nasty security warnings that would concern our customers.

    Read the article

  • Items are being replace by another in the Datagridview

    - by stephanie
    When I add the first item in the datagridview its ok but when i add the second one it replace the last item being added. here's my code Private Sub add() Dim i As Integer For i = 0 To DataGridView1.Rows.Count - 1 'DataGridView1.Rows.Add() DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("TransID").Value = txttrans.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("ProductCode").Value = txtprodcode.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("ProductName").Value = cmbprodname.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Quantity").Value = txtqty.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Price").Value = txtprc.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Amount").Value = txtat.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("CustomerName").Value = txtcust.Text DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("Date1").Value = txtdate.Text Next i End Sub And this is in my ADDbutton: Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click Try add() Catch ex As Exception MessageBox.Show(ex.Message) End Try Dim total As Integer For Each row As DataGridViewRow In DataGridView1.Rows total += row.Cells("Amount").Value Next txtamt.Text = total

    Read the article

  • RegEx replace query to pick out wiki syntax

    - by Jeremy Thake
    I've got a string of HTML that I need to grab the "[Title|http://www.test.com]" pattern out of e.g. "dafasdfasdf, adfasd. [Test|http://www.test.com/] adf ddasfasdf [SDAF|http://www.madee.com/] assg ad" I need to replace "[Title|http://www.test.com]" this with "Title". What is the best away to approach this? I was getting close with: string test = "dafasdfasdf adfasd [Test|http://www.test.com/] adf ddasfasdf [SDAF|http://www.madee.com/] assg ad "; string p18 = @"(\[.*?|.*?\])"; MatchCollection mc18 = Regex.Matches(test, p18, RegexOptions.Singleline | RegexOptions.IgnoreCase); foreach (Match m in mc18) { string value = m.Groups[1].Value; string fulltag = value.Substring(value.IndexOf("["), value.Length - value.IndexOf("[")); Console.WriteLine("text=" + fulltag); } There must be a cleaner way of getting the two values out e.g. the "Title" bit and the url itself. Any suggestions?

    Read the article

  • Replace the surround of an html element with another document

    - by KvanteTore
    I have an html page with (among other things) a Unity3D window. I would like to replace everything on the page without causing the Unity window to reload. I have tried the following jquery-tastic function replaceSurround(keepElem, newElem) { keepElem.siblings().remove(); keepElem.prepend(newElem.prevAll()); keepElem.append(newElem.nextAll()); var keepParent = keepElem.parent(); var newParent = newElem.parent(); if (keepParent && newParent) { replaceSurround(keepParent, newParent); } } where keepElem is an element in the original document and newElem is the corresponding element in the new document, but it did not work very well.

    Read the article

  • preg_replace - don't include string if $4 is blank

    - by bradenkeith
    I have this expression: $regex_phone = '/^(?:1(?:[. -])?)?(?:\((?=\d{3}\)))?([2-9]\d{2})' .'(?:(?<=\(\d{3})\))? ?(?:(?<=\d{3})[.-])?([2-9]\d{2})' .'[. -]?(\d{4})(?: (?i:ext)\.? ?(\d{1,5}))?$/'; if(!preg_match($regex_phone, $data['phone'])){ $error[] = "Please enter a valid phone number."; }else{ $data['phone'] = preg_replace($regex_phone, '($1) $2-$3 ext.$4', $data['phone']); } That will take a phone number such as: 803-888-8888 ext 2 as well as 803-888-8888 First number formats as: (803) 888-8888 ext.2 -- the desired effect Second number formats as: (803) 888-8888 ext. -- blank extension How can I set it so that if $4 is blank, that ext. won't show? Thanks so much for any help you can offer. I hope this was clear.

    Read the article

  • Excel Macro to find text in cell and insert hyperlink on cell

    - by tnriverfish
    We're managing some system bugs in a web system and setting priority for execs in a spreadsheet. Each of the tickets has a "FD-" and four numbers as the ID. The web system has a hyperlink that has that "FD-####" at the end of the link. The end result would look like this -- http://www.mytickets.com/FD-#### I'd like to run a macro that finds all the FD-#### and inserts a hyperlink on each. There may be multiple FD-#### in a single cell and there will certainly be other text in there. I'd go through each and add the link but there are over 150 or so. Thanks!

    Read the article

  • How would I create a VIM or Vi command to delete all text after a certain character for every line i

    - by Jason Down
    Scenario: I have a text file that has pipe (as in the "|" character) delimited data. Each field of data in the pipe delimited fields can be of variable length, so counting characters won't work (or using some sort of substring function... if that even exists in VIM). Is it possible, using VIM / Vi to delete all data from the second pipe to the end of the line for the entire file? There are approx 150,000 lines, so doing this manually would only be appealing to a masochist... e.g. Change the following lines from: 1111|random sized text 12345|more random data la la la|1111|abcde 2222|random sized text abcdefghijk|la la la la|2222|defgh 3333|random sized text|more random data|33333|ijklmnop to: 1111|random sized text 12345 2222|random sized text abcdefghijk 3333|random sized text I'm sure this can be done somehow... I hope. TIA UPDATE: I should have mentioned that I'm running this on Windows XP, so I don't have access to some of the mentioned *nix commands (CUT is not recognized on Windows).

    Read the article

  • In forms application, is there any Alternative to MsgBox?

    - by GuruC
    I like how MsgBox stops all further processing until it's clicked but I don't like how it pops that little msgbox in the middle of the screen, which I then have bring to the front if there is a window covering it. Is there a way to do something like a msgbox but keep it on my Form (which is always in view) so I can go ahead and click a button on the form instead of having to bring the little msgbox window on top of windows that may be covering it. I use the msgbox to inform me that a certain situation has happened, which I manually fix and when I'm done I click the MsgBox to continue processing. It'd be nice to have this button right on the form.

    Read the article

  • Will html5 and Javascript replace native applications?

    - by nimo
    I recently attended a conference on future of the web and web development and it was a lot of focus on HTML5 and how it will impact the way we look at the web and how we will use it. The majority of the speakers meant that it will replace native application on your desktop as well as in your mobile phone. I agree that you will be able to make a lot of great stuff with the new technology take bespin for example and the <video> and <canvas> tag will be amazing, but will it completely remove the need for native applications? Is there something you cannot do with Javascript and HTML5?

    Read the article

  • Highlight text, except html tags

    - by Arjen
    Hey, I'm using the code below to highlight some keywords in a text: $message = str_ireplace($words,'<span class="hightlighted_text">'.$words.'</span>',$message); The text may contain some html tags, for example , etc.. How can I highlight "normal" text, except the text between the html tags? Because when users search for "img" the text will be highlighted and the image doesn't work anymore.

    Read the article

  • SHFileOperation replace file dialog

    - by JHowzer
    Currently, SHFileOperation has some confirm file replacement dialog boxes that ask the user if they would like to replace a file or not. I find these useful, but I would like to be able to modify the scenario in which they occur. Instead, I would like to compare the file contents first with a bool compareFile() function I wrote. Then, if the files are identical the file replacement dialog box will not come up. Assuming, I already have a working compareFile() function, is there a way for me to do this? Thank you for your time.

    Read the article

  • Regex to replace a string in HTML but not within a link or heading

    - by Vladimir
    I am looking for a regex to replace a given string in a html page but only if the string is not a part of the tag itself or appearing as text inside a link or a heading. Examples: Looking for 'replace_me' <p>You can replace_me just fine</p> OK <a href='replace_me'>replace_me</a> no match <h3>replace_me</h3> no match <a href='/test/'><span>replace_me</span></a> no match <p style="background:url('replace_me')">replace_me<h1>replace_me</h1></p> first no match, second OK, third no match Thanks in advance!

    Read the article

  • Find similar or "like" text and replace it with other in excel

    - by andreas
    Does anyone know how i can find similar descriptions in excel and replace them with 1 other description is there a wild card? i am. trying to make a pivot chart with a list of transactions and their descriptions and i want to group all my ATM withdrwls but i cant. On the pivot chart they appear as ATM Withdrwal-REF-1234 and each of these "withdrwls" have different reference and as a result they show up as individual items on the chart...how can i group say all my ATM withdrwals as 1 ATM Withrdawl item so that it shows a 1 atm withdrwl item on my pivot chart?

    Read the article

  • Vim: replacing start and end of a visual char, line or block

    - by gattu marrudu
    I am trying to find a shortcut to place a custom comment sequence on my code, e.g.: /* start of comment blah end of comment /**/ (it is easier to void the comment by just adding a / to the beginning) I would like to do this in Vim by selecting a visual line, block or char and adding '/' characters at the beginning of the block and '/*/' at the end, plus newlines. After selecting some lines (Shift-V) I tried this: '<,'>s/\(.*\)/\/*\r\1\r\/**\// But it adds the comment chars at EACH newline. How can I only apply the substitution at the beginning and end of the selected range? Thanks gm

    Read the article

  • PHP : Pattern Replacement Query.

    - by Rachel
    Currently I have ‘customer_id’ . ‘+’ . ‘operator_domain’ pattern, e.g., '123456789'.'+'.'987654321' Desired Pattern: ‘customer_id.operator_domain’ pattern, e.g., '123456789987654321' How can I achieve this using in php ?

    Read the article

  • How to Replace only Part of the Variable using #define

    - by mahesh
    #define C_TX_ TX_ #define C_RX_ RX_ enum Test { C_TX_MAC 0x0100, // Pre-Processor should replace C_TX_ to TX_ C_RX_MAC 0x0101 // But Not Working. }; int main(int argc, char *argv[]) { cout << TX_MAC; // HOW TO PRINT ? cout << RX_MAC; // HOW TO PRINT ? return true; } Please Help. Thanks in Advance

    Read the article

  • Extract and replace named group regex

    - by user557670
    I was able to extract href value of anchors in an html string. Now, what I want to achieve is extract the href value and replace this value with a new GUID. I need to return both the replaced html string and list of extracted href value and it's corresponding GUID. Thanks in advance. My existing code is like: Dim sPattern As String = "<a[^>]*href\s*=\s*((\""(?<URL>[^\""]*)\"")|(\'(?<URL>[^\']*)\')|(?<URL>[^\s]* ))" Dim matches As MatchCollection = Regex.Matches(html, sPattern, RegexOptions.IgnoreCase Or RegexOptions.IgnorePatternWhitespace) If Not IsNothing(matches) AndAlso matches.Count > 0 Then Dim urls As List(Of String) = New List(Of String) For Each m As Match In matches urls.Add(m.Groups("URL").Value) Next End If Sample HTML string: <html><body><a title="http://www.google.com" href="http://www.google.com">http://www.google.com</a><br /><a href="http://www.yahoo.com">http://www.yahoo.com</a><br /><a title="http://www.apple.com" href="http://www.apple.com">Apple</a></body></html>

    Read the article

  • How to replace a codebehind method with an aspx method using ternary operator

    - by user466663
    I have an asp:hyperlink control as part of a gridview template. The code in the aspx page is given below: asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='<%# GetUrl(Eval("ID").ToString(), Eval("CategoryID").ToString()) %' ImageUrl="~/Images/Edit.gif" The NavigateUrl value is obtained from the codebehind method GetUrl(string, string). The code works fine and is as follows: protected string GetUrl(string id, string categoryID) { var CategoryID = string.Empty; if (!String.IsNullOrEmpty(Request.QueryString["CatID"])) { CategoryID = Request.QueryString["CatID"].ToString(); } else if (!String.IsNullOrEmpty(categoryID)) { CategoryID = categoryID; } return "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + id + "&CatID=" + CategoryID; } I want to replace the code behind method by using a ternary operator within the aspx page. I tried something like below, but didn't work: asp:HyperLink runat="server" ID="lnkEdit" ToolTip="Edit article" NavigateUrl='<%# "~/TBSArticles/WriteOrEditArticle.aspx?ID=" + Eval("ID") + "&CatID=" + Eval(this.Request.QueryString["CatID"].ToString()) != ""? this.Request.QueryString["CatID"] : Eval("CategoryID")) %' ImageUrl="~/Images/Edit.gif" Any help will be greatly appreciated. Thanks

    Read the article

  • How do I disable Hot Code Replace in Eclipse

    - by Xa6faiph
    HCR is failing alot more often than not for me at the moment. It keeps popping up the "Hot Code Replace Failed" dialog, over and over and over. I know there is a checkbox to shut it up, but later on when I'm doing something else I actually want the dialog to appear. Plus I don't want hot swapping code right now anyways, I just want the debugger. So is there a setting someplace for that "do not show dialog again" checkbox, for when I want to re-enable it? Better yet, is there a way to turn HCR on and off period? BTW, as far as I can tell disabling "Build Automatically" doesn't disable it.

    Read the article

  • Removing most inline styles and properties with PHP

    - by bakkelun
    This question is related to a similar case, namely http://stackoverflow.com/questions/2488950/removing-inline-styles-using-php The solution there does not remove i.e: <font face="Tahoma" size="4"> But let's say I have a mixed bag of inline styles and properties, like this: <ul style="padding: 5px; margin: 5px;"> <li style="padding: 2px;"><div style="border:2px solid green;">Some text</div></li> <li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li> <li style="padding: 2px;"><font face="arial,helvetica,sans-serif" size="2">Some text</font></li> </ul> What regExp is needed to achieve this result? <ul> <li><div>Some text</div></li> <li><font>Some text</font></li> <li><font>Some text</font></li> </ul> Thanks for reading the question, any help is appreciated.

    Read the article

  • How to escape $ in php using preg_replace ?

    - by sakura
    Hi, I am using preg_replace to escape special characters... $tmpStr=preg_replace("/\?/", "\?", $tmpStr); $tmpStr=preg_replace("/\#/", "\#", $tmpStr); $tmpStr=preg_replace("/\^/", "\^", $tmpStr); $tmpStr=preg_replace("/\&/", "\&", $tmpStr); $tmpStr=preg_replace("/\*/", "\*", $tmpStr); $tmpStr=preg_replace("/\(/", "\(", $tmpStr); $tmpStr=preg_replace("/\)/", "\)", $tmpStr); $tmpStr=preg_replace("/\//", "\/", $tmpStr); but i am not able to escape $ using the same function $tmpStr=preg_replace("/\$/", "\$", $tmpStr); and also when i use the above statement all the spaces get replaced by $ and $ is not getting escaped....someone please help me with this....

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >