Categories
Mastering Development

ElasticSearch NEST: Match and Terms query inside QueryContainer

I’ve been using AzureSearch so far and I’m very new to ElasticSearch. Still exploring in this vast ocean. I would like to know, how to use multiple queries (MatchQuery and TermsQuery) inside a QueryContainer. This is my code: private static QueryContainer CreateQueryUsingFilters( string searchTerm, List<string> searchFields, Dictionary<string, string> filters, ExpressionOperand operand) { QueryContainer queryContainer = […]

Categories
Mastering Development

Extending Kaldi Aspire: bad variable error while Recompiling HCLG.fst using new lexicon and grammar files

I have successfully setup and run the Kaldi Aspire recipe on my WSL. Now i was working on a POC where i want to extend the ASPIRE recipe by making a new corpus, dictionary, language model and merge it with the original HCLG.fst. I followed this blog post. I have been able to sucessfully create […]

Categories
Mastering Development

Word2Vec with ConvNetSharp

I have been trying to implement word2vec using ConvNetSharp. I was able to produce a basic version of the algorithm using Relu on a hidden layer but it is not very accurate and I would like to implement a more faithful (and accurate) version of the algorithm using the ConvNetSharp flow API. Any help much […]

Categories
Mastering Development

C# Iterate over nested Dictionary

I try to iterate through following nested Dictionary instance: Dictionary<String, Dictionary<Datetime, int>> nestedDictionary = new Dictionary<String, Dictionary<Datetime, int>>() Goal is to iterate through all integers in Dictionary. To iterate over Dictionary instance i use nested foreach loop and shown below: foreach(String key1 in nestedDictionary.Keys) { foreach(int targetValue in nestedDictionary[key1].Values) { // … } } This […]

Categories
Artificial Intelligence (AI) Development

I try to get the optimal number of topics in my corpus with LDA model but return to me a runtime error, how can I fix it?

I have an runtime error: RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == […]

Categories
Development

Should I dispose local class variables?

I have a legacy application where I am getting OutOfMemory exception time to time. I am trying to debug and fix the issue. One of the option I am thinking is to use the Dispose() method. I know that any object implementing the IDisposable interface will let me call the Dispose() method on it but […]

Categories
Development

C# Memory Concerns

I work with cellular automata. The basic structure is 1) A grid of 2) cells, which may have 3) agents. The agents act according to a set of rules, and typically one designates “states” for the agents (agents of different states have different rules). One (relatively) well-known CA is the game of life. I’m trying […]

Categories
Development

Find how to load the user cross domain as UserPrincipal.FindByIdentity method does not work cross domain

The UserPrincipal.FindByIdentity(…) method does not work cross domain. the users outside of the domain the SingleSignOn app pool is running as are not being signed in automatically. When trying to access the SingleSignOn page as one of those users, it presents a NullReferenceException error public void LoadUserAuthInfo(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo) { if […]

Categories
Development

How to convert the c++ function to CUDA kernel function

Given a model matrix D ∈ R N×M the measurements are given by: y=Dx where size of y and x is N x P and M x P. To calculate the x, orthogonal matching pursuit (OMP) is used. The flow of code is First, extract the column vectors (N x 1) from y (N x […]

Categories
Development

Recursive regex in data types and arguments

I’m attempting to get some words from the following word’s group with Regex. InArgument(njl:JObject) InArgument(x:String) OutArgument(scg:List(x:String)) OutArgument(scg:List(x:String)) InArgument(scg:Dictionary(x:String, sd:DataTable)) InArgument(scg:ICollection(x:Boolean)) InArgument(scg:IEnumerable(x:Object)) Regex: (In|Out|InOut)Argument\(.*:(.*)\) It works fine for the first and second line, but not with List, Dictionary, ICollection and IEnumerable. I need group separation because the captured data will be used to make documentation. Thank […]