Can't find Lucene.Net.Spatial.Tier namespace with the current version of Lucene.Net - 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.

Related

There is a way to use lsp4e for calling language server methods directly?

I'm new to the lsp4e & lsp technologies and as far as I have seen the framework provides almost everything for working with eclipse. However there is a way to use this features at will? i.e I would like to use the LS to get all the functions on a file, I think this will be done with textDocument/documentSymbol but how can I get this using the lsp4e framework?
NOTE:
I checked for SymbolKind and seems it was not the one I was looking for however that input helped me finding a sample of DocumentSymbol
DocumentSymbolParams params = new DocumentSymbolParams(
new TextDocumentIdentifier(documentUri.toString()));
CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols =
languageServer.getTextDocumentService().documentSymbol(params);
I checked for SymbolKind and seems it was not the one I was looking for. However that input helped me finding a sample of DocumentSymbol
DocumentSymbolParams params = new DocumentSymbolParams(
new TextDocumentIdentifier(documentUri.toString()));
CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols =
languageServer.getTextDocumentService().documentSymbol(params);

Make tile-ID request URL work with mapbox-style "satellite-streets" using folium

I use Python for plotting geospatial data on maps.
For certain map-styles, such as ["basic", "streets", "outdoors", "light", "dark", "satellite", "satellite-streets"], I need a mapbox-access token and for some geospatial plotting packages like folium I even need to create my own link for retrieving the map-tiles.
So far, it worked great with the style "satellite":
mapbox_style = "satellite"
mapbox_access_token = "....blabla"
request_link = f"https://api.mapbox.com/v4/mapbox.{mapbox_style}/{{z}}/{{x}}/{{y}}#2x.jpg90?access_token={mapbox_access_token}"
However, when choosing "satellite-streets" as mapbox-tile-ID, the output doesn't show a background map anymore. It fails with inserting "satellite-streets", "satellitestreets" and "satellite_streets" into the aforementioned link-string.
Why is that and how can I come to know what's the correct tile-ID-name for "satellite-streets"?
I found an answer when reaching out to the customer support.
Apparently, one has to access the static APIs which have specific names listed on their website:
"In general, the styles that you mentioned including
"satellite_streets" that you are referencing are our classic styles
that are going to be deprecated starting June 1st. I would recommend
using our modern static API the equivalent modern styles. This
will allow you to see the most updated street data as well.
Like the example request below:
https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/1/1/0?access_token={your_token}
Here is more info on the deprecation of the classic styles and
the migration guide for them."
My personal adaptation after having tried everything out myself, is:
Via combining the above-mentioned with the details on how to construct a Mapbox-request link on this documention from mapbox' website,
I finally managed to make it work.
An example request looks like so (in python using f-strings):
mapbox_tile_URL = f"https://api.mapbox.com/styles/v1/mapbox/{tileset_ID_str}/tiles/{tilesize_pixels}/{{z}}/{{x}}/{{y}}#2x?access_token={mapbox_access_token}"
The tileset_ID_str could be e.g. "satellite-streets-v11" which can be seen at the following link containing valid static maps.

Updating Jira Plugin from Version 3 to Version 4, Replacing SearchParameter

i am pretty new to Jira Development so please be patient
I should upgrade a Plugin that worked with Jira Version 3 to work with Jira Version 4
Most of the thins went pretty well, but now i am kind of stuck
The SearchParameter and the ProjectParameter Class are not available in the new Version and i dont exacly know how to replace them. its really just this few lines of code, where its needed
these Classes are outdated: SearchParameter and ProjectParameter
i looked in the jira doc buts its seems pretty complicated, you would do me a great favor if you could help me
SearchRequest sr = srs.getFilter(ctx, filterId);
...
SearchParameter param = sr.getParam(new ProjectParameter().getName());
...
List columns = columnLayout
.getVisibleColumnLayoutItems(user,
param.getValues(), Collections.EMPTY_LIST);
It would even Help if you could explain what the seccond Line intends
Thanks in advance
I can't help you rewrite the plugin entirely, but I can try help you decipher what those quoted lines of code mean:
SearchRequest sr = srs.getFilter(ctx, filterId);
This line loads a saved SearchRequest with the corresponding filterId.
SearchParameter param = sr.getParam(new ProjectParameter().getName());
This line gets the Project search parameter that was saved in the SearchRequest. As you may know, SearchRequests (or saved filters if you prefer) all you to save a search from JIRA with parameters defined. One possible parameter to define is a ProjectParameter. So if your search is "all issues in project X", then you would have a SearchParameter in your SearchRequest which is a ProjectParameter that knows to search for project X.
List columns = columnLayout
.getVisibleColumnLayoutItems(user,
param.getValues(), Collections.EMPTY_LIST);
This line retrieves the ColumnLayoutItems which are visible to the specified user, for the specified projects of the SearchRequest (by extracting the value from the ProjectParameter of the SearchRequest as retrieved in line 2).
It's a bit unclear what this code is attempting to do without more context, but that's what those lines are doing anyway. You might find the API documentation useful:
http://docs.atlassian.com/jira/3.13/
http://docs.atlassian.com/jira/3.13/com/atlassian/jira/issue/fields/layout/column/ColumnLayout.html

what the best NoSQL solution for windows server?

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.

Enterprise Library 4: logging block flat file

I am having problem creating log entry to a text file. Here is my logging configuration in my ASP.net app.
and here is my vb.net code
Try
db.ExecuteNonQuery(cmd, tr)
tr.Commit()
result = True
Catch ex As Exception
Dim entry As New LogEntry()
entry.EventId = 11
entry.Message = ex.Message
entry.Categories.Add("General")
Logger.Write(entry)
tr.Rollback()
End Try
All the tutorial and example that i found so far are based on older version of Enterprise Library. I'm using Enterprise Library 4. Does anyone know what i'm doing wrong? Is it my code or the configuration? Where can i find more tutorial on Enterprise Library version 4. I tried to follow the quick start that it come with but i can't make head or tail.
its a basic tutorial on using enterprise library 4.1
http://blog.accentient.com/EnterpriseLibraryLogging101.aspx
btw, to get mine to work, i had to change all the PublicKeyToken's to = null
otherwise the web.config didnt validate, gl