what the best NoSQL solution for windows server? - nosql

what the best NoSQL solution for windows server? preferably open source

You should consider using Redis. It's an advanced NoSQL database with support for rich server-side data structures such as lists, sets, sorted sets and hashes. It is also one of the fastest NoSQL databases around: 110000 SETs/second, 81000 GETs/second in an entry level Linux box. Check the benchmarks.
I have a feature-rich open source C# client that let's you persist any C# POCO type natively available at:
https://github.com/ServiceStack/ServiceStack.Redis
Here are some benchmarks comparing the Redis C# client vs RavenDB.
The client provides a rich interface providing wrappers for .NET's generic IList, IDictionary and ICollection for Redis's rich server side data structures.
If you want to view a good tutorial on how you can use it to develop a real-world application check out:
http://code.google.com/p/servicestack/wiki/DesigningNoSqlDatabase
Here's an example from the page above showing how easy it is to store and retrieve C# objects:
var redis = new RedisClient();
using (var redisUsers = redisClient.GetTypedClient<User>())
{
redisUsers.Store(new User { Id = redisUsers.GetNextSequence(), Name = "demis" });
redisUsers.Store(new User { Id = redisUsers.GetNextSequence(), Name = "mythz" });
var allUsers = redisUsers.GetAll();
Console.WriteLine(allUsers.Dump());
}
/*Output
[
{
Id: 1,
Name: ayende,
BlogIds: []
},
{
Id: 2,
Name: mythz,
BlogIds: []
}
]
*/
Although the server is primarily developed on Linux I have windows redis-server builds available at:
http://code.google.com/p/servicestack/wiki/RedisWindowsDownload

RavenDB by Ayende is the only one written in .net (that I know of), so it "just works" on Windows.
It is Open Source, but it has a dual license:
you can use it for free if your project is Open Source as well, otherwise you have to purchase a commercial license.

I have used MongoDB on Windows and the install went pretty smoothly. I haven't put a real heavy load on it yet.
And you can find a .NET driver here for Mongo if that's your platform

A bit old answer but there's an approach giving you a nosql'ish document store behavior over SQL-server, http://www.sisodb.com

You could NosDB a try. Its a NoSQL database written completely in .NET which supports SQL queries as well.
It's open source with Apache 2.0 License so its completely free without any strings attached.
The answer to whether is it the best or not is completely opinion based so you should check it out yourself.

Related

Is it possible to get shell properties for an item not in the shell namespace?

Short Version
How does the shell get the properties of a file?
Long Version
The Windows Shell exposes a rich system of properties about items (e.g. files and folders) in the shell namespace.
For example:
System.Title: A Quick Guide for SQL Server Native Client OLE DB to ODBC Conversion
System.Author: George Yan (KW)
System.Document.LastAuthor: rohanl
System.Comment: To learn more about this speaker, find other TEDTalks, and subscribe to this Podcast series, visit www.TED.com Feedback: tedtalks#ted.com
System.ItemParticipants: George Yan (KW)
System.Company: Contoso
System.Language: English (United States)
System.Document.DateCreated: 6/‎10/‎2014 ‏‎5∶16∶30 ᴘᴍ
System.Image.HorizontalSize: 1845 pixels
System.Image.VerticalSize: 4695 pixels
System.Image.HorizontalResolution: 71 dpi
System.Image.VerticalResolution: 71 dpi
In order for the shell to read these properties, it obviously has to use a lot of sources:
Windows Media Foundation IMFMetadata works great for images and movies
Windows Imaging Component (WIC) probably has a lot of APIs for reading metadata
I'm not sure if IFilter can retrieve Title, Author, Subject, Comments etc from Office documents
Either way, it has to read the file contents stream and do something with the contents of the file in order to get all these fancy shell properties. In other words:
IStream \
+ |--> [magic] --> IPropertyStore
.ext /
Can use it with my own stream?
I have items that are not in the shell namespace; they are in a data store. I do expose them to the shell through IDataObject as CF_FILEDESCRIPTOR with an IStream when its time to perform copy-paste or drag-drop. But outside of that they are just streamable blobs in a data store.
I'd like to be able to leverage all the existing work done by the very talented and hard-working1 shell team to read metadata from a "file", which in the end only exists as an IStream.
Is there perhaps a binding context option that lets me get a property store based on an IDataObject rather than a IShellItem2?
So rather than:
IPropertyStore ps = shellItem2.GetPropertyStore();
is there a:
IPropertyStore ps = GetShellPropertiesFromFileStream(stream);
?
How does the shell get all the properties of a file?
Bonus Chatter - IPropertyStoreFactory
This interface is typically obtained through IShellFolder::BindToObject or IShellItem::BindToHandler. It is useful for data source implementers who want to avoid the additional overhead of creating a property store through IShellItem2::GetPropertyStore. However, IShellItem2::GetPropertyStore is the recommended method to obtain a property store unless you are implementing a data source through a Shell folder extension.
Tried
IPropertyStore ps = CoCreateInstance(CLSID_PropertyStore);
IInitializeWithStream iws = ps.QueryInterface(IID_IInitializeWithStream);
But CLSID_PropertyStore does not support IInitializeWithStream.
Bonus Reading
MSDN: Initializing Property Handlers
Property handlers are a crucial part of the property system. They are invoked in-process by the indexer to read and index property values, and are also invoked by Windows Explorer in-process to read and write property values directly in the files.
MSDN: Registering and Distributing Property Handlers (spellunking the registry for fun and reading contracts from the other side)
(Have some experience in Property Store handlers) How I see a solution:
Get PropertyStore handler CLSID for your file extension. You should use 2 regkeys key:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.yourext
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\SystemPropertyHandlers
Create two objects with CoCreateInstance
If you have 2 object you can combine them into single object with PSCreateMultiplexPropertyStore
Query for IInitializeWithStream (also you can try to query IPersistStream).
If the PropertyStore object supports IInitializeWithStream/IPersistStream: you are lucky - just init your object and query the properties you need. If does not - you still have (dirty) variant to create temporary file and then use IPersistFile.

Executing g-code from file within a ST-program in the software Automation Studio from B&R

I have a 3-axis system, which resembles the CNC-axis, and a PowerPanel from B&R. Now I plan to execute the g-code, which I read from a file, which is fe located in the Downloads folder. This will be done with fbs from B&R Automation Studio.
I got confused with the help, since it says in drive engineering/mapp Motion/technologie/function block/mpcnc3axis/description the part of moveProgram, where it redirects you to MC_BR_MoveProgram \ description. There stands that you can start the program with [Program name prefix] [File device name:] [Path] Program name syntax. Now I am not sure how to include this with my MpCnc3Axis code or if I can use the syntax also in MpCnc3AxisParType ProgramName part to start the program from fe Downloads Folder, since it didn't work with McPrgAdvParType InitProgramName.
Any links to related material would be appreciated.
I would also accept a solution with C, if it is easier.
Depending on if you are willing to buy software licences from B&R, running a CNC system is more or less easy.
The state of the art implementation is with mappMotion. It requires software licenses and gives you ready to go FUBs to execute nc files, jogging, direct movements, etc. This works the same way for different robot types and CNC kinematics. I recently uploaded a small implementation of a robot on GitLab: https://gitlab.com/kirni/bur_robotic_sample
The alternative is the old ARNC0 approach. No more new features are implemented, but it is free - as long as you do not need any functions that require a Dual Use agreement (i.e. 5 Axis CNC, etc.). The implementation is rather complex and is definitely to extensive to be answered completely at stackoverflow.
However Automation Studio ships with a sample for a two axis CNC. In the logical view you can add a new object Library Samples which opens a dialog where you can select Samples/Motion/CNC system (2 axis)/LibARNC0_Basic_ST.zip. This would be the best starting point, which is also documented in the help in MotionControl/ACP10 ARNC0/Examples/CNC or guid: 4620bb1c-8694-4f27-87d0-805686d7c0c8 as of AS 4.4.4.64.
I hope this helps!

Visualize an embedded neo4j instance in a web browser using default visualization

I am using embedded Neo4j, version 3.0.3. Following this guide, I have created Neo4j/Java code. It creates a database, adds two nodes (one for java, one for scala) and adds a relationship.
package examples;
import java.io.File;
import org.neo4j.graphdb.*;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
public class HelloWorld {
public static void main(String[] args) {
GraphDatabaseFactory dbFactory = new GraphDatabaseFactory();
GraphDatabaseService db = dbFactory.newEmbeddedDatabase(new File("Test_DB"));
try (Transaction tx = db.beginTx()) {
Node javaNode = db.createNode(Tutorials.JAVA);
javaNode.setProperty("TutorialID", "JAVA001");
Node scalaNode = db.createNode(Tutorials.SCALA);
scalaNode.setProperty("TutorialID", "SCALA001");
Relationship relationship = javaNode.createRelationshipTo(scalaNode, TutorialRelationships.JVM_LANGUAGES);
relationship.setProperty("Id", "1234");
tx.success();
}
}
}
enum Tutorials implements Label {
JAVA, SCALA, SQL, NEO4J;
}
enum TutorialRelationships implements RelationshipType {
JVM_LANGUAGES, NON_JVM_LANGUAGES;
}
I program using Eclipse, so all the libraries are imported and I can just click the 'run' button on Eclipse to get the code running, and it seems to work without any issues. Upon running the code, I now have a folder Test_DB in the ~/workspace/project_name/Test_DB directory, where project_name is the name of the overall Eclipse folder. My goal is now to visualize this database in a web browser. The guide I linked to earlier shows an example of this; the user was able to look at the nodes in the web browser (see the bottom of the webpage). Unfortunately, I am using a Linux computer with Firefox, and that tutorial was in Windows, and I can't figure out how to get the visualization.
There have been a few other questions related to this. Unfortunately, some of them (such as this one) propose using software other than the default visualization. I don't own the computer and I have to go through a roundabout process to get external code installed. To be clear what I mean, this link discusses the default Neo4j browser. This is what I would like to see.
This question here directly tackles the same issue, and in fact, it uses the exact same tutorial I used! The answer proposes changing the path in the neo4j-server.properties file. Unfortunately, that file doesn't exist, and upon further analysis, it seems like Neo4j 3.0 changed the configuration naming, which I found out by reading the answer to this similar question. There is now a file conf/neo4j.conf with this information. I entered the following information in the first few lines, keeping the other settings the default:
# The name of the database to mount
dbms.active_database=Test_DB
# Paths of directories in the installation.
dbms.directories.data=/home/username/workspace/project_name/
This does not appear to work. Am I using these settings correctly? When I open the neo4j web browser after running ./bin/neo4j start and click on the database symbol in the left hand side, I see "Name: Test_DB", but it also says there are no nodes and no relationships in the database, and returning a match all query provides nothing. Is it possible for the browser to connect to my database so it can see the nodes (e.g., the two nodes in my Java code above)?
Or is it that I'm not using this code correctly; does the code somehow have to avoid quitting (i.e., replace tx.success() with something else?) to keep the data there?
Sorry about answering my own question, but I finally figured out how to do this! Here's what happens: according to the github change log for 3.0.0.RC-1:
Databases are now stored in a directory called databases under the directory specified in dbms.directories.data
So what we actually have to do is make sure our data base is in the following location:
/home/username/workspace/project_name/databases/
The issue is that when we run it in Eclipse, we get the database in the following folder:
/home/username/workspace/project_name/
Thus, the solution is to make sure the new database folder is preceded by a databases name, i.e., I would change one line to:
GraphDatabaseService db = dbFactory.newEmbeddedDatabase(new File("databases/Test_DB"));

Can't find Lucene.Net.Spatial.Tier namespace with the current version of Lucene.Net

In my search for a geolocation search implementation using lucene.net I encountered this article from leapinggorilla.com and download the source code but have no luck compiling, I added the reference using nugget but still no luck, and if I browse the assembly using object browser, can't find the Namespace either.
Any suggestions to what I am missing?
Thanks
The spatial module in Lucene 3.x was found to be buggy and unmaintained, so it's gone as of Lucene 4.x. Lucene 4.x has a new spatial module that I developed with 2 others. If you download it, you should look at the "SpatialExample.java" in the tests (perhaps there's a .net equivalent). You also might want to watch the presentation I gave at Lucene/Solr Revolution, or simply flip through the slides:
http://www.lucenerevolution.org/2013/Lucene-Solr4-Spatial-Deep-Dive
Lucene.Net is at version 3.0.3 and the 3.x spatial module was dropped from it as well. The 4.x spatial module was backported from java lucene 4.x. You can view the source here and the unit tests here
Unfortunately, that means that most of the older blog posts won't work directly with the new API. However, since most of the API calls should be that same as java's, so I would assume that any blog posts written for java could be translated to .NET.
I have a Lucene.NET 3.0.3 solution which allows spatial search with ordering (from a centre point), within a circle of a given radius.
The answer is here on StackOverflow, and a full VS solution can be found on GitHub.
The key portion of code which drives the spatial search is this:
var spatialArgs = new SpatialArgs(SpatialOperation.Intersects, searchArea);
var spatialQuery = _strategy.MakeQuery(spatialArgs);
var valueSource = _strategy.MakeRecipDistanceValueSource(searchArea);
var valueSourceFilter = new ValueSourceFilter(new QueryWrapperFilter(spatialQuery), valueSource, 0, 1);
var filteredSpatial = new FilteredQuery(query, valueSourceFilter); // Restricts results to searchArea
var spatialRankingQuery = new FunctionQuery(valueSource); // Orders results by distance (closest first)
var bq = new BooleanQuery();
bq.Add(filteredSpatial,Occur.MUST);
bq.Add(spatialRankingQuery,Occur.MUST);
Please let me know if anything is unclear. I urge anyone curious to download and examine the full solution.

Looking for a "headless browser" equivalent for PHP for Cucumber testing

I'm trying to set up some functional/acceptance/integration testing using Cucumber for my PHP project. I'm trying to understand the best approach to implementing these types of tests.
I understand that Selenium can test javascript, but Selenium is slow and I don't always need to test javascript. I'm looking for a "headless browser" equivalent for PHP.
Would either of these be classified as "headless browsers?"
SimpleTest web testing
Zend_Test_PHPUnit_ControllerTestCase
What have you done to implement integration testing of your Zend Framework project?
If you set up Cucumber to use Webrat, you can set up Webrat to use Mechanize by default. Mechanize is essentially a headless browser. This is what my env.rb file looks like:
# RSpec
require 'rspec/expectations'
# Webrat
require 'webrat'
require 'test/unit/assertions'
World(Test::Unit::Assertions)
Webrat.configure do |config|
config.mode = :mechanize
end
World do
session = Webrat::Session.new
session.extend(Webrat::Methods)
session.extend(Webrat::Matchers)
session
end
Also, according to this article, you can set up Cucumber to use Capybara and configure it to use Celerity (a headless browser with javascript support). It also includes instructions on how to configure Capybara to use Selenium RC (which I thought was not possible). I have not attempted this approach yet, so I don't know how well it works.
Why not use behat ( http://behat.org/ ) ?
It should have all the requirements you listed above, and it's written in php.
It has a SahiDrvier to handle "in-browser" testing, and a Simple php browser too.
give a try to Codeception: http://codeception.com
UPDATE:
It's like Capybara , but with a PHP DSL. With codeception you can do something like this:
$I = new WebGuy($scenario);
$I->wantTo('create wiki page');
$I->amOnPage('/');
$I->click('Pages');
$I->click('New');
$I->see('New Page');
$I->fillField('title', 'Hobbit');
$I->fillField('body', 'By Peter Jackson');
$I->click('Save');
$I->see('page created'); // notice generated
$I->see('Hobbit','h1'); // head of page of is our title
$I->seeInCurrentUrl('pages/hobbit');
$I->seeInDatabase('pages', array('title' => 'Hobbit'));
You can use Selenium2 for browsing, or a PHPBrowser (headless) for better performance on js less scenarios (PHPBrowser doesn't execute javascript)
Update: It looks like Akephalos hasn't been updated in a while, so it might not be a good solution for working with a newer version of Capybara.
Use Capybara (a replacement for Webrat) and Akephalos (a headless browser). Capybara is used to interact with Akephalos.
Example support/env.rb:
# Capybara configuration (using Akephalos)
require 'capybara/cucumber'
require 'akephalos'
Capybara.default_driver = :akephalos
Capybara.app_host = 'http://your.web.app'
Capybara.register_driver :akephalos do |app|
# available options:
# :ie6, :ie7, :ie8, :firefox_3, :firefox_3_6
Capybara::Driver::Akephalos.new(app, :browser => :firefox_3_6)
end
If you're using Cucumber, are you not already using Ruby? Why not use celerity or culerity?
I've used Cucumber with Celerity to test a Struts 2 app as well as a ColdFusion 8 app. Basically, you use Celerity and JRuby (which wraps HtmlUnit) or Culerity which runs on native ruby, to drive your browser.
I suggest looking at one of these two projects to help you get started:
Cheesy UI Testing - Corresponding Blog
WatirMelon Page Objects - Corresponding Blog
First of all, you should use Capybara (a replacement for Webrat). It's used to simplify and standardize the DSL used to interact with the browser and provides some nice features.
Even though Selenium is a little slow, it's easy to use to get started since it comes bundled with Capybara. FYI: it defaults to using Firefox.
Example support/env.rb:
require 'capybara/cucumber'
Capybara.app_host = "http://your.app.com"
Capybara.default_driver = :selenium
Now that you're using Capybara, you should use capybara-webkit driver (a truly headless browser which uses Webkit behind the scenes). There's a little bit of setup involved, but once you've done that, the speed is improved from using Selenium.
Example support/env.rb:
require 'capybara/cucumber'
Capybara.app_host = "http://your.app.com"
Capybara.default_driver = :webkit