w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
jquery relative a href="#" remove display block
You have to cancel the link's default behaviour: $("a").click(function (event) { event.preventDefault(); var addressValue = $(this).attr("href"); $(addressValue).css("display","block"); });

Categories : Javascript

How would I remove a DIV if there are no IDs using Greasemonkey?
We might need to see the whole page to work out robust selectors for those <div>s. But, if they always contain iframes with src attributes to undesirable content, then you can use those iframes to hunt down the dastardly divs. Make a list of key text snippets in the bad iframe src attributes. I'm also using jQuery and waitForKeyElements(), in case this content is added by AJAX. So, the script looks something like this: // ==UserScript== // @name _Remove bad divs containing bad iframes // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to work around a de

Categories : Javascript

duplicate href in linkbutton
Use HyperLink instead of LinkButton. From MSDN: Use the LinkButton control to create a hyperlink-style button on the Web page. The LinkButton control has the same appearance as a HyperLink control, but has the same functionality as a Button control. If you want to link to another Web page when the control is clicked, consider using the HyperLink control. link button is used to post back to the page, not to redirect to other one.

Categories : C#

a href don't do anything in li menu slider (sliding block when li is hover)
You have to change the return on the click event to true, on this method: $(function() { $(".menu-lava").lavaLamp({ fx: "backout", speed: 700, click: function(event, menuItem) { return false; // <--- Here } }); }); It's on the HTML page. I hope this helps.

Categories : Jquery

trying to remove *.php from anchor href's with sed
You lack the -r switch in your command, or you need to backslash the parentheses. sed -i.bak -r 's/href="([^"]+).php"/href="1"/g' *.php *.xml And the captured group is not $1 (like in perl) but 1

Categories : HTML

php remove dot dot slash from all href and src
I read the template in using get_file_contents then replace the string: $sContents = file_get_contents('<URL TO FILE>'); $sContents = str_replace('../', '', $sContents);

Categories : PHP

How to Remove the href link in dom parser
You can use the strip_tags function on your string. http://php.net/manual/en/function.strip-tags.php $html = file_get_html('http://www.cricschedule.com/format/odi.php'); $es = $html->find('table td'); echo strip_tags($es[4]);

Categories : PHP

Remove href link from images with overlay
To deactivate the links in this case, you need to add some javascript code. JS: Add this before </body> in the theme file: footer.php <script> var thumbnails = document.getElementsByClassName('thumbnail'); for(i = 0; i < thumbnails.length; i++){ thumbnails[i].getElementsByTagName("a")[0].setAttribute("onclick", "return false;"); } </script> CSS: Style to remove pointer from link. .thumbnail a { cursor: default !important; }

Categories : Wordpress

PHP: How can you remove/replace a specific href attribute value
You could try something like the following in PHP: $newtext = preg_replace('/^("http://cdn.example.com/){1}(.*)("){1}$/', '"#" class="disabled-link"', $oldtext); $oldtext being your input article as a string. $newtext being the text to echo on the page. Broken down: Find text starting with "http://cdn.example.com/ Then match anything Stop at " Replace with "#" class="disabled-link" This should let you remove the link and also I added the class part so that you can add some CSS to style the links as text. Example: .disabled-link{ color:#000; pointer-events: none; cursor: default; text-decoration: none; } All this combined will provide users with a link that is completely invisible without looking into the DOM or the source.

Categories : PHP

remove attribute HREF after access the LINK
$('a[href]').click(function (e) { var hash = $(this).attr('href'); $(this).removeAttr('href'); location.hash = hash; }); This assumes these links will always be hashes.

Categories : Jquery

Block definition available throughout project without duplicate symbol error
Perhaps you defined the block in a .h file, so that it is defined in every .m file that imports this .h file? You have to declare it in a .h file: typedef NSComparisonResult(^UITagCompareBlock)(UIView*, UIView*); extern UITagCompareBlock uiTagCompareBlock; and define it in exactly one .m file: UITagCompareBlock uiTagCompareBlock = ^NSComparisonResult(UIView* a, UIView* b){ if (a.tag < b.tag) return NSOrderedAscending; else if (a.tag > b.tag) return NSOrderedDescending; else return NSOrderedSame; };

Categories : IOS

Can't Remove Duplicate Rows
You can use the listagg() function to get rid of your multiple rows problem; however, it will not put each description in separate columns as you have described in your question. Instead it will put all the descriptions in a single column as string separated by the character(s) you specify. The example below will separate the descriptions by a comma and space: SELECT person.id, badge.bid, person.first_name, person.last_name, person.type, listagg(person_user.description, ', ') within group (order by person_user.description) FROM person, badge, person_user WHERE person.id = badge.id AND person.id = person_user.person_id AND badge.bid NOT LIKE "111%" AND badge.access_date >= 20130401 GROUP BY person.id,

Categories : SQL

remove first line if there is a duplicate
Add a sequential field to the beginning of each line using paste (1,2,3...), then reverse the list based on the field, and then run uniq ignoring that field. Then sort by that field to insure they have remained in the right order. Then remove the field using cut or colrm.

Categories : Unix

Add and Remove duplicate Classes
There is a syntax error $(this).find('h3').removeClass('grey'); //missing . Demo: Fiddle Ex: $('.cta ').hover(function(){ $(this).removeClass('light-grey-bg', 800).addClass('light-grey-bg-fade', 400).find('h3').removeClass('grey'); }, function(){ $(this).addClass('light-grey-bg', 400).removeClass('light-grey-bg-fade', 800).find('h3').addClass('grey'); });

Categories : Jquery

Remove duplicate elements from the BST
The brute-force method that you have mentioned has the worst case complexity of O(n^2). A way of achieving a better complexity is by using hash-table. You could do a traversal on the BST and store the counts of each of the nodes in the hash-table. Then, do another pass (in the any fashion that suits you) and delete the nodes the count of which are greater than 1. This method has an improved complexity of O(n*logn), assuming the tree is balanced.

Categories : C++

CSS remove duplicate code in both classes?
like this .my_button .left,.my_button .right { float: left; width: 10px; height: 19px; background: url("./images/bl.png") left center no-repeat; } .my_button .right { background: url("./images/br.png") left center no-repeat; } and for hover .my_button:hover .left,.my_button:hover .right { float: left; width: 10px; height: 19px; background: url("./images/bl-active.png") left center no-repeat; } .my_button:hover .right { background: url("./images/br-active.png") left center no-repeat; }

Categories : CSS

Remove duplicate in linq list?
var results = source.GroupBy(x => new { x.Name, x.Age }) .Select(g => g.First()) .ToList(); Or you can use DistinctBy from moreLINQ library.

Categories : C#

How do I remove the duplicate for rounded corder
Just add the class to the link: <li class="info roundcorder"><a href="#">Information</a></li> But, I would write just border-radius, without vendor prefixes; http://caniuse.com/border-radius

Categories : HTML

XSLT to remove duplicate while concating
If the XML getting bigger a key based solution (with xslt-1.0) would be better. But to keel the solution mostly as it is, only have unique Tank value. You can add two templates: <xsl:template match="item" mode="tank" /> <xsl:template match="item[not(Material = preceding::item/Material and Tank = preceding::item/Tank)]" mode="tank" > <xsl:value-of select="Tank"/> <xsl:text>||</xsl:text> </xsl:template> This ignores any item which has same Material and same Tank value. And apply this templates in replacement for the for-each loop in <Value>: <xsl:apply-templates select="$materials[Material=current()/Material ]" mode="tank" /> Therefore try this: <?xml version="1.0" encoding="utf-8" standalone="no"?> <xsl:stylesheet

Categories : Xslt

Jquery remove duplicate code
function saveToDB() { var value= pageValidation(); var type = "update"; if ($('#jobid').val()==" ") { //set the flag type = "insert" } if(value!=false) { var data = { "type": type, //See this, insert/update, check this on server side "names": $('#names').val(), "os": $('#OS').val(), "browser": $('#browsers').val(), "version": $('#version').val(), "scripttype": $('#testscripts').val(), "server": $('#server').val() }; if (type == "update") { data.jobid = $('#jobid').val(); } $.ajax({ type: 'post', url: "/insertJobs", dataType: "json", data: data, success: functi

Categories : Jquery

Remove duplicate string in an array
If the order doesn't matter, you can first sort the array with std::sort, then use std::unique to remove the duplicates. std::sort(std::begin(exampleArray), std::end(exampleArray)); auto it = std::unique(std::begin(exampleArray), std::end(exampleArray)); Here, it points to one past the end of the new, unique range. Note that since you started with a fixed size array, you cannot reduce its size to the number of unique elements. You would need to copy the elements to a container whose size can be determined at runtime. std::vector<std:string> is an obvious candidate. std::vector<std::string> unique_strings(std::begin(exampleArray), it); Note if you started with an std::vector<std::string> instead of a fixed size array, you would be able to avoid the copy and remove el

Categories : C++

How to remove duplicate nodes in an XML document in C#?
Here, I've wrote a little function for you. It's quite ugly, but it does get the job done perfectly. public static void RemoveDuplicates(string filePath) { XmlDocument reader = new XmlDocument(); reader.Load(filePath); bool foundApplicable = false; ArrayList removeNodes = new ArrayList(); foreach(XmlNode node in reader.GetElementsByTagName("transaction")) { if (node.FirstChild != null && node.FirstChild.Attributes["type"].Value == "SetActiveLocale") { if (node.SelectSingleNode("action/inputparams/param") != null && node.SelectSingleNode("action/inputparams/param").InnerText == "en") { if (foundApplicable) {

Categories : C#

Remove duplicate words from the sentence in C
Disclaimer: This will not fix your algorithm, see @Rohans answer for the fix in your algorithm. To fix your code, do the following: *output = (char*) malloc(text_size); ... should be: char *output = malloc(text_size); ... and change: *output[0] = ''; ... to be: output[ 0 ] = ''; ... do not cast a malloced block of memory. You can read more about this here. Observe that output[ 0 ] implies *( output + 0 ). Next, change: strcpy(*output, element); ... to: strcpy(output, element); ... then change: if (strstr(*output, element) == NULL) { strcat(*output, " " ); strcat(*output, element ); } ... to: if (strstr(output, element) == NULL) { strcat(output, " " ); strcat(output, element ); } ... notice that output is already a pointer, using the * as you do dereferen

Categories : C

Remove duplicate value from dictionary without removing key
This does it: myDict_values = myDict.values() # better than calling this numerous times for key in myDict.keys(): if myDict_values.count(myDict[key]) > 1: myDict[key] = "" This won't guarantee that key5 will be blank instead of key1, because dictionaries are not ordered.

Categories : Python

remove duplicate nodes from xml file using xsl
One way to do this via XSLT 1.0 is by utilizing the Muenchian Grouping methodology to output only unique <property> elements (based on their @name attribute). For example, when this XSLT: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output omit-xml-declaration="no" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:key name="kPropertyByName" match="property" use="@name"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="property[ not( generate-id() = generate-id(key('kPropertyByName

Categories : Xml

Remove duplicate on JSON iteration
You don't want to remove the duplicate entries, you want to merge them per-storyname. var stories = {}; for (var i=0; i<QueryResults.Results.length; i++) { var result = QueryResults.Results[i], name = result.StoryName if (!(name in stories)) stories[name] = {}; stories[name][result.Name] = result.State; } /* console.log(stories): { "FB Integration":{"Tech Design":"Completed","Development":"In-Progress","QA Testing":"Not Started","Front End Development":"Completed"}, "Twitter Integration":{"Tech Design":"Not Started","Development":"Not Started"} } */ Now you can build a table from that. var keys = []; for (var i=0; i<QueryResults.Results.length; i++) { var n = QueryResults.Results[i].Name; if (keys.indexOf(n) == -1) keys.push(n)

Categories : Javascript

Remove duplicate numbers from C array
You are moving the number before it is checked. That's why you are missing it. I suggest sorting them first and then check for duplicates later (current == prev). Maybe other techniques would work too.

Categories : C

How to remove the duplicate value in the store extjs
I don't think there is anything built-in. You would need either to enforce it on the model level - making this field unique and handling the errors, or load the store, sort by that field and go through all records comparing last one and next one.

Categories : Javascript

remove duplicate value but keep rest of the row values
Try this (note, you need a blank top row (edit: Actually, you're fine you have a header row)): =IF(A2<>A1,A2,IF(D2<>D1,A2,"")) =IF(A2<>A1,B2,IF(D2<>D1,B2,"")) =IF(A2<>A1,C2,IF(D2<>D1,C2,"")) etc in the top row and drag down Edit: Noticed you needed an additional condition.

Categories : Excel

Remove block from QTextDocument
I think this is a bug because it happens only for the first block. Other blocks are deleted completely without any problems. I found a workaround: cursor = QTextCursor(doc.findBlockByLineNumber(0)) cursor.select(QTextCursor.BlockUnderCursor) cursor.deleteChar() cursor.deleteChar() You should do it if you want to delete the first block. If you want to delete other blocks, use your original code. Maybe it's appropriate to create new QTextDocument and copy all blocks except the block you want to delete.

Categories : Python

How to remove duplicate dictionaries from a list in Python?
This answer is not correct for the now-disambiguated problem. Do the dicts all have the same keys? If so, write a function like the_keys = ["foo", "bar"] def as_values(d): return tuple(d[k] for k in the_keys) unique_values = unique_everseen(list_of_dicts, key=as_values) where unique_everseen is defined at http://docs.python.org/2/library/itertools.html If the dicts are not so consistent, use a more general key, such as the FrozenDict I posted to http://stackoverflow.com/a/2704866/192839

Categories : Python

Oracle SQL -- remove partial duplicate from string
It seems to me that you might be pushing SQL beyond what it is capable/designed for. Is it possible for you to handle this situation programmatically in the layer that lays under the data layer where this type of thing can be more easily handled?

Categories : SQL

How to remove Duplicates from two List except few elements which may be duplicate also?
var listA = new List<string>{"ASCB","test1","test2"}; var listB = new List<string>{"ASCB","test1","test2"}; var combinedList = listA.Where(a => a.Contains("test")) .Concat(listB.Where(b => b.Contains("test"))) .Distinct().Dump(); outputs 'test1', 'test2' your filter conditions are contained in your Where clause. Where can be whatever condition you want to filter by: Where(a => a != "ASCB" or whatever... Concat joins the two lists. Then call Distinct() to get unique entries.

Categories : C#

Remove duplicate values from HashMap in Java
ConcurrentModificationException happening,because you are removing from map if (value.equals(nextValue)) { map.remove(key); } You have to remove from iterator if (value.equals(nextValue)) { keyIter.remove(key); } Coming to the duplicate entry issue,Its pretty simple :Find duplicate values in Java Map?

Categories : Java

How do I remove duplicate objects from two separate ArrayLists?
Create a Set and addAll from both the ArrayLists. Set<Person> set = new ArrayList<Person>(); http://docs.oracle.com/javase/6/docs/api/java/util/Set.html

Categories : Java

Remove duplicate rows from mysql table
you can add url as the unique index.the following query will add the unique index and remove the deuplicates. alter ignore table urls add unique index(url); If you dont want to add unique index, then the alternate is to create a temp table with unique index,copy the data,remove the duplicate and transfer back to your original table.

Categories : Mysql

How to remove duplicate(fields) entries from a mysql db?
Before you set the constraint, do manual delete first. DELETE a FROM tableName a LEFT JOIN ( SELECT customer_invoice_id, MAX(id) id FROM tableName GROUP BY customer_invoice_id ) b ON a.customer_invoice_id = b.customer_invoice_id AND a.id = b.id WHERE b.customer_invoice_id IS NULL this will preserve the latest record for every customer_invoice_id. and you can now execute this statement, ALTER TABLE tableName ADD UNIQUE KEY idx1(customer_invoice_id) Demo, SQLFiddle Demo

Categories : PHP

Remove duplicate values from the Stack in Java
System.out.println(s) only prints s object that initialized before. removeDouble(s) doesn't have any impact unless you create new object of Stack or reinitialized... public static void main(String[] args){ Stack<Integer> s = new Stack<Integer>(); s.add(1); s.add(3); s.add(3); s.add(4); s.add(7); s.add(7); Stack<Integer> tempStack = removeDouble(s); // create new object System.out.println(tempStack); }

Categories : Arrays

Remove duplicate text from multiple strings
def common_prefix_length(*args) first = args.shift (0..first.size).find_index { |i| args.any? { |a| a[i] != first[i] } } end def magic(*args) i = common_prefix_length(*args) args = args.map { |a| a[i..-1].reverse } i = common_prefix_length(*args) args.map { |a| a[i..-1].reverse } end a = "This is Product A with property B and propery C. Buy it now!" b = "This is Product B with property X and propery Y. Buy it now!" c = "This is Product C having no properties. Buy it now!" magic(a,b,c) # => ["A with property B and propery C", # "B with property X and propery Y", # "C having no properties"]

Categories : Ruby

How to show one result and to remove the duplicate category
One quick trick is to just store them into a 2 dimensional array. Just do the following instead of echo'ing out the item the moment you have it: $clothes[$item->category_title] = 0; An entry is created and when you hit a duplicate it just recreates an entry. Now you can foreach ( $clothes as $item => $count ) { echo $item; } As an added tidbit, you could even increment the value, instead of setting it to 0, in case you need to know how many times the item appears in the list

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.