Tutorial by Examples: c

MyWebView.Navigate(new Uri("ms-appdata:///local/Downloads/index.html"));
// resize the image to be contained within a maximum width and height, keeping aspect ratio public static UIImage MaxResizeImage(this UIImage sourceImage, float maxWidth, float maxHeight) { var sourceSize = sourceImage.Size; var maxResizeFactor = Math.Min(maxWidth / sourceSize.Width, max...
// resize the image (without trying to maintain aspect ratio) public static UIImage ResizeImage(this UIImage sourceImage, float width, float height) { UIGraphics.BeginImageContext(new SizeF(width, height)); sourceImage.Draw(new RectangleF(0, 0, width, height)); var resultImage = UIG...
// crop the image, without resizing public static UIImage CropImage(this UIImage sourceImage, int crop_x, int crop_y, int width, int height) { var imgSize = sourceImage.Size; UIGraphics.BeginImageContext(new SizeF(width, height)); var context = UIGraphics.GetCurrentContext(); ...
It is suggested that you define groups based on purpose of the host (roles) and also geography or datacenter location (if applicable): File inventory/production [rogue-server] 192.168.1.1 [atlanta-webservers] www-atl-1.example.com www-atl-2.example.com [boston-webservers] www-bos-1.examp...
Each table view must have a delegate and a data source. Delegate Methods None of the delegate methods are actually required, however you'll need to implement tableView:didSelectRowAtIndexPath: to handle touches on a table cell: And other methods are... // Display customization - (void)tableVi...
// Include Nodejs' net module. const Net = require('net'); // The port on which the server is listening. const port = 8080; // Use net.createServer() in your code. This is just for illustration purpose. // Create a new TCP server. const server = new Net.Server(); // The server listens to a ...
// Include Nodejs' net module. const Net = require('net'); // The port number and hostname of the server. const port = 8080; const host = 'localhost'; // Create a new TCP client. const client = new Net.Socket(); // Send a connection request to the server. client.connect({ port: port, host:...
Select is another way to do I/O multiplexing. One of it's advantages is an existance in winsock API. Moreover, on Linux, select() modifies timeout to reflect the amount of time not slept; most other implementations do not do this. (POSIX.1 permits either behavior.) Both poll and select have ppoll a...
SELECT ROWNUM NO FROM DUAL CONNECT BY LEVEL <= 10
You can create a custom exception and throw them during the execution of your function. As a general practice you should only throw an exception when your function could not achieve its defined functionality. Private Function OpenDatabase(Byval Server as String, Byval User as String, Byval Pwd as S...
Circle is the newer Continuous Integration service that's become popular among Meteorites. It's got all of the latest bells and whistles, as far as continuous integration goes. The following script supports many new features, including: screenshots artifacts git submodules environment detect...
SauceLabs is an Automated Testing Platform for the enterprise. It supports both continuous integration, cross browser testing, and a mobile device cloud. Costs are higher than with Travis, Circle, or BrowserStack, hwoever. { "selenium" : { "start_process" : false, ...
BrowserStack uses a device cloud for cross-browser testing. The intent is to allow testing of Selenium scripts on every device possible. { "selenium" : { "start_process" : false, "host" : "hub.browserstack.com", "port" : 80, }, ...
#lang racket (for ([path (in-directory)] #:when (regexp-match? #rx"[.]rkt$" path)) (printf "source file: ~a\n" path)) The #lang line specifies the programming language of this file. #lang racket we are using the baseline, battery-included Racket programming language. O...
You can import a single package with the statement: import "path/to/package" or group multiple imports together: import ( "path/to/package1" "path/to/package2" ) This will look in the corresponding import paths inside of the $GOPATH for .go files and ...
Generics was introduced in Java in its version (1.)5. These are erased during compilation, so runtime reflection is not possible for them. Generics generate new types parametrized by other types. For example we do not have to create new classes in order to use type safe collection of Strings and Num...
Select * from firm's_address; Select * from "firm's_address";
Say you have a table named table or you want to create a table with name which is also a keyword, You have to include the name table in pair of double quotes "table" Select * from table; Above query will fail with syntax error, where as below query will run fine. Select * from "tab...
To enable a CORS policy across all of your MVC controllers you have to build the policy in the AddCors extension within the ConfigureServices method and then set the policy on the CorsAuthorizationFilterFactory using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Cors.Internal; ... pub...

Page 556 of 826