I'm using akka (akka-2.2.1) through java and I'm not familiar with scala or sbt.
I need to change the serializer to one of the following.
https://github.com/romix/akka-protostuff-serialization
https://github.com/romix/akka-kryo-serialization
How to build these?
Related
I am developing an web application using the Play framework in Scala language. In my application I have to access the native methods which is written in C++ and converted into .so by using swig.
My aim is to call the native method which is in .so file from the Controller class. I have searched in the internet, but I didn't get any documentation for this.
I have seen some links which is used by scala language.
https://code.google.com/p/scala-native-access/
https://code.google.com/p/bridj/wiki/Download#Specialized_subsets_(smaller_JARs_!)
https://github.com/xudongyang/scala-native-access
But they didn't mention how exactly use this in the Play framework.
Can anybody have the documentation for Play scala native access?
Can anybody have the sample applcation for the same?
Like in any JVM language, JNA/JNI gives you native access. Be aware that because of Play's use of class loaders, you'll need to make sure you access from the same class. See fail to load a native library using activator (Play Framework)
This is hard to answer in general. Play! is just a Scala library and framework, some any tool that allows you to use native calls in Scala will work similarly with play. From the first link that you pointed to, there are instructions to integrate with SBT (the Scala Build Tool) which also manages your Play framework. You will need to make the changes they mention to your build.sbt file which you can find in the top level of your Play project folder.
I recently wrote some tests for one of my django Projects. What I now want to do is to call the test command from a script.
I am looking to parse the test results and save them. Is that at all possible for django testing framework?
The easiest way would be to use a standard test output format, such as JUnit XML, for which there are already libraries. Right now, I'm using django-jenkins, which provides a nice output that I can view in our CI tool.
If you'd like to roll your own solution, I'd reccomend coding your own Test Runner, and customizing the suite_result method.
I have a domain model that is created using ecore EMF.
And I would like to generate POJOs. I would like to be able customize the POJOs, so I am looking at using Acceleo.
However, I can only see creating POJOs in Acceleo from UML. When using EMF it produces EObjects, Estrings etc.
Is it possible to just produce POJOs?
With Acceleo, you can generate anything you want. If you want to generate just POJOs from an UML model, you can use or fork the UML to Java generator available on Github. If you do, make sure to use the version matching the version of UML that you are using (master branch for UML2 v4.0.0, R1_1_maintenance branch for UML2 v3.x.x).
If you are using UML2 v3.x.x, you can simply install it by using the Eclipse Marketplace. The 2.0.0 release of the generator fo UML2 v4.0.0 will be released soon.
See the following link for generating POJOs with EMF:
http://eclipseo.blogspot.be/2007/10/creating-pojos-using-emf.html
If you want to customize this even more, you could also use other methods:
XPand
XText
Acceleo ECore generation templates
etc
Ember don't seems to play well with requirejs or building with r.js without some hackery.
Bit hard to manage a large application, I like to break down my file structure as HMVC, which manages modules bit easier :
app
- blah
- modules
-module1
- controller
- model
- view.
Has anyone come up a build stack to automate the compilation into single file with dependency management?
Update: You should now be starting new projects using ember-cli, which provides all the build/dev tools plus many other useful features.
Original answer:
An example Ember project using grunt.js as a build system:
https://github.com/trek/ember-todos-with-build-tools-tests-and-other-modern-conveniences
I've used this as a starting point for some Ember apps and it works well.
Ember don't seems to play well with requirejs or building with r.js without some hackery.
Why do you want to use require.js in the first place?
As for making this all work you'll need a build tool. I recommend brunch (Node) or iridium (Ruby). Brunch is more simple and supports many different module formats. Iridium is much more powerful. It uses Minispade for modules. Require.js/AMD is not needed because your js is always delivered as a single concatenated file.
For stand-alone ember dev I use ember-skeleton as a starting point, which is itself based primarily on rake-pipeline.
https://github.com/interline/ember-skeleton
This provides the whole kit-and-kaboodle for beginning an app, but the meat of it is the rake-p Assetfile, which describes how rake-pipeline will digest all the files, filter their contents, and ultimately combine them into the final handful of files. Additionally, the combination of loader.js and the minispade filter allows the use of 'require()' statements for managing dependencies amongst your files.
We're developing in C++ under Linux and about to set up automated tests. We intend to use a testing framework like CppUnit oder CxxTest. We're using Ant to build the software and we will also use it to run the tests.
As some tests are going to involve database access, we are looking for a tool or framework which facilitates the tasks of preparing and cleaning up test data in the database - just like DbUnit (a JUnit extension) in the Java world.
Another option may be to employ the actual DbUnit - a Java VM is available. Making use of DbUnit's Ant task seems to be most promising. Any related field reports are welcome!
I would recommend boost unit testing. You would probably have to use the setup and teardown to manually clean up the database. Of course, you could build your own C++ DbUnit in ODBC. IF you do let me know because I could use this as well!
I suppose you have your own C++ api to work with DB.
If it is true, you'd better to do all your DB preparation by your own. In that case you will test your DB API as well.
As there seems to be no DbUnit-like tool for C++ development, we've built a little framework of our own. Basically it's an adaptor for calling actual DbUnit operations from within C/C++ testrunners. It makes use of the Ant tasks provided by DbUnit.
We defined some macros like TS_DB_INSERT(filename) which call system("ant -Ddb.dataset=filename db.insert") and the like.
In this case, db.insert is an Ant target which executes a DbUnit task performing an INSERT operation on the database. The filename references an XML dataset containing the data to insert.
There's also an assertion macro which wraps a DbUnit compare.
The test case might look like this:
void testDatabaseStuff
{
TS_DB_INSERT("input.xml");
TestedClass::doSomething();
TS_DB_ASSERT("expected.xml");
}