How do I generate SQL code for a SQLite3 database somehow dynamically with something like a template engine? I'm new to this and I'm using jinja2 to generate HTML. Could jinja2 possibly be used for such a purpose as well, if so, is that a good idea? I would like my program to save all the data (attribute values of instances of various classes) before it stops running.
check out https://pypi.python.org/pypi/jinjasql/0.1.6
it seems to basically just apply jinja2 to SQL templates. I haven't played with it much yet but was just asking the same question and came upon this.
Related
I have recently made the jump from developing using the Django framework to vue.js. One thing I am having a hard time wrapping my head around is the workflow for adding translations.
In Django, my workflow felt very intuitive:
Annotate my code with translation hooks.
Pull out the translation hooks into a .po (gettext) file
Translate the messages into the desired locale, i.e. do work in the .po file
Compile the .po file
In the context where all of my work needs to be translated, this workflow was very convenient and fool-proof.
I am excited about the move over to vue.js but I am afraid the difference in translation workflow might be a deal-breaker. Or perhaps, there is something I am missing? Here is my understanding of the vue.js/i18n workflow
Annotate my code with translation hooks. Unlike the Django process, I am using a Translation ID to link messages and translations.
Manually add those translation ids to a JSON file, e.g. en.json
Mirror that json file to that of a different locale, e.g., fr.json
I understand that I can use a tool like BabelEdit to manage the last step. While this seems like a great tool, it is the second step that I am really having a hard time getting my head around. Without a function like the django-admin/gettext makemessages this seems like it would be a tedious and inefficient task.
What am I getting wrong here? I imagine I am not the only one with these needs, so what are the translation workflows that are working for others developing with vue.js?
Thanks in advance.
I believe that you can use https://github.com/pixari/vue-i18n-extract on step 2. I think that BabelEdit can only help if you keep your translations as <i18n> section in your Vue components (in which case you will need https://github.com/intlify/vue-i18n-loader)
I've created a program with FM: TR_TADIR_POPUP_ENTRY_E071. I am trying to generate at the same time text-symbols for this program.
Any ideas how to do that?
I think there's no standard interface for that. Check the ABAP statement INSERT TEXTPOOL. Documentation is placed here.
Before anything I recommend you to manually create a local program with text-symbols and in another program read the texts with READ TEXTPOOL command to see what's the data structure. In that way you can build up the input data.
SAPLINK uses this technique also.
I have used dossier to generate reports in my application. Now I want to visually design my reports generated by dossier like charts. Is there any gem available to do that? Can you please any one help me (or) tell me to how to use iReport in rails application.
Dossier currently does not provide any visualizations (though that would be a nice enhancement). I have been using to to power various JS charting libraries using JSON. Any report can be converted to JSON format by adding a ".json" extension to the report url. Generally I have found that I will have to alter the way I write the sequel selects slightly to get the right JSON output, but overall have had good success with this strategy.
Let me know if I can answer any other questions on this.
Thanks!
Hello I was trying to learn db2 sql and I was having some problems.
I want to bind a package, but I don't have any packages to bind.
So when I try to create a package it obviously gives me an error. I know that a package is created when we create a database. But then why doesn't it list any packages when i do
db2 list packages
I have seen a lot of links but no help. I would really appreciate if someone actually explained it to me.
Thank you very much
In order to understand a package, you first need to understand dynamic and static queries.
Dynamic queries are created at execution time. Everything from PHP, Perl, Python, Ruby or Java (JDBC) are Dynamic queries. For example, when using Java, you get a Prepared statement, and you assign values (setXXX) to the parameter markers (?).
However, there are other programming languages, such as C, Java (sqlj), cobol, where you create the program, with embedded SQL. For example, when using SQLj, you write a class in a .sql file, and the queries are written in specific tags (not java, but started with #sql { }), then you do a precompilation, that is a process where the SQL are taken out from the code, and translated to natural programming language (ie. from sqlj to Java). The SQL in then inserted into a file that is called a bind file. Once you have that, you need to compile the code (javac to create the .class) and bind the file in the database. In this last step is where the packages are created.
A package is a set of data access plans. However, they were calculated at the bind time, not at the execution time, like in the dynamic queries. They are difference between them.
Finally, in order to create a package, you need to change the bind properties, and eventually the bind file itself.
My app currently reads a script containing instructions on what the app should do next. Think of it this way ---> My app is like an orchestra, and when it is passed sheet music (the script), it knows what to do. The sheet defines what different parts of the orchestra do at different times.
Currently, writing the script by hand is tedious. I want to be able to define chunks, which I can drag and drop from my gui to the script. I was wondering if there already is tools which let you do something like this, or if I should write my own tool.
Basically, when I click on something in the gui, it should insert a template into my plist, which I can tweak.
EDIT: It looks like the ability to create "Property list Structure Definitions" is what I am after. I have tried searching the apple site, but I can't find any documentation.
Two things come to mind:
You don't mention what format the input is in, nor what you want the GUI tool to do beyond letting you "drag chunks". But if you can define your format into an XML schema, then you can use any number of XML authoring tools that customize their interface based on schema. Also gives you the ability to make it easy to let the UI enter parameters/customization, which your script language likely has. Final bonus: you might be able to convert script directly into a plist with a simple XSLT file.
Check out Briefs, which is a prototyping application for iOS apps that has a similar architecture.