Tutorial by Examples: n

The easiest and recommended way to install SymPy is to install Anaconda. If you already have Anaconda or Miniconda installed, you can install the latest version with conda: conda install sympy Another way of installing SymPy is using pip: pip install sympy Note that this might require root ...
from django.contrib.auth.models import User from rest_framework import authentication from rest_framework import exceptions This example authentication is straight from the official docs here. class ExampleAuthentication(BaseAuthentication): def authenticate(self, request): usernam...
This is a snippet of master report. Two parameters and the connection (for example, jdbc) are passing to the subreport. One value is returned from the subreport back to the master report, this value (variable) can be used in master report <subreport> <reportElement x="0" y=&...
This is a snippet of master report. The datasource is passed to the subreport with help of net.sf.jasperreports.engine.data.JRBeanCollectionDataSource constructor <field name="someFieldWithList" class="java.util.List"/> <!-- ...... --> <subreport> <r...
The JasperReports-plugin by Alex Nederlof is a good alternative of abandoned org.codehaus.mojo:jasperreports-maven-plugin plugin. The adding of plugin is a typical, simple procedure: <build> <plugins> <plugin> <groupId>com.alexnederlof</groupId...
The CLOS MOP provides the hook slot-value-using-class, that is called when a slot is value is accessed, read or modified. Because we only care for modifications in this case we define a method for (setf slot-value-using-class). (defclass document () ((id :reader id :documentation "A hash co...
Classification in Machine Learning is the problem that identifies to which set of categories does a new observation belong. Classification falls under the category of Supervised Machine Learning. Any algorithm that implements classification is known as classifier The classifiers supported in P...
In classification using PHP-ML we assigned labels to new observation. Regression is almost the same with difference being that the output value is not a class label but a continuous value. It is widely used for predictions and forecasting. PHP-ML supports the following regression algorithms Suppo...
This topic explains the concept of an object reference; it is targeted at people who are new to programming in Java. You should already be familiar with some terms and meanings: class definition, main method, object instance, and the calling of methods "on" an object, and passing parameter...
Every custom loader must directly or indirectly extend the java.lang.ClassLoader class. The main extension points are the following methods: findClass(String) - overload this method if your classloader follows the standard delegation model for class loading. loadClass(String, boolean) - overloa...
Clustering is about grouping similar objects together. It is widely used for pattern recognition. Clustering comes under unsupervised machine learning, therefore there is no training needed. PHP-ML has support for the following clustering algorithms k-Means dbscan k-Means k-Means separates ...
The Java language allows you to use new to create instances Integer, Boolean and so on, but it is generally a bad idea. It is better to either use autoboxing (Java 5 and later) or the valueOf method. Integer i1 = new Integer(1); // BAD Integer i2 = 2; // BEST (autoboxing)...
Using new String(String) to duplicate a string is inefficient and almost always unnecessary. String objects are immutable, so there is no need to copy them to protect against changes. In some older versions of Java, String objects can share backing arrays with other String objects. In those ver...
We're all used to the while syntax, that executes its body while the condition is evaluated to true. What if we want to implement an until loop, that executes a loop until the condition is evaluated to true? In Julia, we can do this by creating a @until macro, that stops to execute its body when th...
A statement is constructed with a function such as sqlite3_prepare_v2(). A prepared statement object must be cleaned up with sqlite3_finalize(). Do not forget this in case of an error. If parameters are used, set their values with the sqlite3_bind_xxx() functions. The actual execution happens whe...
A SELECT query is executed like any other statement. To read the returned data, call sqlite3_step() in a loop. It returns: SQLITE_ROW: if the data for the next row is available, or SQLITE_DONE: if there are no more rows, or any error code. If a query does not return any rows, the very first...
Once we have Odoo installed, we need to create a server instance. A server instance is an Odoo service listening on a specific port, 8060, by default, and using a database to store data. The minimal command to start an Odoo instance using the mydb database: $ ./odoo.py -d mydb If the database ...
gnu-cobol is available via the homebrew system. Open a terminal window from /Applications/Utilities/Terminal or use the keypress Command+Space and type "Terminal". If you do not have the homebrew system installed, add it by typing, or copying and pasting into your terminal: ruby -e &quo...
PHP has built in function pcntl_fork for creating child process. pcntl_fork is same as fork in unix. It does not take in any parameters and returns integer which can be used to differentiate between parent and child process. Consider the following code for explanation <?php // $pid is the P...
Interprocess communication allows programmers to communicate between different processes. For example let us consider we need to write an PHP application that can run bash commands and print the output. We will be using proc_open , which will execute the command and return a resource that we can com...

Page 618 of 1088