How to use dapper.fluentmap in Dapper? - dapper

Does anyone know or have link in how to use https://github.com/henkmollema/Dapper-FluentMap in my Dapper CRUD?. Right now I am using Dapper.Contrib but we are trying to implement Clean architecture which we remove the Dapper.Contrib in our structure. Now I am trying to use this Dapper-FluentMap to map the properties but there documentation is very poor.

I've wrote an article and a sample that shows how to use Dapper-FluentMap:
https://medium.com/dapper-net/custom-columns-mapping-1cd45dfd51d6

After beating my head against a few brick walls, I have established this much as fact (at least as of late 2018, which is after the date of the OP)...
Answering the question "Is FluentMap supposed to work with Dapper.Contrib extensions?", henkmollema (author of Dapper.FluentMap) responds, "Nope, it does not work with Dapper.Contrib".
So there's your answer, user3928241.
However for me as well as for user3928241 and others desperately searching for answers, he adds, "Shameless plug: it does work together with Dommel using the Dapper.FluentMap.Dommel integration component."
YMMV, but I'm pressing on. Going to try Dommel now.

Related

How to build an AI Chatbot from scratch using NLTK?

I'm building an AI-based Q&A chatbot. What are the precise steps? How should I start working on it as I'm new to Python as well as AI.
(Note:- Using Python and building a generative chatbot is mandatory as it's an assignment)
Chatbots, well at least the ones worth naming chatbots, are quite intricate. There are lots of teams out there working every day to make one. But, the good news is that the word "intelligent" doesn't have an exact definition and something simple will probably suffice for you.
You can use an exact matching method which will let you down the first time you give it a chance. You can compare the set of words in existing questions and the one you receive, which is a little bit better. But, If you still feel you want to push it further, read this:
How to Create a Simple JARVIS — Chatbots are Coming
I hope that helps.

Jump-Point searching in detail

I have been trying to implement jump-point search to my already implemented A* pathfinding code, but I don't fully understand how it works. The website here (which is all that I could find on it) doesn't really explain much about how to prune or how to determine a jump-point successor. Could anyone explain these two things in detail?
The technical details are in the research paper, which can be found on Alban Grastien's web page.
There is also a tutorial on aigamedev.com.
It appears that an improved paper will appear at ICAPS 2014, but I don't believe the papers are online yet.
If these resources are insufficient, a more directed question (what don't you understand) will be easier to answer. But, one thing important to note is that JPS scans the state space looking for obstacles. In doing so it may look at far more states than A* does. But, its time savings come from not putting most states in the OPEN list.
In addition to the original 2011 paper, I also found this site: https://zerowidth.com/2013/a-visual-explanation-of-jump-point-search.html particularly helpful, as it explains how JPS works in simple terms with diagrams, and also includes a grid where you can add/remove obstacles and visualize how JPS finds and expands jump points.

Database moddelling - Trying to understand

Hey guys, I always get confused by this so it's not exactly my strong point :( Am I understanding correctly that the above example suggests:
One shop must have one or more clients
One client must have one shop
If there was to be a circle where at the end of the client arrow it suggests that the shop has zero or many clients.
I know it's a bad example but I am just trying to get my head around it. (Always get it the wrong way round)
Thanks very much, all help appreciated.
it's just a quick example so I apologise for the bad naming convention of table names
Yes, you are understanding correctly.

How to perform Geo Spatial search with django-haystack + solr

I'm currently using django haystack with xapian. I couldn't find any documentation on how to perform geospatial queries on xapian. But there seems to be some momentum on Solr. So i'm currently experimenting with that.
I couldn't get spatialSolr to work properly on local, but for now working with spatial-solr-light, which seems to work fine. It accepts queries like
http://127.0.0.1:8080/solr/select/?q=blahblah&spatial={!radius=1.0%20sort=true}lat:10.0,lng:-10.0
Can anyony point me to a patch for haystack that allows me to pass custom queries like that. I could use raw_search(), but i can't chain the resuts. In any case i would like to find a cleaner way to do something like
sqs.spatial(....)
There are some patches from other people mentioned on the google group(links below), but most of them are unreachable.
References:
https://github.com/fizx/solr-spatial-light
http://groups.google.com/group/django-haystack/browse_thread/thread/d0e23d45c0baa300/2298b6cf43389e18?lnk=gst&q=Spatial#2298b6cf43389e18
http://groups.google.com/group/django-haystack/browse_thread/thread/f88d625679941d77/420892adac151a64
http://groups.google.com/group/django-haystack/browse_thread/thread/e3a70112ce944b00/33bd673fbaaed0a7?lnk=gst&q=jteam#33bd673fbaaed0a7
If you're not tied to Xapian, look at Django, Sphinx and search by distance. I had a similar problem when I ran across this question and this seems to solve it. Thanks to django-sphinx, it's about as easy to set up as Haystack. Sphinx also seems to offer more flexibility.
Here's a fork of django haystack that adds in support for :
https://github.com/sidmitra/django-haystack-spatialsolrplugin
And corresponding notes are here:
https://github.com/sidmitra/django-haystack-spatialsolrplugin/wiki/_pages
Sidmitra, I made port of your solution using haystack 1.2.X and solr 3.4. With some limitations to be frank - no support for schema generation at the moment, only LatLong geo type supported, sorting by distance is not perfect (but works)
https://github.com/frutik/django-haystack/tree/1.2.X
I agree with https://github.com/sidmitra/django-haystack-spatialsolrplugin .
It seems to be out-of-date, but I could beat it into shape with some work. Issues I had:
Hard to find the java SSP and when I found it it was the wrong version. http://www.dutchworks.nl/en/home/download.html was the link that worked for me.
The classpaths in the example xml files I found on the net were all wrong; I had to remove .solrext. from all of them.
The plugin was very picky about which directory it lived in; it couldn't talk to anything else until it was happily in solr/lib
solr_backend.py required the following patch (around line 505):
if self.spatial_query:
final_query = '{{!spatial circles={lat},{long},{radius} }}{0}'.format(final_query,**self.spatial_query)
I had further issues with making the solrconfig.xml so that GeoDistanceComponent never loaded before the query had a valid rsp.
In other words, you can certainly make it work, but you have to be able to deal with a number of error messages in both python and java before you get there.

Does anyone here use the make-cdf & stats.pl program?

I came across this page: Plotting Tools
where I found a set of tools with the name stats.pl and make-cdf. I can write my own but don't want to spend too much time when someone else has already done that. Does anyone have these tools or at least point me to a similar set of tools somewhere?
I do not know who Dave, Binju, Vijay and Dan are and I did not see a way of figuring out what stats.pl and make-cdf contain.
There are a number of excellent statistics related modules on CPAN including Statistics::Descriptive, Statistics::KernelEstimation and Math::GSL::CDF to name but a few that might be relevant given the names of the scripts you mention.
However, if you want to do serious statistics, I would recommend you consider using R which you can control using Statistics::R. AFAIK, the R tag on StackOverflow is pretty active.

Resources