Tutorial by Examples: l

Problem definition: An 8 puzzle is a simple game consisting of a 3 x 3 grid (containing 9 squares). One of the squares is empty. The object is to move to squares around into different positions and having the numbers displayed in the "goal state". Given an initial state of 8-puzzle...
In Laravel documentation, a symbolic link (symlink or soft link) from public/storage to storage/app/public should be created to make files accessible from the web. (THIS PROCEDURE WILL CREATE SYMBOLIC LINK WITHIN THE LARAVEL PROJECT DIRECTORY) Here are the steps on how you can create symbolic lin...
BlurBitmapTask.java public class BlurBitmapTask extends AsyncTask<Bitmap, Void, Bitmap> { private final WeakReference<ImageView> imageViewReference; private final RenderScript renderScript; private boolean shouldRecycleSource = false; public BlurBitmapTask(@NonNu...
We will follow the official guide for spring-boot and spring-data-jpa. We will be building the application using gradle. Create the gradle build file build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework....
When creating a scrapy project with scrapy startproject myproject, you'll find a pipelines.py file already available for creating your own pipelines. It isn't mandatory to create your pipelines in this file, but it would be good practice. We'll be explaining how to create a pipeline using the pipeli...
Data in R are stored in vectors. A typical vector is a sequence of values all having the same storage mode (e.g., characters vectors, numeric vectors). See ?atomic for details on the atomic implicit classes and their corresponding storage modes: "logical", "integer", "numeri...
Install Atom. You can get atom from here Go to Atom settings (ctrl+,). Packages -> Install go-plus package (go-plus) After Installing go-plus in Atom: Get these dependencies using go get or another dependency manager: (open a console and run these commands) go get -u golang.org/x/...
var gulp = require('gulp'); var path = require('path'); var shell = require('gulp-shell'); var goPath = 'src/mypackage/**/*.go'; gulp.task('compilepkg', function() { return gulp.src(goPath, {read: false}) .pipe(shell(['go install <%= stripPath(file.path) %>'], { ...
In SCSS variables begin with $ sign, and are set like CSS properties. $label-color: #eee; They are only available within nested selectors where they’re defined. #menu { $basic-color: #eee; color: $basic-color; } If they’re defined outside of any nested selectors, then they can be us...
Floating point literals provide values that can be used where you need a float or double instance. There are three kinds of floating point literal. Simple decimal forms Scaled decimal forms Hexadecimal forms (The JLS syntax rules combine the two decimal forms into a single form. We treat t...
function addTwo(a, b = 2) { return a + b; } addTwo(3) // Returns the result 5 With the addition of default function parameters you can now make arguments optional and have them default to a value of your choice.
try...catch block is for handling exceptions, remember exception means the thrown error not the error. try { var a = 1; b++; //this will cause an error because be is undefined console.log(b); //this line will not be executed } catch (error) { console.log(error); //here we handl...
Eclipse does not give you the possibility to change the font size of the views like 'Project Explorer' or 'Servers', which looks ugly on Linux since Eclipse uses the default (desktop) font size. But you can edit specific configuration files to get the proper font sizes. To fix this annoying font si...
Note 1: You need some prior knowledge about java servlet page(JSP) and Apache Maven before you start this examples. Start the web server (like Apache tomcat) with existing web project or create one. Visit the index.jsp. Anybody can access that page, it's insecure! Securing application ...
We will create a simple "Hello World!" app with Angular2 2.4.1 (@NgModule change) with a node.js (expressjs) backend. Prerequisites Node.js v4.x.x or higher npm v3.x.x or higher or yarn Then run npm install -g typescript or yarn global add typescriptto install typescript globally ...
Create a file ckeditor-inline.html with the following content: <!DOCTYPE html> <html> <head> <title>CKEditor Inline Demo!</title> </head> <body> <script src="//cdn.ckeditor.com/4.6.1/basic/ckeditor.js"></script> <...
// +build linux package lib var OnlyAccessibleInLinux int // Will only be compiled in Linux Negate a platform by placing ! before it: // +build !windows package lib var NotWindows int // Will be compiled in all platforms but not Windows List of platforms can be specified by separa...
If you name your file lib_linux.go, all the content in that file will only be compiled in linux environments: package lib var OnlyCompiledInLinux string
Different platforms can have separate implementations of the same method. This example also illustrates how build tags and file suffixes can be used together. File main.go: package main import "fmt" func main() { fmt.Println("Hello World from Conditional Compilation Doc!&...
Requirements: You need PHP >= 5.6.4 and Composer installed on your machine. You can check version of both by using command: For PHP: php -v Output like this: PHP 7.0.9 (cli) (built: Aug 26 2016 06:17:04) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998...

Page 689 of 861