Tutorial by Examples

For multiple databases, you have the database.php file where you can set as many databases as you need. If you want to "switch" a database for a specific model on the fly, use the setDataSource() method. For example, if you have two databases, you can define them in the database.php file...
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <WebView x:Name="MyWebView" /> </Grid>
MyWebView.Navigate(new Uri("http://www.url.com"));
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:...
Start by downloading the latest stable release from https://hive.apache.org/downloads.html -> Now untar the file with $ tar -xvf hive-2.x.y-bin.tar.gz -> Create a directory in the /usr/local/ with $ sudo mkdir /usr/local/hive -> Move the file to root with $ mv ~/Downloads/hive-2.x.y /...
AppleScript can display dialogs and alerts to the user. Dialogs are for optionally requesting user input. display dialog "Hello World" display alert "Hello World" You can customise the buttons of either using buttons and passing a list of text. display dialog "Hell...
In this example we create a pair of connected sockets and send 4 strings from one to another and print received strings to console. Note, that the number of times we will call send may not be equal to number of times we call recv #include <stdio.h> #include <stdlib.h> #include <str...
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
Dependency installation ( https://www.npmjs.com/package/gulp-imagemin ) $ npm install --save-dev gulp-imagemin Usage /* * Your other dependencies. */ var imagemin = require('gulp-imagemin'); /* * `gulp images` - Run lossless compression on all the images. */ gulp.task('images', f...
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...
Travis is the original Continuous Integration service that became popular in the Meteor community. It's solid and reliable, has long had a open-source hosting tier, and has run hundreds of thousands of Nightwatch tests over the years. .travis.yml Simply put a .travis.yml file in the root of your ...
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...

Page 895 of 1336