Tutorial by Examples: ci

The syntax for Java generics bounded wildcards, representing the unknown type by ? is: ? extends T represents an upper bounded wildcard. The unknown type represents a type that must be a subtype of T, or type T itself. ? super T represents a lower bounded wildcard. The unknown type repres...
When using labels, both the start and the stop are included in the results. import pandas as pd import numpy as np np.random.seed(5) df = pd.DataFrame(np.random.randint(100, size=(5, 5)), columns = list("ABCDE"), index = ["R" + str(i) for i in range(5)]) ...
First define the circle radius and its center: var radius:Number = 100; var center:Point = new Point(35, 70); Then generate a random angle in radians from the center: var angle:Number = Math.random() * Math.PI * 2; Then generate an effective radius of the returned point, so it'll be inside ...
Output some information about a known remote: origin git remote show origin Print just the remote's URL: git config --get remote.origin.url With 2.7+, it is also possible to do, which is arguably better than the above one that uses the config command. git remote get-url origin
In contrast of a full template specialization partial template specialization allows to introduce template with some of the arguments of existing template fixed. Partial template specialization is only available for template class/structs: // Common case: template<typename T, typename U> st...
/** * @param year Full year as int (ex: 2000). * @param month Month as int, zero-based (ex: 0=January, 11=December). */ function daysInMonth(year:int, month:int):int { return (new Date(year, ++month, 0)).date; }
function isLeapYear(year:int):Boolean { return daysInMonth(year, 1) == 29; }
WCF tracing is built on top of System.Diagnostics. To use tracing, you should define trace sources in the configuration file or in code. Tracing is not enabled by default. To activate tracing, you must create a trace listener and set a trace level other than "Off" for the selected trace s...
Technically, autoloading works by executing a callback when a PHP class is required but not found. Such callbacks usually attempt to load these classes. Generally, autoloading can be understood as the attempt to load PHP files (especially PHP class files, where a PHP source file is dedicated for a ...
.SD .SD refers to the subset of the data.table for each group, excluding all columns used in by. .SD along with lapply can be used to apply any function to multiple columns by group in a data.table We will continue using the same built-in dataset, mtcars: mtcars = data.table(mtcars) # Let's not ...
void doSomething(String... strings) { for (String s : strings) { System.out.println(s); } } The three periods after the final parameter's type indicate that the final argument may be passed as an array or as a sequence of arguments. Varargs can be used only in the final argume...
Builtin container comes with a set of builtin features : Lifetime control public void ConfigureServices(IServiceCollection services) { // ... services.AddTransient<ITestService, TestService>(); // or services.AddScoped<ITestService, TestSer...
Once registered a dependency can be retrieved by adding parameters on the Controller constructor. // ... using System; using Microsoft.Extensions.DependencyInjection; namespace Core.Controllers { public class HomeController : Controller { public HomeController(ITestServic...
beacon = CLBeaconRegion(proximityUUID: <#NSUUID#>, major: <#CLBeaconMajorValue#>, identifier: <#String#>) // listening to all beacons with given UUID and major value beacon = CLBeaconRegion(proximityUUID: <##NSUUID#>, major: <##CLBeaconMajorValue#>, minor: <##C...
In case your project needs to be based on a specific Symfony version, use the optional second argument of the new command: # use the most recent version in any Symfony branch $ symfony new my_project_name 2.8 $ symfony new my_project_name 3.1 # use a specific Symfony version $ symfony new my_...
using System.Net; ... string serverResponse; try { // Call a method that performs an HTTP request (per the above examples). serverResponse = PerformHttpRequest(); } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { HttpWebResponse...
In C, a string is a sequence of characters that is terminated by a null character ('\0'). We can create strings using string literals, which are sequences of characters surrounded by double quotation marks; for example, take the string literal "hello world". String literals are automatica...
PHP has great official documentation already at http://php.net/manual/. The PHP Manual documents pretty much all language features, the core libraries and most available extensions. There are plenty of examples to learn from. The PHP Manual is available in multiple languages and formats. Best of al...
// *** Find movies with specific ids *** NSPredicate *filterByIds = [NSPredicate predicateWithFormat:@"self.id IN %@",@[@"7CDF6D22-8D36-49C2-84FE-E31EECCECB79", @"7CDF6D22-8D36-49C2-84FE-E31EECCECB76"]]; NSLog(@"Filter By Ids : %@",[array filteredArrayUsingP...
If you only want to execute a single statement, you can use the engine directly and it will open and close the connection for you: result = engine.execute('SELECT price FROM products') for row in result: print('Price:', row['price'])

Page 8 of 42