remove

how to remove parent element if it exists?

So, sometimes, my output will look like this: <p><img src="someimage.jpg" /></p> <p>A new paragraph</p> Other times, it will look like this: <img src="someimage.jpg /> <p>A new paragraph</p> I'm trying to write some sort of "if" statement where, if the first p element in the markup surrounds an image tag, it will pull: $j("p:eq(1)...

jQuery remove options from select

I have a page with 5 select's that all have a class name 'ct'. I need to remove the option with a value of 'X' from each select while running an onclick event. My code is: $(".ct").each(function() { $(this).find('X').remove(); }); Where am I going wrong? Thanks, Chris ...

How to avoid DOM parsing adding html doctype, had and body tags?

<? $string = ' Some photos<br> <span class="naslov_slike">photo_by_ile_IMG_1676-01</span><br /> <span class="naslov_slike">photo_by_ile_IMG_1699-01</span><br /> <span class="naslov_slike">photo_by_ile_IMG_1697-01</span><br /> <span class="naslov_slike">photo_by_ile_IMG_1695-01</span><br /> '; $dom = new ...

Removing XElements in a foreach loop

So, I have a bug to remove foreach (XElement x in items.Elements("x")) { XElement result = webservice.method(x); if (/*condition based on values in result*/) { x.Remove(); } } The problem is that calling x.Remove() alters the foreach such that if there are two Elements("x"), and the first is removed, the loop d...

jQuery - Attach a delete button to autoappend script?

REVISED CODE AT THE END I'm very new to jquery, and even though I love it, there's a lot I still need to learn... The code below will append a new row if the user clicks in the one of the existing cells in a row. That part works fine. I'm trying to figure out how to also have a [-] button at the end of each row that a user can click o...

XSL Transform - Remove Parent Node

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com"> <soapenv:Body> <upsertResponse> <result> <created>true</created> <id>0011</id> <success>true</success> </result> <result> <created>false</created> <id>0012</id> <success>true</success> ...

Is there a better way to implement a Remove method for a Queue?

First of all, just grant that I do in fact want the functionality of a Queue<T> -- FIFO, generally only need Enqueue/Dequeue, etc. -- and so I'd prefer an answer other than "What you really want is a List<T>" (I know about RemoveAt). For example, say I have a Queue<DataPoint> dataToProcess of data points that need to be processed in the...

How to remove duplicate paragraphs in multiple files?

I have two sets of files with newspaper articles in them; about 20 files with about 2000 articles, and 1 file with about 100 articles. The 100 articles in the single file should be disjoint from the others, but are in fact duplicated randomly throughout the 20 files (once each). Any ideas for an easy way to find and remove the 100 dupl...

Jquery remove form tag, not content

Hello i need to remove a form tag but non the content: <form id="form"> <div> not remove this only the form tag</div> </form> ...

remove last append element jquery

I have this code; $(this).children("a:eq(0)").append( '' ); Now I want to remove last appened element (an image). Please give sugguestions; ...

MySQL remove duplicates from big database quick

Hello, I've got big (>Mil rows) MySQL database messed up by duplicates. I think it could be from 1/4 to 1/2 of the whole db filled with them. I need to get rid of them quick (i mean query execution time). Here's how it looks: id (index) | text1 | text2 | text3 text1 & text2 combination should be unique, if there are any duplicates, only ...

How do I remove a directory that is not empty?

I am trying to remove a directory with rmdir, but I received the 'Directory not empty' message, because it still has files in it. What function can I use to remove a directory with all the files in it as well? ...

PHP Bold some words in a string and remove some unbold words

Hi, I am creating an Image Search Engine. Currently, my script does bold the matching words on the keyword. But, some keywords are too long just like the followings. When I search for shah rukh khan, there is an image with the following keyword. 25216d1235653089 shahrukh khan s wallpaper shah rukh actor As you see, the above k...

F#: Remove the first N characters from a string?

I'm trying to write some code to remove the first N characters in a string. I could have done this in an imperative manner already, but I would like to see it done in the spirit of functional programming. Being new to F# and functional programming, I'm having some trouble... ...

Xcode + remove all breakpoints

Hello, Is there any way to remove all the breakpoints in Xcode? Regards, Pratik ...

Removing Spring.Cache

Hi, I am trying to clear the cache for my integration testing. I could find "InvalidateCache" attribute in Spring documentation, but i do not want to touch the real function and change the attribute. I think I can't use .Net's HttpContext.Cache.Remove since my integration test application is not web application. Anyone knows how to do...

How to open new window without titlebar in javascript

How to open new window without titlebar. ...

Removing items from a collection in java while iterating over it

I want to be able to remove multiple elements from a set while I am iterating over it. Initially I hoped that iterators were smart enough for the naive solution below to work. Set<SomeClass> set = new HashSet<SomeClass>(); fillSet(set); Iterator<SomeClass> it = set.iterator(); while (it.hasNext()) { set.removeAll(setOfElementsToRemo...

How to Remove a Field from a wxStatusBar

This may be obvious, but I'm missing it. I'm working in wxpython. I have a wxStatusBar with several fields (these fields have text as well as other widgets). I need to be able to add and remove these fields throughout the app session. Is there a way to remove fields from a statusbar, or do I just have to redraw it? I think to do the...

XmlDocument class is removing formatting, c#, .NET

Hi, i was wondering if anyone knows how to stop xmldocument.Save() from reformatting the document. Its not that the document is not formatted correctly with respect to XML, the particular document i am working with has lots of white space and things like that which - upon save - is all being removed. ...