Search Results

Search found 9872 results on 395 pages for 'preg replace callback'.

Page 62/395 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • Ant replace properties

    - by Andrew
    Hi. I've replaced properties file for Spring ApplicationContext using Ant, properties replaced correctly, and immidiately after Ant taskCalled, only after that first ApplicationContext call will be, but application context gets old property values

    Read the article

  • Replace use of explode() with str_split()

    - by user289346
    $transData = fgets($fp); while (!feof ($fp)) { $transArry = explode(" ", $transData); $first = $transArry[0]; $last = $transArry[1]; $Sub = $transArry[2]; $Grade= $transArry[3]; echo "<table width='400' ><colgroup span='1' width='35%' /><colgroup span='2' width='20%' /> <tr><td> ".$first." ".$last." </td><td> ".$Sub." </td><td> ".$Grade." </td></tr></table>"; $transData = fgets($fp); } My teacher wants me to change this use of explode() to str_split() while keeping the same output. How do I do this?

    Read the article

  • How do I replace jQueryUI button text?

    - by Andrei Railean
    I've got a button that I use with jQueryUI somethink like this (simplified). <button id="mybutton">Play<button> <script> $("#mybutton").button().toggle( function(){ $(this).text('Stop'); }, function(){ $(this).text('Start'); }, ); </script> This code breaks the way the button looks because when making it into the button widget, there's a new span added inside the button. So I'm changing the button value like this now $(this).find('span').text('Stop'); This is hacky because I can't treat the button as a black box anymore and have to go inside. Is there a clean way to do this?

    Read the article

  • CSS to Replace Table Layout for Forms

    - by Erick
    I've looked at other questions and am unable to find the solution to this. Consider this image: I want to wrap divs and stack them vertically. The GREEN div would be a wrapper on a line. The BLUE div would contain an html label and maybe icon for a tooltip. The ORANGE div would contain some sort of entry (input, select, textarea). Several of these would be stacked vertically to make up a form. I am doing this now, but I have to specify a height for the container div and that really needs to change depending on the content - considering any entry could land there. Images and other stuff could land here, as well. I have a width set on the BLUE div and the ORANGE is float:left. How can I get rid of the height on divs and let that be determined by content? Is there a better way? Changing all to something else would be difficult and would prefer a way to style all elements or something. The code I'm using is like: <div class=EntLine> <div class=EntLbl> <label for="Name">Name</label> </div> <div class=EntFld> <input type=text id="Name" /> </div> </div> The CSS looks like: .EntLine { height: 20px; position: relative; margin-top: 2px; text-align: left; white-space: nowrap; } .EntLbl { float: left; width: 120px; padding: 3px 0px 0px 3px; min-width: 120px; max-width: 120px; vertical-align: text-top; } .EntFld { float: left; height: 20px; padding: 0px; width: 200px; } Thanks!

    Read the article

  • Replace string in one file with contents of a second file

    - by jag7720
    I have two files: fileA: date >> /root/kvno.out kvno serverXXX\$ >> /root/kvno.out fileB: foobar I need to create a new file, fileC, with the same contents as fileA, except with the string XXX being replaced with the contents of fileB: date >> /root/kvno.out kvno serverfoobar\$ >> /root/kvno.out I'd like to do this using sed. I tried some of the examples I found but I only get the contents of fileB in fileC.

    Read the article

  • replace selfjoin with analytic functions

    - by edwards
    Hi Any ideas how i go about replacing the following self join using analytics SELECT t1.col1 col1, t1.col2 col2, SUM((extract(hour FROM (t1.times_stamp - t2.times_stamp)) * 3600 + extract(minute FROM ( t1.times_stamp - t2.times_stamp)) * 60 + extract(second FROM ( t1.times_stamp - t2.times_stamp)) ) ) div, COUNT(*) tot_count FROM tab1 t1, tab1 t2 WHERE t2.col1 = t1.col1 AND t2.col2 = t1.col2 AND t2.col3 = t1.sequence_num AND t2.times_stamp < t1.times_stamp AND t2.col4 = 3 AND t1.col4 = 4 AND t2.col5 NOT IN(103,123) AND t1.col5 != 549 GROUP BY t1.col1, t1.col2

    Read the article

  • useing my own db info to replace parts of a url and open in a iframe

    - by Morpheus Lucid
    print ("http://maps.google.com/maps/api/staticmap?center=");echo $City;print (",");echo $City;print (","); echo $State;print ("&zoom=14&size=500x500&maptype=roadmap&markers=color:blue|label:S|"); echo $Latitude;print (",");echo $Longitude;print ("&sensor=false")"); when page is loaded it prints right but would like to take the results from this and put into a iframe so when page loads it shows the map of the entry

    Read the article

  • How do I replace XmlTreeLoader in Ext JS?

    - by stinkycheeseman
    Ext.ux.xmltreeloader is now deprecated and I'm trying to update it but I'm not sure exactly how to do so. Here's my code: rmg.sscp.search.xmlLoader = Ext.extend(Ext.ux.tree.XmlTreeLoader, { processAttributes : function(attr){ var text = attr.tagName; attr.text = text + ' ' + attr.textContent; attr.loaded = true; attr.expanded = true; } });

    Read the article

  • CGContextSetRBStrokeColor to replace, not add, for alpha?

    - by Peter Hajas
    I use CGContexts to allow the user to draw in my application, here's an example: CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); CGContextSetLineWidth(UIGraphicsGetCurrentContext(), size); CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(),r,g,b,a); I want the user to have an "eraser" tool that actually erases - it can't draw white (that would add white to the image, which may not have a white background) or alpha (or else the stroke won't do anything). Is there a way to do this? Perhaps replacing contents of a CGContext or UIImage?

    Read the article

  • PHP script to replace cgi script

    - by Bridgeyman
    Hey, I have a CGI script that uses an old database driver that is no longer supported. Instead of struggling with this old cgi script, I thought it would be easier to rewrite it in php. It works now as a php script, but I need it to be served from the same web address. When a user accesses http://somesite.com/myscript.cgi, I want it to run the php script. I tried just renaming the php script with .cgi, but that didn't work. This is on an Apache server hosted by Dreamhost. Any advice? Bridger Maxwell

    Read the article

  • tsql replace value on select

    - by Zelter Ady
    I have a column (SERVICE_ID) in my table where I can have only 3 values: 0, 1 and 2. I'd like on select, on displayed result table, to change those value with some english words. select client, SERVICE_ID from customers displays now: -------------------------- | John | 1 | Mike | 0 | Jordan | 1 | Oren | 2 -------------------------- I'd like to change the query to get: -------------------------- | John | QA | Mike | development | Jordan | QA | Oren | management -------------------------- There is any way to do this using only the select?

    Read the article

  • Regex for string replace in C#

    - by Jack
    I am trying to achieve below output using regex but not able to, can someone please correct the regex - input string : data-placeholder=""[Refer" to "Conditions To Entry Of The Confirmation Order" and "Conditions To Effective Date" sections]" output string : data-placeholder="[Refer to Conditions To Entry Of The Confirmation Order and Conditions To Effective Date sections]" regex tried \s*"\s*([^ "]+)"\s*(?=["])

    Read the article

  • Maven String Replace of Text Web Resources

    - by Jaco van Niekerk
    I have a Maven web application with text files in src/main/webapp/textfilesdir As I understand it, during the package phase this textfilesdir directory will be copied into the target/project-1.0-SNAPSHOT directory, which is then zipped up into a target/project-1.0-SNAPSHOT.war Problem Now, I need to do a string replacement on the contents of the text files in target/project-1.0-SNAPSHOT/textfilesdir. This must then be done after the textfilesdir is copied into target/project-1.0-SNAPSHOT, but prior to the target/project-1.0-SNAPSHOT.war file being created. I believe this is all done during the package phase. How can a plugin (potentially maven-antrun-plugin), plug into the package phase to do this. The text files don't contain properties, like ${property-name} to filter on. String replacement is likely the only option. Options Modify the text files after the copy into target/project-1.0-SNAPSHOT directory, yet prior to the WAR creation. After packaging, extract the text files from WAR, modify them, and add them back into the WAR. I'm thinking there is another option here I'm missing. Thoughts anyone?

    Read the article

  • replace tiny mce with ckeditor in joomla

    - by testadmin
    hi I have a joomla project. In this the text editor is tiny mace. But there is no option to upload a pdf file. So I want to implement Ck editor or fck editor instead of tiny mce. I have downloaded ck editor and install as usual way (admin side -extension-install- uninstall section) and disabled the tiny mce in Plugin Manager. But I can't show the editor; I think I am in wrong way. Does any one have any idea? Please help me.

    Read the article

  • replace only one variable in web.py templates

    - by Asterisk
    I am passing variable to template in web.py and have the same condition in some places. Like this: $if myvar=="string1": $passed argument1 ............ $if myvar =="striung2": $passed argument2 If say myvar is "string1" and I pass passed = "AAA" then I have AAA argument1 on my page, but the other if statements get replaced by empty string? How to avoid that? I.e. how to leave other statements intact?

    Read the article

  • search & replace on 3000 row, 25 column spreadsheet

    - by Deca
    I'm attempting to clean up data in this (old) spreadsheet and need to remove things like single and double quotes, HTML tags and so on. Trouble is, it's a 3000 row file with 25 columns and every spreadsheet app I've tried (NeoOffice, MS Excel, Apple Numbers) chokes on it. Hard. Any ideas on how else I can clean this thing up for import to MySQL? Clearly I could go through each record manually, row by row, but would like to avoid that if at all possible. Likewise, I could write a PHP script to handle it on import, but don't want to put the server into a death spiral either.

    Read the article

  • pyopengl: Could it replace c++ ?

    - by Tom
    Hi everyone. I'm starting a computer graphics course, and I have to choose a language. Choices are between C++ and Python. I have no problem with C++, python is a work in progress. So i was thinking to go down the python road, using pyopengl for graphics part. I have heard though, that performance is an issue. Is python / pyopengl mature enough to challenge C++ on performance? I realize its a long shot, but I'd like to hear your thoughts, experiences on uses of pyopengl. Thanks in advance.

    Read the article

  • Replace textfields with dropdown select fields

    - by 47
    I have three model classes that look as below: class Model(models.Model): model = models.CharField(max_length=20, blank=False) manufacturer = models.ForeignKey(Manufacturer) date_added = models.DateField(default=datetime.today) def __unicode__(self): name = ''+str(self.manufacturer)+" "+str(self.model) return name class Series(models.Model): series = models.CharField(max_length=20, blank=True, null=True) model = models.ForeignKey(Model) date_added = models.DateField(default=datetime.today) def __unicode__(self): name = str(self.model)+" "+str(self.series) return name class Manufacturer(models.Model): MANUFACTURER_POPULARITY_CHOICES = ( ('1', 'Primary'), ('2', 'Secondary'), ('3', 'Tertiary'), ) manufacturer = models.CharField(max_length=15, blank=False) date_added = models.DateField(default=datetime.today) manufacturer_popularity = models.CharField(max_length=1, choices=MANUFACTURER_POPULARITY_CHOICES) def __unicode__(self): return self.manufacturer I want to have the fields for model series and manufacturer represented as dropdowns instead of text fields. I have customized the model forms as below: class SeriesForm(ModelForm): series = forms.ModelChoiceField(queryset=Series.objects.all()) class Meta: model = Series exclude = ('model', 'date_added',) class ModelForm(ModelForm): model = forms.ModelChoiceField(queryset=Model.objects.all()) class Meta: model = Model exclude = ('manufacturer', 'date_added',) class ManufacturerForm(ModelForm): manufacturer = forms.ModelChoiceField(queryset=Manufacturer.objects.all()) class Meta: model = Manufacturer exclude = ('date_added',) However, the dropdowns are populated with the unicode in the respective class...how can I further customize this to get the end result I want? Also, how can I populate the forms with the correct data for editing? Currently only SeriesForm is populated. The starting point of all this is from another class whose declaration is as below: class CommonVehicle(models.Model): year = models.ForeignKey(Year) series = models.ForeignKey(Series) .... def __unicode__(self): name = ''+str(self.year)+" "+str(self.series) return name

    Read the article

  • Replace System.Net.Mail.MailMessage with manually created message and send it

    - by DEH
    I am trying to send emails that will bounce to a known mailbox. I plan to use VERP. Unfortunately the System.Net.Mail.MailMessage object does not allow me to precisely set the From: and Sender: headers within my email - it forces the values so that the resulting email contains the phrase 'on behalf of', and does not allow me fine control over the relevant mime headers. I therefore plan to manually write mime email messages directly to the pickup directory so that I can independently control the From and Sender headers. My dev box is a Vista box and therefore does not have an SMTP server. I would like to configure the dev box so that I have an SMTP server running on it. I can then turn off the SMTP server, write messages to the pickup dir, then turn on the SMPT server and see how the individual emails that I have written will behave (some delivered, some bounced to a bounce handler on a different email domain, as dictated by the Sender). Two questions: 1. Can anyone recommend an SMTP server that will monitor a pickup directory? 2. If I set headers as follows; From:[email protected]; Sender:[email protected] then the recipient will see the email as having come from [email protected] ( and won't see any reference to [email protected]), but if the mail bounces then the NDR will be sent to [email protected]). It's a real pain to have to do this, but I can't see any way of using System.Net.Mail.MailMessage without it messing up my headers.

    Read the article

  • Need Help Customizing a Grammar Checking Replace Rule in Java

    - by user567785
    Hello, I am currently adding the Khmer (Cambodian) language to LanguageTool, an opensource grammar checker for OpenOffice (http://www.languagetool.org). I don't know enough Java to customize one of the scripts and wanted to make a request here asking if anyone would be willing to customize it for me (I can put link to your website at http://www.sbbic.org/lang/en-us/volunteer/ if you help). Here is the script that needs customization KhmerWordCoherencyRule.java: /* LanguageTool, a natural language style checker * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ package de.danielnaber.languagetool.rules.km; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import de.danielnaber.languagetool.AnalyzedSentence; import de.danielnaber.languagetool.AnalyzedToken; import de.danielnaber.languagetool.AnalyzedTokenReadings; import de.danielnaber.languagetool.JLanguageTool; import de.danielnaber.languagetool.tools.StringTools; import de.danielnaber.languagetool.rules.Category; import de.danielnaber.languagetool.rules.RuleMatch; /** * A Khmer rule that matches words or phrases which should not be used and suggests * correct ones instead. Loads the relevant words from * <code>rules/km/coherency.txt</code>, where km is a code of the language. * * @author Andriy Rysin */ public abstract class KhmerWordCoherencyRule extends KhmerRule { private static final String FILE_ENCODING = "utf-8"; private Map<String, String> wrongWords; // e.g. "????? -> "?????" private static final String FILE_NAME = "/km/coherency.txt"; public abstract String getFileName(); public String getEncoding() { return FILE_ENCODING; } /** * Indicates if the rule is case-sensitive. Default value is <code>true</code>. * @return true if the rule is case-sensitive, false otherwise. */ //in Khmer there is no case public boolean isCaseSensitive() { return false; } /** * @return the locale used for case conversion when {@link #isCaseSensitive()} is set to <code>false</code>. */ public Locale getLocale() { return Locale.getDefault(); } public KhmerWordCoherencyRule(final ResourceBundle messages) throws IOException { if (messages != null) { super.setCategory(new Category(messages.getString("category_misc"))); } wrongWords = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream(getFileName())); } public String getId() { return "KM_WORD_COHERENCY"; } public String getDescription() { return "Checks for wrong words/phrases"; } public String getSuggestion() { return " does not match your previous spelling of the word, use "; } public String getShort() { return "Use a consistant spelling throughout"; } public final RuleMatch[] match(final AnalyzedSentence text) { final List<RuleMatch> ruleMatches = new ArrayList<RuleMatch>(); final AnalyzedTokenReadings[] tokens = text.getTokensWithoutWhitespace(); for (int i = 1; i < tokens.length; i++) { final String token = tokens[i].getToken(); final String origToken = token; final String replacement = isCaseSensitive()?wrongWords.get(token):wrongWords.get(token.toLowerCase(getLocale())); if (replacement != null) { final String msg = token + getSuggestion() + replacement; final int pos = tokens[i].getStartPos(); final RuleMatch potentialRuleMatch = new RuleMatch(this, pos, pos + origToken.length(), msg, getShort()); if (!isCaseSensitive() && StringTools.startsWithUppercase(token)) { potentialRuleMatch.setSuggestedReplacement(StringTools.uppercaseFirstChar(replacement)); } else { potentialRuleMatch.setSuggestedReplacement(replacement); } ruleMatches.add(potentialRuleMatch); } } return toRuleMatchArray(ruleMatches); } private Map<String, String> loadWords(final InputStream file) throws IOException { final Map<String, String> map = new HashMap<String, String>(); InputStreamReader isr = null; BufferedReader br = null; try { isr = new InputStreamReader(file, getEncoding()); br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { line = line.trim(); if (line.length() < 1) { continue; } if (line.charAt(0) == '#') { // ignore comments continue; } final String[] parts = line.split(";"); if (parts.length != 2) { throw new IOException("Format error in file " + JLanguageTool.getDataBroker().getFromRulesDirAsUrl(getFileName()) + ", line: " + line); } map.put(parts[0], parts[1]); } } finally { if (br != null) { br.close(); } if (isr != null) { isr.close(); } } return map; } public void reset() { } } Here is what I need the SimpleReplaceRule.java to do: 1 - Be able to have more than two spelling variations in the coherency.txt file (right now it can only be Word1;Word2). 2 - Find the first use of ANY of the spelling variations in a document that are found in coherency.txt and then make sure only that spelling is used throughout the document (ex. in the coherency.txt I have Word1;Word2;Word3 then in my document on the first line I write Word2. then on next line I write Word1 and Word 3 - then the grammar checker will flag Word1 and Word3 saying that I should use the spelling "Word2" instead...etc.). If anyone can help I would be grateful! Thanks for your time, Nathan

    Read the article

  • Apache rewrite URL replace characters

    - by Tim Cooper
    It's been a while since I've done anything with mod_write, so I was hoping I could help some help on this. I would like a URL like this: http://example.com/qwerty/xyz/ to be directed to querty.xyz.php, where the number of slashes and alpha characters between the slashes is not explicitly set.

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >