Tutorial by Examples: ar

from chempy import Substance ferricyanide = Substance.from_formula('Fe(CN)6-3') ferricyanide.composition == {0: -3, 26: 1, 6: 6, 7: 6} True print(ferricyanide.unicode_name) Fe(CN)₆³⁻ print(ferricyanide.latex_name + ", " + ferricyanide.html_name) Fe(CN)_{6}^{3-}, Fe(CN)<sub>6&...
from chempy import ReactionSystem # The rate constants below are arbitrary rsys = ReactionSystem.from_string("""2 Fe+2 + H2O2 -> 2 Fe+3 + 2 OH-; 42 2 Fe+3 + H2O2 -> 2 Fe+2 + O2 + 2 H+; 17 H+ + OH- -> H2O; 1e10 H2O -> H+ + OH-; 1e-4 Fe+3 + 2 H2O -...
It's often convenient to separate the SQL query from the actual values. This can be done using placeholders. Qt supports two placeholder syntaxes: named binding and positional binding. named binding: QSqlQuery query; query.prepare("INSERT INTO employee (id, name, salary) VALUES (:id, :name,...
import shelve d = shelve.open(filename) # open -- file may get suffix added by low-level # library d[key] = data # store data at key (overwrites old data if # using an existing key) data = d[key] # retrieve a C...
Essence of searching lies in its order. Everyone wants search results to be shown in such a way that best suited results are shown on top. Relational database do not have such capability. Elasticsearch on the other hand shows results on the basis of relevancy by default. Setup Same as used in ...
Searches can also be done on elasticsearch using a search DSL.The query element within the search request body allows to define a query using the Query DSL. GET /my_index/type/_search { "query" : { "term" : { "field_to_search" : "search_item" }...
Flow is a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making you code faster, smarter, more confidently, and to a bigger scale. Flow checks your code for errors through static type annotations. These types allow you to tell Flow how you want your...
Add tastypie to INSTALLED_APPS. Create an api directory in your app with a bare init.py. Create an <my_app>/api/resources.py file and place the following in it: from tastypie.resources import ModelResource from my_app.models import MyModel class MyModelResource(ModelResource): ...
Tastypie is a reusable app (that is, it relies only on its own code and focuses on providing just a REST-style API) and is suitable for providing an API to any application without having to modify the sources of that app. Not everyone’s needs are the same, so Tastypie goes out of its way to provide...
This is an example of a basic GUI with two buttons that change a value stored in the GUI's handles structure. function gui_passing_data() % A basic GUI with two buttons to show a simple use of the 'handles' % structure in GUI building % Create a new figure. f = figure(); ...
While using scrollviews in storyboard it's better to calculate content size according to number of views present in scrollview rather than giving content size programatically with static value. Here are the steps to get content size dynamically. Step 1 : Add Scrollview to view in storyboard and ...
It's highly recommended to use ESLint in your project on react-native. ESLint is a tool for code validation using specific rules provided by community. For react-native you can use rulesets for javascript, react and react-native. Common ESLint rules with motivation and explanations for javascript ...
Gpars offers intuitive ways to handle tasks concurrently import groovyx.gpars.* GParsPool.withPool { def result = dataList.collectParallel { processItem(it) } }
In practice, shiny Apps are often very complicated and full of features that have been developed over time. More often than not, those additional details are not necessary to reproduce your issue. It is best if you skip such details when writing MCVE's. WRONG Why is my plot not showing? libra...
Here is an example of image pulling using Go and Docker Engine API and the same progress bars as the ones shown when you run docker pull your_image_name in the CLI. For the purposes of the progress bars are used some ANSI codes. package yourpackage import ( "context" "en...
The multi_search option allows us to search for a query in multiple fields at once. GET /_search { "query": { "multi_match" : { "query": "text to search", "fields": [ "field_1", "field_2" ] } }...
@Controller public class EditPetForm { @RequestMapping("/pets") public String setupForm(@RequestParam("petId") int petId, ModelMap model) { Pet pet = this.clinic.loadPet(petId); model.addAttribute("pet", pet); return "petForm...
Write message in messages.properties welcome.message=Hello, {0}! Replace {0} with the user name inside thymeleaf tag <h3 th:text="#{welcome.message(${some.variable})}">Hello, Placeholder</h3>
Get year from date <p> Year: <span th:text="${#dates.year(today)}">2017</span> </p> Get month <p> Month number: <span th:text="${#dates.month(today)}">8</span> Month: <span th:text="${#dates.monthName(today)}"&...

Page 211 of 218