Tutorial by Examples: c

Let's say you use Webpack for front end bundling. You can add webpack-dev-middleware to serve your statics through tiny and fast server. It allows you to automatically reload your assets when content has changed, serve statics in memory without continuously writing intermediate versions on disk. Pr...
To allow a bokeh application to be executed like a normal .py file, you need to handle the tornado IOloop in your application, as described here. A standalone bokeh application like this can be used to implement a console script entry point in setup.py. However, this requires bokeh version >= 0....
Hot Module Replacement allows to add, change or delete app module when application is running. Page reloading is not needed in this case. Prerequisites In addition to webpack-dev-middleware packages: npm install --save-dev webpack-hot-middleware Configuration Simply update configuration of UseW...
You can use aspnetcore-spa generator for Yeoman to create brand-new single page application with asp.net core. This allows you to choose one of the popular front end frameworks and generates project with webpack, dev server, hot module replacement and server-side rendering features. Just run npm ...
You can create a New Project in Android Studio and then add Kotlin support to it or modify your existing project. To do it, you have to: Add dependency to a root gradle file - you have to add the dependency for kotlin-android plugin to a root build.gradle file. buildscript { repositorie...
Click to File → New → Kotlin Activity. Choose a type of the Activity. Select name and other parameter for the Activity. Finish. Final class could look like this: import android.support.v7.app.AppCompatActivity import android.os.Bundle class MainActivity : AppCompatActivity() { ...
Kotlin Plugin for Android Studio support converting existing Java files to Kotlin files. Choose a Java file and invoke action Convert Java File to Kotlin File:
# ruby 1.92 lower_limit = 1 upper_limit = 6 Random.new.rand(lower_limit..upper_limit) # Change your range operator to suit your needs
(Beginner level; IDE: CLion) First, install boost from the Cygwin mirror: open the install exe, search for boost, install the packages. After boost is installed: it will be located in /usr/include/boost. This is where everything is. All #include statements will be a path from the boost folder,...
public class NetworkConnection : IDisposable { string _networkName; public NetworkConnection(string networkName, NetworkCredential credentials) { _networkName = networkName; var netResource = new NetResource() {...
apm is Atom's native package manager. It allows the user to manage packages and themes without having to initialise Atom itself. apm comes with the official installation and is automatically added to %PATH% if you're on Windows. To use apm, go to Command Prompt and type $ apm <command> He...
cf logs AppName --recent Note, depending on who is hosting your CF app, the size of this log may be limited.
CF keeps you logged in. I sometimes have to switch between regions and don't always know where I am #Where am I? cf target #Login. This is logging in to the UK region of bluemix. Replace eu-gb with ng to go to the US. cf login -a https://api.eu-gb.bluemix.net #List spaces cf spaces #C...
This is the simplest way to connect. First, the driver has to be registered with java.sql.DriverManager so that it knows which class to use. This is done by loading the driver class, typically with java.lang.Class.forname(<driver class name>). /** * Connect to a PostgreSQL database. *...
Instead of specifying connection parameters like user and password (see a complete list here) in the URL or a separate parameters, you can pack them into a java.util.Properties object: /** * Connect to a PostgreSQL database. * @param url the JDBC URL to connect to. Must start with "jdbc:...
It is common to use javax.sql.DataSource with JNDI in application server containers, where you register a data source under a name and look it up whenever you need a connection. This is code that demonstrates how data sources work: /** * Create a data source with connection pool for PostgreSQL c...
You can start Solr by running bin/solr from the Solr directory and this will start Solr in the background, listening on port 8983. $ bin/solr start To change the port Solr listens on, you can use the -p parameter when starting, such as: $ bin/solr start -p 8984 Since Solr is a server, it is more...
Given the following class: public class FinalizableObject { public FinalizableObject() { Console.WriteLine("Instance initialized"); } ~FinalizableObject() { Console.WriteLine("Instance finalized"); } } A program that create...
Rule of thumb: when garbage collection occurs, "live objects" are those still in use, while "dead objects" are those no longer used (any variable or field referencing them, if any, has gone out of scope before the collection occurs). In the following example (for convenience, Fi...
What if two (or several) otherwise dead objects reference one another? This is shown in the example below, supposing that OtherObject is a public property of FinalizableObject: var obj1 = new FinalizableObject1(); var obj2 = new FinalizableObject2(); obj1.OtherObject = obj2; obj2.OtherObject = ...

Page 749 of 826