w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Remove classes of a STL::list which include a dynamic pointer
std::list::push_back() takes its argument by value (i.e. a copy is produced), and that's a real problem because you haven't followed the Rule of Three.

Categories : C++

Contains and remove methods for instances user-defined classes in a list?
The problem you have is that you have to define equals and hashCode consistent boolean contains(Object o) Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)). The contract is a.equals(b), then a.hashCode() must be same as b.hashCode(). Conclusion, you have to override equals and hashCode UPDATE public boolean equals (MyDataType other) { } Must be, @Override public boolean equals (Object other) { } Note that if you use override annotation then if you have an error won't compile, so use annotations! You are overloading equals this often is not necesary cause it's difficult to mantain and in your case ,unexpected behaviour

Categories : Java

Remove article title alias from URL
This approach works only in the /software/graphics/editors/ directory: RewriteEngine on RewriteRule ^software/graphics/editors/(d+)(-[w-]+)?$ /software/graphics/editors/$1 [QSA] To make it work in other directories use e.g. RewriteEngine on RewriteRule ^([w/]+d+)(-[w-]+)?$ /$1 [QSA] The second one is not 100% sure to work, but it should.

Categories : Htaccess

Ember: how is the title of a post or article included in the browser URL?
You would have to override the hooks model and serialize in your Route. The following is an example how the code for your publications could look like: App.PublicationRoute = Ember.Route.extend({ serialize : function(context){ var rawString = context.get("id") + " " + context.get("title"); return rawString.replace(/ /g,"-"); // replace spaces as you wish or encode the URI }, model : function(params){ var partsOfUri = params.slugName.split("-"); // split this part of the URI var id = partsOfUri.shift(); return App.Publication.findById(id); } }); Also have a look at the API Documentation for the model hook and the serialize hook.

Categories : Ember Js

MySQL query - Most commented article & relevant information for a given article
Your first query is fine, but you can also phrase it as: SELECT a.ArticelID, a.preamble, a.Published, count(*) as CommentCount FROM Article a join comments c on a.ArticleId = c.ArticleId ORDER by CommentCount DESC LIMIT 3; For the second query, you need a join and aliases: SELECT p.PictureID, p.Filname, p.photographerName, ap.ArticelID FROM PictureID p join Articel_Picture ap on p.PictureId = ap.PictureId WHERE ap.PictureID IN (2);

Categories : Mysql

Apache Commons - NNTP - "Article To List" - AWT
Welcome to the DIY newsreader club. I'm not sure if you are trying to get a list of newsgroups on the server, or articles.You have already have your Articles in an Iterable Collection. Iterate through it appending what you want in the list from each article. You probably aren't going to want to display the whole article body in a list view. More likely the message id, subject, author or date (or combination as a string). For example for a List of just subjects: ... Iterable<Article> articles = client.iterateArticleInfo(lowArticleNumber, highArticleNumber); Iterator<Article> it = articles.iterator(); while(it.hasNext()) { Article thisone = it.next(); MyList.add(thisone.getSubject()); //MyList should have been declared up there somewhere ^^^ and //your GetThrea

Categories : Java

Unable to position different list items inside article tag in HTML, CSS
The spacing is due to the default top and bottom margins of ul elements, of 16px. Update: Final Solution ul { margin-top: 0; margin-bottom: 0; padding-left: 0; } I would set these to 0 initially to prove that this is the issue, then increase them to something reasonable. The font-size is slightly bigger (for the li's) as well.

Categories : HTML

Remove call history article call one of the data in the database
very hard to understand what the question is, but if i make a guess, this line needs to be updated like this: //assuming executeUpdate returns a BOOL BOOL success = [db executeUpdate:[NSString stringWithFormat:@"DELETE FROM privacy_call WHERE address = %@",address]];

Categories : IOS

pass mysql value from php page to a joomla article and display relevant data inside of a joomla article
Yes, you can do this, if I understand your question correctly. Open up Joomla's main index.php. This is the index.php in the html root, not the index.php in one of the template folders. Near the bottom of the file, or maybe the very last line you will see something like this: // Return the response. echo $app Replace this line with the following: // Return the response. // parse $app for server side includes statements and execute them // note: this will only work for executable code, it will not import text or html files // we would need to check to see if the file were executable, then read it rather than execute it if it were not $output = $app; while(ereg('(&lt;!--#include virtual="([^&]+)" --&gt;)',$output,$groups)){ // extract the ssi command and the command $i = 0

Categories : PHP

HTML5: article inside article?
Your first method is definitely better. You should put your articles in a section. Check out these two posts on htlm5doctor: Section Article

Categories : HTML

Remove only new classes
You must cache the original list of classes in a variable before commiting any changes, or you won't be able to recover it later. As far as I tested, all methods to add a new class (with jQuery or not) end up changing the class attribute, the className property, and the classList.

Categories : Javascript

How should i create datacontract for a List of class which contain nested list of classes as properties
What you have in your example is fine and will automatically serialize correctly. I recommend attributing your classes with [DataContract] and your properties with [DataMember] for explicitness.

Categories : Wcf

Using Java's built-in Set classes to count EACH(keyword) unique element in List values from a list
You are looking for Map<String, Integer> data structure, not Set Something like for(iterating over something){ Integer count =map.get(value); if( count == null){ map.put(value, 1); } else{ count++; map.put(value, count); } } Map is the data structure that maps unique to value

Categories : Java

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 multiple classes at once
Assuming you're removing classes (like in your HTML) you can do the following $('div').removeClass('one two three'); The documentation on removeClass states: One or more space-separated classes to be removed from the class attribute of each matched element.

Categories : Jquery

using jquery's '.on' to target, add, and remove classes
It won't work because $('.menu-item').not('.active') will filter the elements when the event registration happens, then I don't think any of the menu-items has the class active assigned to it. The solution you should have is $(document).on('click', '.menu-item:not(.active)', function(){ //do })

Categories : Jquery

jQuery less than function with add and remove classes
you forget else case use it then it will work var $window = $(window), $html = $('.studio .thirtyheight'), $htmltwo = $('.studio .sixtyheight'); if ($window.width() < 1140) { return $html.addClass('workfullheight').removeClass('thirtyheight'), $htmltwo.addClass('workfullheighttwo').removeClass('sixtyheight'); }else{ $html.removeClass('workfullheight').addClass('thirtyheight'), $htmltwo.removeClass('workfullheighttwo').addClass('sixtyheight'); }

Categories : Jquery

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

jQuery - remove all matching classes
Try it this way: $('#builder [class*="ui-id-"]').removeClass(function(i, j) { return j.match(/ui-id-/g).join(" "); }); should remove all the matched classes.

Categories : Jquery

When is the best time to remove no-js classes from the html tag
In the <head> is the best place to prevent the "flash of unstyled content". Even the popular Modernizr library suggests this: The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the <body>, and if you’re using any of the CSS classes that Modernizr adds, you’ll want to prevent a FOUC.

Categories : Javascript

create a list from another list and remove elements from copied list
Yes your understanding is correct. List newList = new ArrayList(collection); will do a shallow copy. You can modify the newList without affecting the original collection, but they will each reference the same elements so if you modify an element in one list, the other list's element will also get the change. This is called a Shallow Copy. Here's a visual representation of what I've described: The things at the bottom are the objects in your array.

Categories : Java

Why does adding a list to another list, using add range, remove the elements from the first list?
It's because of the IEnumerable. When you set groupsToAdd to the result of groups1.Where(g => false == groups2.Contains(g)) there is deferred execution, which means that the query is not run until AddRange() and then again at Dump(). Because the list, groups2, now contains the elements they no longer are a result of the original query.

Categories : C#

trying to remove large file in git -- can't remove rev-list reference
It turns out I had an old tag still referencing the large files, and wasn't aware that filter-branch does not operate on tags. This answer led me in the right direction. In short, I needed to add the --tag-name-filter [tag] option to filter-branch

Categories : GIT

Remove classes string name from compiled release exe
If you were to remove class names from the executable, then your application would stop working. The .dfm files that are compiled into your application contain the class names. The runtime streaming framework needs to be able to look those classes up in the class registry and without the names then your forms and their properties could not be streamed. On top of that, as AlexSC points out, the implementation of TObject.ClassName requires the names of the classes to be present in the executable file.

Categories : Delphi

remove unused classes with proguard for Android
I believe you have to use -injars: -injars class_path Specifies the input jars (or wars, ears, zips, or directories) of the application to be processed. The class files in these jars will be processed and written to the output jars. By default, any non-class files will be copied without changes. Please be aware of any temporary files (e.g. created by IDEs), especially if you are reading your input files straight from directories. The entries in the class path can be filtered, as explained in the filters section. For better readability, class path entries can be specified using multiple -injars options. Source: http://proguard.sourceforge.net/index.html#manual/usage.html

Categories : Android

How do I remove HTML tags with specific classes?
Using javascript you can do like this: <script type="text/javascript"> $(function () { $("button").click(function () { $(".box-single").remove(); }); }); </script>

Categories : Ruby On Rails

jquery remove multiple variable classes
One method I can think off without regex is storing the current class in a variable and then removing it. var prev; $('#container li').hover(function () { var i = $(this).index() + 1; prev = `n-` + i; $('#container ul').addClass(prev); $(this).addClass('active'); }, function () { i = $(this).index() + 1; $(this).removeClass('active'); $('#container ul').removeClass(prev); }); Check Fiddle But as the comments suggested , it is a bad practice to do so

Categories : Jquery

jQuery Click on Div to Hide Divs and Add/Remove Classes
The only problem I'm seeing is when the page loads both the items are displayed. It can be fixed using $(document).ready(function(){ $("#cliente").click(function(){ $("#login-staff").hide(); $("#login-cliente").show(); $("#staff").removeClass("active-login-switch"); $("#cliente").addClass("active-login-switch"); }).click(); $("#staff").click(function(){ $("#login-cliente").hide(); $("#login-staff").show(); $("#cliente").removeClass("active-login-switch"); $("#staff").addClass("active-login-switch"); }); }); Demo: Fiddle

Categories : Jquery

how i can remove elements from list with out using remove method?
I'll play, but this is something of a cheat because the obvious implementation of clear(), the one in AbstractCollection, uses the Iterator remove() method internally. If this is not what is wanted, maybe the objections will clarify the question. import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Test { public static void main(String[] args) { List<String> data = new ArrayList<String>(Arrays.asList(new String[] { "a", "b", "c", "d" })); System.out.println(data); funnyRemove(data, 2); System.out.println(data); } public static <T> void funnyRemove(List<T> list, int index) { if (index < 0 || index >= list.size()) { throw new IllegalArgumentException("index out of range"); } L

Categories : Java

How do I remove all occurrences of {root, leaf} from classes in Enterprise Architect?
In the Diagram Properties dialog, there is an option "Show Element Property String". You can switch this off for each diagram. Alternatively, you could export your model to XMI, open it in a text editor, do a search-and-replace to remove all occurrences of isroot="true" and isleaf="true", and then re-import the XMI.

Categories : Misc

Remove element from list if it satisfies a condition defined from a separate list - Python
This will produce the list you seek. The key is to use zip (or izip if you prefer) when you have lists with corresponding elements. [offset for offset, ratio in zip(Offset, Ratio) if ratio < 2.5]

Categories : Python

Using jQuery to remove & add classes to buttons, the new class added won't work with it's click function
When you call $(".register_unselected").click() jQuery actually searches the DOM for any elements matching .register_unselected and then listens for click events on them. Since your element won't exist until after this method is called, this will have no effect. Instead, use $("body").on("click", ".register_unselected", function(){}); You could also replace body with another selector that will always contain the element changing classes. EDIT: Here's a forked CodePen: http://codepen.io/anon/pen/DqFuL

Categories : Jquery

Remove index.php from url and still be able to POST
the 301 redirect (really any redirect) will kill your post variables. Perhaps post to str_replace('index.php', '', $_SERVER['PHP_SELF']) or even simpler, when posting to self you can post to just ? which the browser will just interpret as self client side. It will add a ? to the url. or maybe $_SERVER['REQUEST_URI'].

Categories : PHP

ValueError: list.remove(x): x not in list, item definitely exists
Instead of picking a random index from the list of snapshots, shuffle the list once and pop items from that shuffled list: shuffledSnapList = snapRoList[:] random.shuffle(shuffledSnapList) while shuffledSnapList: roSnapshot = shuffledSnapList.pop() By using a while loop testing against the list you are removing from, you guarantee the loop will terminate when the list is empty. Because the list is shuffled, the items are processed in random order.

Categories : Python

Dynamic Compilation in Memory for Java for classes and classes that have dependencies on those classes
I believe your problem is in the JavaSourceFromString class, which needs to encode a URI for the class name: @Test public void test(){ Map<String, String> code = new HashMap<String, String>(); code.put("example.A", "package example; " + "public class A { " + " public A() { " + " doSomething(); " + " } " + "}"); code.put("example.B", "package example; " + "public class B { " + " private A holderForA; " + " public B() { " + " this.holderForA = new A(); " + " } " + "}"); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); Diag

Categories : Java

How to remove offensive words from post by php?
Use str_ireplace function that Case-insensitive version of str_replace() $text = str_ireplace("flip","(Offensive words detected & removed!)", $text);

Categories : PHP

Python list.remove for loop "x not in list"
your list is not 2000 long, you start at 2.. >>> primes=list(range(2,2001)) >>> print len(primes) 1999 So when you do the while loop, it doesn't get up to 2000... :)

Categories : Python

Remove list item and add them to and unordered list
Don't remove the slice or else it deletes it from the dom. First make the slice selection as you did and assign it to a variable, then append that variable to the UL. Then you can remove whatever you want from the DOM. var myItemsGreaterThan5 = $('li').slice(5); $( "ul" ).append( "<li>More +</li>" + myItemsGreaterThan5 ); myItemsGreaterThan5.remove();

Categories : Jquery

Remove wordpress post status verification
You need to add a corresponding query before The Loop. You can use query_posts() for this purpose: An example: <?php global $wp_query; $args = array_merge( $wp_query->query, array( 'post_status' => array('publish', 'draft') ) ); query_posts( $args ); ?> See the Type Parameters documentation here. Hope this helps!

Categories : PHP

jQuery replacing list items with different list items with specific classes
You don't have to use .load there, If, classes are already there, you don't have to do anything - Simply remove this Line $(this).load("li a.add-this-list-on-click-instead > *").fadeIn("slow"); and if .add-this-list-on-click-instead are hidden initially - then just make it visible with this - $("#dynamic").click(function() { $this = $(this); var refreshId = setInterval(function() { $('.remove-this-list-on-click').fadeOut("slow", function () { $this.find("a.add-this-list-on-click-instead").fadeIn("slow"); }); }); });

Categories : Jquery



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