When to do Nashorn over Java Hooks? - hook

I have a java application that does text processing.
Nashorn could be used to add customization just like hooks. So When should I use Nashorn and when should I use hooks? (assuming language doesn't matter)

It should be possible to write your hooks assuming java lambdas. This would allow Nashorn functions or Java functions to be used for your hooks. If you direct your question to nashorn-dev with specifics you will get more specific details.

Related

Using JetBrain's MPS to create an editor plugin

Can I use MPS to create a "conventional" language plugin for IntelliJ?
It looks like MPS' core feature is the transcription from a DSL to Java. However I just want to define the DSL syntax and editor to ship it as a standalone language plugin via the JetBrain plugin repository.
I am uncertain whether that is the purpose of MPS or I have to use the Grammar-Kit to create the plugin as it is described here.
Yes, MPS allows you to create IDEA plugins, just like the Grammar-Kit does. Take the MPS route, if you need any of its core features - projectional editor, modular languages or multi-stage code generator.
Vaclav

How to set threading mode in SQLite with Entity Framework?

I'm using SQLite with Entity Framework Core (RC1).
I read, that SQLite supports three different threading modes: Single-thread, Multi-thread and Serialized.
How do I set in run-time, which mode I want to use with my database?
Microsoft.Data.Sqlite references the SQLitePCRaw.bundle_e_sqlite3 NuGet package. That package contains a version of SQLite that has been compiled with SQLITE_THREADSAFE=1 (Serialized). Microsoft.Data.Sqlite doesn't currently expose an API to change this, nor did System.Data.SQLite.
See also aspnet/EntityFramework#5466.
It is accomplished by opening a database with the appropriate flags set. SQLITE_OPEN_NOMUTEX for multithread or SQLITE_OPEN_FULLMUTEX for serialized. It looks like flag setting is available through the C interface:
https://www.sqlite.org/c3ref/c_open_autoproxy.html
So if you aren't using the C interface directly, you are at the mercy of EF and whether they have decided to support flag setting on database open.

difference between Groovy JDK API Documentation and groovy api Documentation

I am new to groovy I want to know the exact difference between Groovy JDK API Documentation and groovy api Documentation. I want to know the purpose of those api
Groovy adds additional methods to some JDK library classes (e.g String, File). These additional methods are known as the Groovy JDK and are documented here. All the methods that are available when using JDK classes in a Java program are also available when using them from a Groovy program.

hibernate like technology as a persistence layer for groovy?

I was wondering if there is like a persistence layer for groovy that is integrated on the ide to generate code automatically based on your database structure?
Just use Hibernate, as you would for a Java project.
Groovy can call java, and you can use the cross-compiler to compile both sources when you build your project.
The Hibernate tools will not spit out Java (so the code will be more verbose than the Groovy replacements), but as you won't need to write the code, this doesn't matter ;-)

Execute Javascript before launching the default XUL page

Have to execute scripts using spidermonkey(jagermonkey) javascript engine availalble within XULRunner.The javascript has some dependent Javascript libraries like requriejs/commonjs etc.
RequireJS provides documentation for Rhino/NodeJS javascript runtime environment.The documentation or testcases does not suggest anything about Spidermonkey scripting environment.
Is it possible to use requirejs with Spidermonkey?Any pointers on how to go about it ?
I am using the javascript runtime packaged within XULRunner 2.0.
For XULRunner in particular, you can take a look at the Firebug code -- it embeds requirejs with an adapter for running in XUL.

Resources