searching for a Configbuilder - configuration

I am searching for a method to create configuration files.
Something like this: https://cloudconvert.com/api/v2/jobs/builder would be perfect.
One can add a different number of tasks, select the type of the task and then setup fields with configuration values. (Of course, the fields (mandatory, conditional, and so on) per task are preConfigured.
I have no idea how such a "thing" is called nor how to search for it.
I would love any hint.
Result in Json would be OK

Related

Multiple models in Database from a Single DBT model

I am thinking to publish two models in the database from one model in DBT. One model is going to be with filter and the other one is going to be without filter. Have you ever created such a model like this with some jinjas? It would be so helpful if you can share with me some examples or resources please.
I would not create two models as they are the same models only the filter is applied as a difference. So the idea is to keep one sql file and publish two models with different names into the database.
I look forward to hear some suggestions from you.
Many thanks!
Short answer is you cannot do this with a single model, but there are lots of good alternatives. See this question for a discussion about why you can't produce multiple assets from a single dbt model.
In this instance, since you're just applying a filter, I would just create two models, with one selecting from the other. This is a bread-and-butter use case of dbt's DAG.
unfiltered.sql
select
-- your logic goes here
...
filtered.sql
select *
from {{ ref('unfiltered') }}
where
-- your filter goes here
...
If that doesn't work, and the models share a lot of logic, but not all of it, I would wrap the common bits in a macro, and then invoke the macro in both unfiltered.sql and filtered.sql (as in the other answer I linked to).
Thank you very much for giving the idea.
I have also another solution actually and kindly would like to share it with you.
Create the table without filter
Post hook clone the created table
Delete from cloned table where the filter applied.
post_hook helps a lot to make it happen.
So basically the post_hook is going to be like this:
{{ config(
materialized='table',
post_hook= [ "create or replace table table_filtered clone {{this}}",
"delete from table_filtered where 1=1 and filter=true" ]
) }}
By cloning the table, we can keep the descriptions at both column and table level.

LUIS to MySQL query - Azure Chatbot

How to generate MySQL Querys with LUIS and fetch data from the DB hosted in Azure?
Should generate a natural language query to an MySQL Query.
e.g.
How much beer was drunken on the oktoberfest 2018?
--> GET amountOfBeer FROM Oktoberfest WHERE Year ==2018;
Does anyone has an idea how to get this to work?
Already generated small Intents in LUIS e.g. GetAmountOfBeer
Dont know how to generate the MySQL Statements and how to get the data from the DB.
Thanks.
You should be able to achieve this, or something similar, using intents and entities. How successful this can be depends on how many and how diverse your queries need to be. First lets start with the phrase you mentioned: "How much beer was drunken on the oktoberfest 2018". You can easily (as you've done) add this as an utterance for an intent, GetAmountOfBeer. Though I'm a fan of intent names that you can read as "I want to GetAmountOfBeer", here you may want to name the intent amountOfBeer so you can use it in your query directly.
Next you need to set up you entities. For year (or datetime rather) that should be easy, as I believe there are some predefined entities for this. I think you need to use a datetime recognizer to parse out the right attribute (like year), but I haven't tried to do this before. Next, Oktoberfest seems to be a specific holiday or event in your DB, so you could create a list entity of all the events you have.
What you are left with is something like (pseudocode) GET topIntent FROM eventEntity WHERE Year ==datetime.Year, or something like that.
If your query set is more complex, you might have to have multiple GET statements, but you could put those in a switch statement by topIntent so that, no matter what the intent is, you can parse out the correct values. You also might want to build this into a dialog where you can check if the entities exist, and if not, you can prompt the user for the missing data.

Database design for keeping track of experiment data

I am designing a database to record experiment results. Basically, an experiment has several input parameters and an output response. Therefore, the data table will look like following:
run_id parameter_1 parameter_2 ... parameter_n response
1 ... ... ... ...
2 ... ... ... ...
.
.
.
However, the structure of this table is not determinant since different experiments have different number of columns. Then the question is: when a user instantiate an experiment, is it a good idea to create data table dynamically on the fly? Otherwise, what is the elegant solution for that? Thanks.
When I find myself trying to dynamically create tables during runtime, it usually means I need another table to resolve a relationship between entities. In short, I would recommend treating your input parameters as a separate entity and store them in a separate table.
It sounds like your entities are:
experiment
runs of an experiment, which consist of a response and one or more:
input parameters
The relationships between entities is:
One experiment to zero or more runs
One run to one or more input parameter values (one to many)
This last relationship will require an additional table to resolve. You can have a separate table that stores your input parameters, and associate the input parameters with a run_id. This table could look like:
run_parameter_id ... run_id_fk ... parameter_keyword ... parameter_value
Where run_id_fk is a foreign key to the appropriate row in the Runs table (described in your question). The parameter_keyword is just used to keep track of the name of the parameter (parameter_1_exp1, parameter_2_exp1, etc).
Your queries to read/write from the database now become a bit more complicated (needing a join), but no longer reliant on creating tables on the fly.
Let me know if this is unclear and I can provide a potential database diagram.

NSIndexPath save to another entity

I am almost done researching for my application. The last thing that I need to be able to learn how to do is the following situation: Let's say I have created a UItableview drilldown app, but once the user gets to the end of that drill down (their choices on a specific dog product for instance are now very specific), they can save that information. What I want my app to do here is, at the end of the drilldown, save their entire nsindexpath as another entity so that I can send this information later up to my MySQL database. My question is, how could I re-save an nsstring from an nsindexpath in another entity?
Start writing code instead of researching your entire app's architecture before you start it. You really only will learn from actually programming.
Use Core Data
Use tableView:didSelectRowAtIndexPath: to obtain the selected tableview cell's indexPath and store the indexPath or the data as needed.
I agree with runmads suggestions. CoreData will probably make your life easier in the long run. To answer your question though:
Don't save the table view's NSIndexPath. The selection index path is a view related property (in MVC terms). Your users choice belongs to the model domain. It's bad practice to mix the two and if you later insert new choices in one of your tables, your stored index paths will become invalid.
Instead create something like a UserChoice object or a dictionary or an array which you can pass down your tableview controllers as the user drills down. When the user selects a cell, add the primary key of the associated data object to your array. At the end, store the primary keys you've collected along the way into your database.

mysql: most efficient method to store parameters with unknown type (string/int) to the db

I have a messaging system that contains default templates. for example:
you won X coins
friend X wants to share the url Y with you
so the number of parameters varies in each message/template type.
I thought of 4 types of solutions to resolve the issue:
creating a parameters table and represent each parameter type as a string.
the problem here that user_ids will be represented as strings so probably joins will be slower. e
creating a parameters table that each row contains the following a boolean that tells if the parameter is an int or a string, and 2 other columns one type text and the other type INT. so here we're kind of wasting space because whenever we use an int parameter the row contains an unused string cell.
not to create a parameters table at all, each notification contains a parameters string that contains each needed parameter with a seperator ;. this one may be the slowest solution.
creating two different tables for each time of parameters: notification_param_int and notification_param_string and a table that contains each parameter in the notification to the relevant table. this solution may be slower then solution 2 because i need to check from which table to fetch the information first.
are there any other options I did not think about ?
if I don't care about space, only about speed, which method should I take ?
I'm not a MySQL expert so the conclusion of each method may be wrong.
Any information would be greatly appreciated.
thanks you!
Often, when having a open-ended property table as you describe, you'll discover that some of the properties are more important (either they need to always be there, or they need to be fast). In that case, promote those to fields in the main record.
I could imagine UID being that. It would be a problem later if you needed to have a list of UID (friends), but then you could also promote friends to its own table.
In your case, I'd just opt for #1 or #2 and think about promoting important properties if the need arises.