replacement

Unable to replace the word in a given folder's contents by Sed/Python/Perl

I have a project where I have folders, subfolders, and files. I need to replace the word Masi by the word Bond in each files. I run the following Sed script called replace unsuccessfully s/Masi/Bond/ in Zsh by sed -f PATH/replace PATH2/project/** It gives me all files, also the ones which do not have Masi, as an output. Sed is n...

underlining text in sifr

Hey all, I've recently been getting into using sifr as a healthy alternative to generating text as image using php. I've got a question about underlining text, for a website design I need to be able to specify the thickness of the underline and the distance from the text, is there any way to accomplish this with sifr? If not, is there a...

What are the different ways to replace a cursor?

I'd like to know your experience(s) with replacing SQL Server cursors in existing code, or how you took a problem that a procedural guy would use a cursor to solve, and did it set-based. What was the problem the cursor was used to solve? How did you replace the cursor? ...

Conditional replacement with regex

Hi all, I'm a relative newb when it comes to regexes, but i'm starting to get the hang of it. I started writing a method in java to "linkify" a string - that is, scan it for any references of urls (i.e, "http://...") or strings that look like web addresses ("www.example.com...") So, for example, if I had a string that looked like this...

Light richtextbox control for .net (winforms)

Is there any light version of richtextbox control? I've got to create like 300+ of them in an app which takes time, memory and slows everything down... All that I need is to have a control that will enable me changing the background/foreground of a part of the text... I'd need that in winforms... anybody know anything about some kind of ...

The Window Sitter project -- something better than a timer?

For my window sitter project (remember that one question about colorkeying?) I'm currently using a Timer to update the character's position, like I did with the original VB6 version. There are, however, a few problems with this approach: If you switch windows or move the foreground window fast enough, the character lags unless you set t...

Image Replacement (gallery style) with Fade-In's / Fade-Out's

Hey Everyone, I'm sure you've all seen this demo of image replacement using this : $("#largeImg").attr({ src: largePath, alt: largeAlt }); http://www.webdesignerwall.com/demo/jquery/img-replacement.html So, imagine that I want to change 4 images on the screen to simulate that I am changing the entire 'page' , but avoiding using AJAX...

TSQL Remove space in string

I have 2 strings in SQL and the REPLACE function only works on 1 of them, why is that? Example 1: SELECT REPLACE('18 286.74', ' ', '') Example 2: SELECT REPLACE('z z', ' ', '') Example 1's output is still "18 286.74" whereas Example 2's output is "zz". Why does SQL not react the same way to both strings? UPDATE: When running se...

HTML input="file" button to text

I want to replace input="file" button to only text like that http://valums.com/wp-content/uploads/ajax-upload/demo-jquery.htm but i don't want to use whole library. How can i do this ? ...

c function call

I'm trying to take this code ... char mysmooth1_ descr[] = "my smooth1: My smooth1 replaced avg() func. and assign sum to pixel"; void mysmooth1 (int dim, pixel *src, pixel *dst) { int i, j; int ii, jj; pixel_ sum sum; pixel current_ pixel; for (i = 0; i < dim; i++) for (j = 0; j < dim; j++) { initialize_pix...

PHP and Regex - storing a piece of the string for later use in replacement?

Not sure if the subject was clear, hard to describe, easy to show: I need to convert this: $text = 'Bunch of text %img_Green %img_Red and some more text here'; to this: $text = 'Bunch of text <img src="/assets/images/Green.gif" alt="Green" /> <img src="/assets/images/Red.gif" alt="Red" /> and some more text here'; Thanks in advan...

Windows 7 Batch: Find /i

Hello, I have a windows batch file in Windows 7 which does something with find. it starts with this: find /i /c.... But it says something like find /i is no medium or so. Then it just gives a list of every single file in the C:\ directory. Is there any new replacement for Windows 7? EDIT: If i hit find /? in cmd, it gives fi...

tag replacement

Hi everyone ! Does anyone know how to set a new tagName to a tag using Jquery? Let's say i have an HTML document and I want to replace all 'fieldset' width 'div'. Thanks in advance ! ...

Interakt replacement module for Dreamweaver OR PHP editor

Hi, I have worked for years with Dreamweaver and Interakt extensions to build hundreds of PHP websites. Interakt was great for me because I could develop PHP websites and small back offices in a couple of hours. Integrated modules like 'file upload', image resizing, automatic table creation,... were tools I used and that I still need tod...

Replace characters in C#

I have a requirement. I have a text which can contain any characters. a) I have to retain only Alphanumeric characters b) If the word "The" is found with a space prefixed or suffixed with the word, that needs to be removed. e.g. CASE 1: Input: The Company Pvt Ltd. Output: Company Pvt Ltd But Input: TheCompany Pvt Ltd....

Need some input on how to build a large scale text replacement system

My Rails app deals a lot with data from third-party APIs (specifically UPS, FedEx, DHL, etc). What I'd like to do is whenever that data comes in, replace certain phrases with customized phrases. Example: "On FedEx vehicle for delivery" (which we get from the FedEx API), I'd like to replace with "Out for Delivery." Is it best to replac...

Replace all Special Characters in a string IN C#

Hi, I would like to find all special characters in a string and replace with a Hyphen (-) I am using the below code string content = "foo,bar,(regular expression replace) 123"; string pattern = "[^a-zA-Z]"; //regex pattern string result = System.Text.RegularExpressions.Regex.Replace(content,pattern, "-"); OutPut foo-bar--...

Avoid printing unicode replacement character in Java

In Java, why does Character.toString((char) 65533) print out this symbol: � ? I have a Java program which prints these characters all over the place. Its a big program. Any ideas on what I can do to avoid this? ...

Cufon font replacement: How can I eliminate the flash of unstyled text that occurs when the page loads?

I'm using Cufon to replace the font of selected heading elements on a site I'm working on, but whenever I load a page, there is a noticeable flash of unstyled text before Cufon replaces the text. I expect that I may be doing it wrong. Here's what I have in the <head>: <script src="/js/Monotype_Corsiva_italic_400.font.js"></script> <scri...

vim automated replacement

Hello, I have an automatic replacement done by my vim setup, which systematically replaces all occurences of "sql" in command line by "SQL". So when I type: :e myfile.sql it is translated in :e myfile.SQL and when I search /sql it is tranlasted in /SQL There's probably some parameters in the .vimrc, or some file sourc...