Tutorial by Examples

We can provide a meaningful name for our constructors. We can provide several constructors with the same number and type of parameters, something that as we saw earlier we can’t do with class constructors. public class RandomIntGenerator { private final int min; private final int max; ...
We can avoid providing direct access to resource intensive constructors, like for databases. public class DbConnection { private static final int MAX_CONNS = 100; private static int totalConnections = 0; private static Set<DbConnection> availableConnections = new HashSet<DbConnectio...
We can limit no of rows from result using rownum clause select * from ( select val from mytable ) where rownum<=5 If we want first or last record then we want order by clause in inner query that will give result based on order. Last Five Record : select * from ( select val f...
Get localized product information from a set of product identifier strings using SKProductsRequest: import StoreKit let productIdentifierSet = Set(["yellowSubmarine", "pennyLane"]) let productsRequest = SKProductsRequest(productIdentifiers: productIdentifierSet) In order ...
This example will show how to make a simple "Hello User [name]" after the login. The example is based on performing a custom action using a hook From your command line terminal, navigate to your Plugins SDK’s hooks folder. To create a hook project, you must execute the create script. Her...
OpenSSH config files are used for configuration that should be applied every time the ssh client is run. Most command line options are possible to put in the config files. OpenSSH uses configuration from the following sources in order: Command line options User's configuration file ~/.ssh/confi...
HTTPS HTTPS (also called HTTP over TLS,[1][2] HTTP over SSL,[3] and HTTP Secure[4][5]) is a protocol for secure communication over a computer network which is widely used on the Internet. HTTPS consists of communication over Hypertext Transfer Protocol (HTTP) within a connection encrypted by Transp...
Create a Laravel application: $ composer create-project laravel/laravel hello-world Navigate to the project folder, e.g. $ cd C:\xampp\htdocs\hello-world Create a controller: $ php artisan make:controller HelloController --resource This will create the file app/Http/Con...
DayPilot Scheduler widget displays a time line for multiple resources. Supports AJAX and HTML5. Automatic and manual localization. Full CSS styling support
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %> <DayPilot:DayPilotScheduler ID="DayPilotScheduler1" runat="server" DataStartField="eventstart" DataEndField="eventend" ...
from string import Template data = dict(item = "candy", price = 8, qty = 2) # define the template t = Template("Simon bought $qty $item for $price dollar") print(t.substitute(data)) Output: Simon bought 2 candy for 8 dollar Templates support $-based substitution...
To get the actual type for a variable declared using var, call GetSymbolInfo() on the SemanticModel. You can open an existing solution using MSBuildWorkspace, then enumerate its projects and their documents. Use a document to obtain its SyntaxRoot and SemanticModel, then look for VariableDeclaration...
ProGuard allows the developer to obfuscate, shrink and optimize his code. #1 The first step of the procedure is to enable proguard on the build. This can be done by setting the 'minifyEnabled' command to true on your desired build #2 The second step is to specify which proguard files are we using...
Everybody loves twitter bootstrap, but some of us don't like it's default design. So here's a simple guide on how to start customizing boostrap's design. Twitter boostrap when cloned provides a set of default css files which we can override. The mail css file that we need to override is the boostra...
You can create a new Repository where ever you want, but it's recommended to create them in a seperate Repository folder. While you could name the Repository file and class as you wish, it's recommended to name the Repository EntityNameRepository, to that you could quickly find those in your folder...
If you want to use the MySQL command IN() in the QueryBuilder, you can do it with the in() function of the ExpressionBuilder class. // get an ExpressionBuilder instance, so that you $expressionBulder = $this->_em->getExpressionBuilder(); $qb = $this->_em->createQueryBuilder() ->se...
A Bootstrap dropdown is a Bootstrap component that allows an HTML element trigger the display of a sub-menu dropdown upon the element being clicked. Here is a basic HTML usage example: <div class="dropdown"> <button id="dLabel" type="button" data-toggle=&q...
Create an HTML file (in this example libraries/turf.html) with the library you want to load: <script src="../../bower_components/turf/turf.min.js"></script> Import the HTML file (libraries/turf.html) in your component with the rest of your imports: <link rel...
Create an HTML file (in this example libraries/turf.html) with the library you want to load: <script src="../../bower_components/turf/turf.min.js"></script> Import and use your library when needed: doSomething: function(argument, anotherArgument): { // If li...
def make_unicode(data): if type(data) != unicode: data = data.decode('utf-8') return data else: return data

Page 834 of 1336