Evaluate xpath2.0 in node.js - node.js

How to evaluate xpath2.0 in node.js
I found saxon-js and xpath2.js libraries in npm.
I tried as per the documentation but it didn't work.
Give me some examples of how to evaluate xpath2.0 in node.js

Saxon-JS does indeed implement XPath 2.0 in Javascript (actually, XPath 3.1), but it's not currently available for Node.js "out of the box". We hope to ship that in the coming months. People have made it work, but only by digging in and getting your hands dirty.
I can't comment on the current state of Sergey Ilinsky's XPath2 implementation.

Related

Parsing GHC Core in ghc-7.10

I am trying to parse some GHC Core to extract name information and other bits needed.
I am currently using the GHC API given that I haven't found other useful packages help with it.
I've looked through some packages like ghc-core, ghc-core-html and extcore but they seem slightly outdated and I haven't managed to use extcore with ghc-7.10.3.
I have also tried to look for up to date documentation on Core without luck. The best post I've come across is this one, but the discussion is slightly outdated (e.g. compiling the example from these slides, gives a different core dump using the latest ghc.
The question
Having said all this, do you guys know of any recent package that can help in parsing Core? Is there any new documentation regarding CORE manipulation?
Thanks!
The external core feature was removed because it was buggy and a hassle to maintain and if people were using it they didn't speak up. So there is no longer any textual representation of Core intended for machine consumption. Only the internal (AST) representation is available. Of course, I'm sure you'd be welcome to revive the external representation if you want to maintain it.

lucene 4.6 concurrent flushing

I have read http://blog.trifork.com/2011/04/01/gimme-all-resources-you-have-i-can-use-them/ which mentions concurrent flushing, however when I tried looking into api of version 4.5.1 and 4.6.1 there are no such function and I cannot find any sample code either. The class DocumentsWriterPerThread is not in 4.5.1-4.6.1
Can anyone please provide some info on this issue? It would be great if a sample code provided as well to get me start up.
thanks
DocumentsWriterPerThread certainly is out there in Lucene 4.5, though to the best of my knowledge, it's not really something most users would be expected to monkey with.
As far as how to use Concurrent Flushing, you already are. The change went out with Lucene 4.0, see LUCENE-3023.
If you are not seeing this speed improvement is some way (not sure what problem you are observing), as stated by Michael McCandless, in his article on the topic:
Remember this change only helps you if you have concurrent hardware, you use enough threads for indexing and there's no other bottleneck (for example, in the content source that provides the documents)

How do I build Watir tests for websites?

There is a repository of tests for the Mozilla addons site, although it's written using Selenium. I'd like to know if there are any real-world examples available for Watir, so I can see how the framework is implemented by professionals?
This is a more general question about how one goes about building a suite of tests for a website in Watir. On a superficial level, one can write a bunch of seperate .rb files with crude error reporting and fire them all off; but I'd like to know more about writing actual classes and proper test structures that raise issues and return reports. How is this done? Are there any books on this? Tutorials?
Check out WatirMelonCucumber - a set of watir-webdriver tests against google and bing, and also EtsyWatirWebDriver - a set of watir-webdriver tests against Etsy.com
The watir Wiki has a selection of tutorials, examples etc as well.
Start Here
Learning More
Wiki homepage
Those are however fairly basic and don't get into the 'how to organize things' level.
In that case there are a number of frameworks in various states of development. The most active ones are I think are perhaps Taza, and QA Robusta. Each of them approaches things a little differently. QA Robusta is wrapped a bit around Minitest (if I understand things right) and provides it's own reporting. I'm still learning about Taza so can't really comment on it much. I also recall hearing about a 'WatirSpash' gem/framework that was discussed in a recent watir podcast which is designed to help watir use along with RSpec (and I might presume Cucumber)
If you are a BDD/Spec-by-example sort, then you may want to use either (or both) RSpec or Cucumber perhaps in combination with the WatirSpash gem as a way to organize and describe you tests, and then implement the actual test code via Watir, In that case you would likely be using the HTML based reports that can be generated by RSpec/Cucumber instead of rolling your own or depending on a watir framework for the reporting.
More Watir frameworks:
https://github.com/jarmo/WatirSplash
https://cyberconnect.biz/opensource/qa_robusta.html
Not in active development:
https://github.com/scudco/taza
https://github.com/bret/watircraft
QA Robusta most likely will not have too many new features added but will be supported. Instead you may want to check out whirlwind. Whirlwind uses similar concepts as other frameworks such as qa_robusta and taza, but is lighter weight and tailored around cucumber/rspec. See the walk through for a google search example.

Does Watir-webdriver resolve the difference in indexing bases between Watir and Firewatir?

One of the barriers (that as far as I know was never removed, but perhaps I'm mistaken and this was resolved a while ago?) to being able to have truly cross browser compatible tests with Watir and Firewatir is that Watir was originally designed to use One based indexing, while whoever created firewatir broke with that and made it Zero based.
While I'm sure there are good historical reasons for each decision, and I don't want to debate which is right, it's been a pain for testers trying to create scripts that run under each without any alteration since at the very least this affects identifying elements by :index, which is sometimes something you've no choice but to do.
I'm wondering if moving to Watir-Webdriver could create a more uniform platform?
Also do we have any reference to the differences between the latest Watir, and Watir-Webdriver? For example in a recent question here it came up that .value= is not implemented as a 'direct set without events' alternative to .set, and basically acts just the same as .set does.
The best solution to this problem would be for Watir 1.X to gain configurable indexing. I believe the majority of that work has already been done on Bret's zero-index branch, so it's just a question of someone picking that up and getting it out there.
When we were migrating to watir-webdriver, we added this monkey patch to help with this problem:
class Fixnum
def as_index
Config.webdriver? ? self - 1 : self
end
end
and then in our scripts:
browser.div(:index => 1.as_index)
Then when we were off Watir completely, it was a simple matter of grepping for as_index throughout the code base and decrement the indexes by one.
I've tried to document the major differences between Watir and watir-webdriver on this wiki page. I'm sure it's lacking, and if someone wants to improve it, that's very welcome of course :)

Is G4jsf still being developed/supported?

I've been evaluating different Java Web Application UI Frameworks. I have about 8 months of intensive JSF experience that I'd like to continue using. JSF also provides me the spider-readable markup as well as the ability to create very simple forms without touching much Java code.
I also will have need for thick-client side interfaces that will perform well with few server round trips. GWT seemed like an ideal choice for this.
So, when I found G4jsf, I thought I had found the best of both worlds. However, I can't seem to find any active development on it. I hope it hasn't died, but it seems like that is the case.
Is there active development on this? Or am I two years too late?
Well, based on the conversation in the reference below, it seems that G4jsf is no longer being supported. If the poster is in fact Sergey Smirnov, I would imagine he'd be a pretty reliable source on the matter. :)
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=150674

Resources