DOM vs XPath - Difference? [closed] - dom

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm curious of what the pros and cons are of these two, DOM and XPath. What does XPath provide that DOM does not, and the other way around? I'm not looking for performance or anything like that, just what is the main difference between the two when it comes to navigation? When is DOM better to use than XPath for example?
Thanks.

They are complementary rather than competing. DOM provides a tree model of XML with low-level navigation capability (get first child, get next sibling, etc); XPath adds a much higher-level search and navigation capability (e.g. get the average price of all books, get the title of the last chapter).
Note also that DOM is just one tree model for XML, and is very far from being the best: it's the first and the worst, and it's a shame that so many people still use it. In the Java world there are much better designs available such as JDOM and XOM.

Related

Why is Perl market position in server-side scripting so low, even less than Java? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
As per the article at W3Techs, Perl ranks the lowest among the server side scripting languages, even less than Java? Is there any reason behind it? Perl, as far as I see, is very popular, and an awesome language, how come it is hardly used by websites? Does it have issues with server side scripting?
This article has a lot of details on how W3Techs gets their data: http://w3techs.com/blog/entry/usage_of_perl_for_websites_fell_below_1_percent
As i did some analysis on this, let me summarize in short that the data presented by W3Techs is deeply flawed and extremely misleading. First off, it is important to know that they detect technologies of sites by running simple scripts at them that look for file suffixes in urls and then just take that and never verify with the site owner. As such they have a "no-detect" rate of 17.6% (plus an unknown "false-detect" rate). A more correct version of their chart would be this:
If you'd like to get more details and more mistakes in their data methodology, please take a look at the comments of the article, especially those written by "Mithaldu" or "Christian Walde", i.e. me. I posted extensively there as to why their data is nearly useless and why they're even misinterpreting the data they do have.

Javascript Chart that supports Knockout.js [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I've searched for client side javascript chart which supports KO.js but haven't been able to find one.
Has anyone have had any experience with charts that supports KO.js? Reason I'm after KO is that when user toggles the chart parameters, the chart should get rendered automatically for selected parameter.
Have you checked out Wijmo? It includes charts and several other widgets, all with KnockoutJS support:
http://wijmo.com/widgets/mvvm-support/
There's a sample on CodeProject that shows how to build a stock portfolio application using KnockoutJS and the Wijmo line chart widget:
http://www.codeproject.com/Articles/424656/A-Stock-Portfolio-Application-Using-KnockoutJS
You likely won't find that anytime soon; Good charting solutions or libraries in general don't take a stance over which particular application framework to use. In the (segmented) world of JS, one has to write adapters all the time (the most famous one being framework X to JQueryUI widgets); The devs at squareup plugged EmberJs with d3 so I see no reason why one couldn't do the exact same with knockout.
http://corner.squareup.com/2012/04/building-analytics.html

Zend Form Elemenet addValidators list value [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In Zend_Form_Element. I see addValidators(), but not in Zend example, and the book. They only show me about "NotEmpty" , and "EmailAddress".
Also have ->addFilter('StripTags') and "StringTrim" or "Int"
I want to know is there more value for addValidators() & addFilter() (not only "NotEmpty" and "EmailAddress", right?)
But I can't find any link on Zend website.. Their document is hard to use.
Any one give me a list of those values or link to some page I can learn.
You have it also in your project in library/Zend/Validate and library/Zend/Filter
The Reference Guide is the place to be looking for useful information.
See the Standard Validators page from the Zend_Validate section which shows all the built in validation classes you can use, and a similar page for Standard Filters from the Zend_Filter section.
The API Documentation gives you a full outline of all the classes and their methods, but if you are new to ZF it can be hard to find what you are looking for in the API docs. The reference guide is where you will probably be spending a lot of your time reading and learning from examples.
Zend_Form_Element works seamlessly with Zend_Validate classes, so you are able to 0 or more Zend_Validate_* classes to your form elements to validate them against a set of rules instead of manually writing code to validate input.

how to add tag suggestion functionality to my blogware? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am creating a blogging functionality to my website running on a cms.
My requirement is this:
When a person has written an article, he must automatically provided with 'suggested tags'. These words must come from the article. How can I implement this functionality?
I thought some ideas. Like:
Suggest words which are the longest. Using this, I can filter out 'a', 'of', 'my' etc but not 'because'.
Create a blacklist of words. But I couldn't find any such ready-made list and creating such a list will take a very long time.
So, any other ideas?
You could do Bayesian classification and see what happens. Here's some example code.
UPDATE: This presupposes that you have some tags for the classifier to choose from. Here is a simple algorithm for extracting keywords from text if you need to initialize your list of tags.

Best pageable table implementation in GWT [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to add a paging, sortable table to my GWT application.
I see lots of these out there so I'm looking for your experience to save me time by choosing the best one.
So far I'm looking at...
http://code.google.com/p/gwt-advanced-table/
http://code.google.com/p/google-web-toolkit-incubator/wiki/PagingScrollTableOld
I like the second one best. Any stories to tell?
There's a new CellTable that has support for paging. It's in the GWT trunk right now and will, with any luck, make it into a 2.1 release later this year.
It's already been answered here
And unfortunately there is no satisfying implementation available.
The best approach i have found has the GWT widget library. I have used it to create my own paging solution.
I completely disagree that there is no suitable solution. You really need to check out GXT. I am using the Paging Grid implementation in my organization with great success.
http://extjs.com/products/gxt/
I have been using gwtlib [http://code.google.com/p/gwtlib/] its a nice expendable solution that uses the Controller Pattern, I have been using it in some personal projects.
I agree that GXT is the best solution, but, as i said before, it has a commercial license in this way any non open source project has to pay for it!