I have a url, http://www.jdocy.com/42343-32422
I want to replace the 42343 section of the url with php's preg_replace function.
How would I go about doing this?
I installed a WAMP package on a Windows 7 machine and everything ( Apache, php, mySql, phpMyAdmin) appear to have installed correctly.
However when I try to access localhost or phpMyAdmin via the browser, I get "Server Not Found". I've tried using localhost, 127.0.0.1 in the browser.
I've checked the httpd file it says "Listen 80". C:\Windows\System32\drivers\etc\hosts says "127.0.0.1 localhost"
Apache log file doen't show any errors.
Suggestions appreciated.
The best way to get more website traffic from the search engines is to make it as easy as possible for them to understand what your site is about. This is not difficult, and it is something every online business owner should do. Here is a simple guide to get you started:
is it possible to in-place replace the entire html document?
i tried jQuery("html").html("....")
but style information does not survive.
i'm trying to avoid using data uri because i do not want the generated document to be stored in the browsers history
from XML
< NET ID="10.10.10.10, 255.255.255.0" /
I need to replace the text 10.10.10.10, 255.255.255.0
with 192.9.1.1, 255.0.0.0 by VB + DOM script
so the final line in the XML should be
< NET ID="192.9.1.1, 255.0.0.0" /
THX
Hello, I have a table with OWN_ID and OWN_Email -
3ace7cf80edd | [email protected]
3acf6af33ff7 | [email protected]
3acda2524e00 | [email protected]
3ad75583c9a7 | [email protected]
3ad74b018999 | [email protected]
etc.
the problem is that it should contain only a single ID per Email, also I need to replace all OWN_ID values in another table by highest OWN_ID value of the OWN_Email
There is no chance of your getting burdened with all the tasks. And though it is difficult for one to admit that he doesn't know and can't do anything and everything, doing so will open up various and unexpected opportunities far beyond what one can imagine.
Is it possible to findandreplace in selected text in Snow Leopard Xcode 3.2? There always use to be an option for selected text. Really frustrating. Thanks.
<b>Linux Admin Zone:</b> "Sometimes in large deployments, there are cases when MySQL server, setup by you long time back which has been in use by multiple teams in your organization, needs some change or update or intrupption in its service and you are in need to know how many clients are there which connects to this server."
Need to replace a domain name on all the links on the page that are not images or pdf files.
This would be a full html page received through a proxy service.
If somebody has informed you that having a person';s webpage together and performing on the online world is hard and costly, it';s a moment to guess all over again. With occasions just as this, when ow... [Author: Steve Ellstrom - Computers and Internet - April 12, 2010]
I have a string;
text="Label"
and I need to replace it to:
text="{resourceManager.getString('trad', 'Label')}"
What would be the easiest expression to do this?
My Ubuntu Server 12.04 LTS asking me during "apt-get dist-upgrade" where to install "GRUB" update. So how i can simply found out which partition/disc is the proper answer? I mean how to found out where GRUB is currently installed? I found similar question and answer but how to do it without installing additional script? I will be grateful for your advice.
Similar question: How to know the partition where grub is installed
Cheers :)
I have this loop that runs in O(end - start) and I would like to replace it with something O(1).
If "width" wouldn't be decreasing, it would be pretty simple.
for (int i = start; i <= end; i++, width--)
if (i % 3 > 0) // 1 or 2, but not 0
z += width;
start, end and width have positive values
I am a Bizspark owner and I am all set to launch my website but I am really confused about where to start the process for finding a hosting partner with my Bizspark membership. Since I have downloaded MicroSoft SQL Server from Bizspark website, I know I don't need a license for SQL Server.
So do I need to email some hosting companies and ask them if I can get their VPS and I can install my own copy of SQL Server?
That means, I will end up paying only for the VPS?
If you think you already have the best website in the world and it's supposed to work, you might be wrong. No award -winning website, no matter how ace at logic or design, will ever be good enough if it's not getting traffic. So how do you bring people to your website?
EDIT
i have something like this in a file:
imagecolor=0
arrayimagecolorcopy=0
arrayimagecolorcopy3d=0
when i use sed -i -e 's/imagecolor=0/imagecolor=1/' it will change 1 and 2 line. But i only want it to replace first line.
i also tried sed with \< \ and \b \b, but no luck. Could it be the '=' sign? Do we have something like -w as in grep command?
Thank you.
I want to disable all links within a div andreplace it with the content that was there.
i.e.
<div><a href="/blah.html">My super link</a></div>
to
<div>My super link</div>
Thanks
UPDATE (see end of question)
The text "search andreplace" utility programs I've seen, seem to only search on a line-by-line basis...
Is there a command-line tool which can locate one block of lines (in a text file), andreplace it with another block of lines.?
For example: Does the test file file contain this exact group of lines:
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.
'Beware the Jabberwock, my son!
The jaws that bite, the claws that catch!
Beware the Jubjub bird, and shun
The frumious Bandersnatch!'
I want this, so that I can replace multiple lines of text in a file and know I'm not overwriting the wrong lines.
I would never replace "The Jabberwocky" (Lewis Carroll), but it makes a novel example :)
UPDATE:
..(sub-update) My following comment about reasons when not use sed are only in the context of; don't push any tool too far beyond its design intent (I use sed quite often, and consider it to be invaluable.)
I just now found an interesting web page about sed and when not to use it.
So, because of all the sed answers, I"ll post the link.. it is part of the sed FAQ on sourceforge
Also, I'm pretty sure there is some way diff can do the job of locating the block of text (once it's located, the replacement is quite straight foward; using head and tail) ... 'diff' dumps all the necessary data, but I haven't yet worked out how to filter it , ... (I'm still working on it)
My server has been compromised recently. This morning, I have discovered that the intruder is injecting an iframe into each of my HTML pages. After testing, I have found out that the way he does that is by getting Apache (?) to replace every instance of
<body>
by
<iframe link to malware></iframe></body>
For example if I browse a file residing on the server consisting of:
</body>
</body>
Then my browser sees a file consisting of:
<iframe link to malware></iframe></body>
<iframe link to malware></iframe></body>
I have immediately stopped Apache to protect my visitors, but so far I have not been able to find what the intruder has changed on the server to perform the attack. I presume he has modified an Apache config file, but I have no idea which one. In particular, I have looked for recently modified files by time-stamp, but did not find anything noteworthy.
Thanks for any help.
Tuan.
PS: I am in the process of rebuilding a new server from scratch, but in the while, I would like to keep the old one running, since this is a business site.
I have build a litte asp.net form that searches for something and displays the results. I want to highlight the search string within the search results. Example:
Query: "p"
Results: a<b>p</b>ple, banana, <b>p</b>lum
The code that I have goes like this:
public static string HighlightSubstring(string text, string substring)
{
var index = text.IndexOf(substring, StringComparison.CurrentCultureIgnoreCase);
if(index == -1) return HttpUtility.HtmlEncode(text);
string p0, p1, p2;
text.SplitAt(index, index + substring.Length, out p0, out p1, out p2);
return HttpUtility.HtmlEncode(p0) + "<b>" + HttpUtility.HtmlEncode(p1) + "</b>" + HttpUtility.HtmlEncode(p2);
}
I mostly works but try it for example with HighlightSubstring("ß", "ss"). This crashes because in Germany "ß" and "ss" are considered to be equal by the IndexOf method, but they have different length!
Now that would be ok if there was a way to find out how long the match in "text" is. Remember that this length can be != substring.Length.
So how do I find out the length of the match that IndexOf produces in the presence of ligatures and exotic language characters (ligatures in this case)?
This is RHEL 5.6 and GNU find 4.2.27.
I am trying to exclude a directory from find, and want to make sure that directory isn't descended into. I've seen plenty of posts saying -prune will do this - and it does. I can run this command:
find . -type d -name "./.snapshot*" -prune -o -print
and it works. I run it through strace and verify it is NOT descending into .snapshot.
I also want to find directories ONLY at a certain level. I can use mindepth and maxdepth to do this:
find . -maxdepth 8 -mindepth 8 -type d
and it gives me all the dirs 8 levels down, including what's in .snapshot.
If I combine the prune and mindepth and maxdepth options:
find . -maxdepth 8 -mindepth 8 -type d \( -path "./.snapshot/*" -prune -o -print \)
the output is right - I see all the dirs 8 levels down except for what's in .snapshot, but if I run that find through strace, I see that .snapshot is still being descended into - to levels 1 through 8.
I've tried a variety of different combinations, moving the precedence parens around, reording expression components - everything that yields the right output still descends into .snapshot.
I see in the man page that -prune doesn't work with -depth, but doesn't say anything about mindepth and maxdepth.
Can anyone offer any advice?
Thanks...
Bill