Tutorial by Examples: application

To build a Rails application that will be an API server, you can start with a more limited subset of Rails in Rails 5. To generate a new Rails API app: rails new my_api --api What --api does is to remove functionality that is not needed when building an API. This includes sessions, cookies, ass...
Codeigniter may be configured to run more than one project without duplicating CI core files. It's possible by splitting CI Application side. For example let's take project of website, which contains front-end and back-end Content Management System (CMS) applications. In this case CI folder struct...
Similar to currying, partial application is used to reduce the number of arguments passed to a function. Unlike currying, the number need not go down by one. Example: This function ... function multiplyThenAdd(a, b, c) { return a * b + c; } ... can be used to create another function that...
A simplest Oozie application is consists of a workflow logic file (workflow.xml), workflow properties file (job.properties/job.xml) and required JAR files, scripts and configuration files. Except the workflow properties file, all the other files should to be stored in a HDFS location. The workflow p...
If you only need a given resource for a specific control, you can make it more local by adding it to this specific control, instead of the window. It works exactly the same way, the only difference being that you can now only access from inside the scope of the control where you put it: <StackPa...
The example below will collect the Device's OS version number and the the version of the application (which is defined in each projects' properties) that is entered into Version name on Android and Version on iOS. First make an interface in your PCL project: public interface INativeHelper { /...
Make sure you are in the directory that contains your Rails app, then create an app on Heroku. $ heroku create example Creating ⬢ example... done https://example.herokuapp.com/ | https://git.heroku.com/example.git The first URL of the ouput, http://example.herokuapp.com, is the location the ap...
n order to debug a remote Java application, it should be launched with some extra arguments to instruct the JVM to execute it in debug mode. This is done as follows: java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar sampleApp.jar The above command tells the JVM to s...
The Leaflet package is designed to integerate with Shiny In the ui you call leafletOutput() and in the server you call renderLeaflet() library(shiny) library(leaflet) ui <- fluidPage( leafletOutput("my_leaf") ) server <- function(input, output, session){ out...
For the common case of having one Flask application all you have to do is to create your Flask application, load the configuration of choice and then create the SQLAlchemy object by passing it the application. Once created, that object then contains all the functions and helpers from both sqlalchem...
The built-in werkzeug server certainly is not suitable for running production servers. The most obvious reason is the fact that the werkzeug server is single-threaded and thus can only handle one request at a time. Because of this we want to use the uWSGI Server to serve our application instead. In...
public String getAppVersion() throws PackageManager.NameNotFoundException { PackageManager manager = getApplicationContext().getPackageManager(); PackageInfo info = manager.getPackageInfo( getApplicationContext().getPackageName(), ...
Create a new console application with one line in the Main method: Console.WriteLine("Hello World") Remember the path to the .csproj file and replace it in the example. Create a new Console Application and install the Microsoft.CodeAnalysis NuGet package and try the following code: cons...
Create a new console application with one line in the Main method: Console.WriteLine("Hello World") Remember the path to the .vbproj file and replace it in the example. Create a new Console Application and install the Microsoft.CodeAnalysis NuGet package and try the following code: Cons...
Firstly you have to add Xamarin.Android.Support.V7.AppCompat library for NuGet: https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/ In the "values" folder under "Resources" add new xml file called "styles.xml": "styles.xml" file should co...
Every Windows Phone project contains App.cs class: public sealed partial class App : Application This class is your global application context. General Application class usage: App entry point, particularly for various activation contracts. Application lifecycle management. Application g...
Resolving scoped services during application startup can be difficult, because there is no request and hence no scoped service. Resolving a scoped service during application startup via app.ApplicationServices.GetService<AppDbContext>() can cause issues, because it will be created in the sc...
// Define new router group $api = new \Phalcon\Mvc\Router\Group([ 'module' => 'api', ]); $api->setPrefix('/api/v1'); // API routes (Maps to Cotnroller::Action) $api->addGet('/users', 'Users::index'); $api->addGet('/users/search/{query}', 'Users::search'); $api->addGet('/...
YAML provides a way to store structured data. The data can be a simple set of name-value pairs or a complex hierarchical data with values even being arrays. Consider the following YAML file: database: driver: mysql host: database.mydomain.com port: 3306 db_name: sample_db ...
First define an ExitActivity in the AndroidManifest.xml <activity android:name="com.your_example_app.activities.ExitActivity" android:autoRemoveFromRecents="true" android:theme="@android:style/Theme.NoDisplay" /> Afterwards the ExitA...

Page 4 of 11