Tutorial by Examples

Often you will want to have an input box that takes numbers only. Again by deriving from the standard controls this is easily achieved, for example: using System; using System.Windows.Forms; using System.Globalization; namespace StackOverflowDocumentation { public class SONumberBox : SO...
import pygame background_colour = (255,255,255) # For the background color of your window (width, height) = (300, 200) # Dimension of the window screen = pygame.display.set_mode((width, height)) # Making of the screen pygame.display.set_caption('Tutorial 1') # Name for the window screen.fil...
Here is our function to create a simple ajax call written in vanilla javascript (not es2015): function ajax(url, callback) { var xhr; if(typeof XMLHttpRequest !== 'undefined') xhr = new XMLHttpRequest(); else { var versions = ["MSXML2.XmlHttp.5.0", ...
Every Country has one Capital. Every Capital has one Country. Country.java package com.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persist...
The following code can be found in a demo here: https://ellie-app.com/mbFwJT9jD3/0 import Html exposing (..) import Json.Decode exposing (Decoder) payload = """ [{ "id": 0, "name": "Adam Carter", "work": "Uni...
First, import modules and set connection strings. If you need parameters, you can either put them directly in the URL string (an API in this case) or build them as a dict and pass them to the params argument. import requests import json params = {'id': 'blahblah', 'output': 'json'} # You could ...
To make an app more cohesive, we often need to keep user's personal settings and preferences consistent across multiple devices that have been logged in with one Microsoft account. In this sample, we use roaming data to store and to load UI settings, game process and user info. But the roaming data ...
A build is also available on npmcdn. You can include the script like this: <script src="https://npmcdn.com/react-router/umd/ReactRouter.min.js"></script> The library will be available globally on window.ReactRouter.
The not very secure way (because docker inspect will show it) is to pass an environment variable to docker run such as docker run -e password=abc or in a file docker run --env-file myfile where myfile can contain password1=abc password2=def it is also possible to put them in a volume dock...
How to implement FirebaseRealTime database in android application. Following is the steps for do it. First install firebase sdk, If you dont know how to install then following is the URL for help. Install Firebase SDK After thet register your project in firbase console, URL of the firbas...
<Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Text...
By using the Grid.RowSpan and Grid.ColumnSpan attached properties, children of a Grid can span multiple rows or columns. In the following example the second TextBlock will span the second and third column of the Grid. <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/&...
The row heigths or column widths of multiple Grids can be synchronized by setting a common SharedSizeGroup on the rows or columns to synchronize. Then a parent control somewhere up in the tree above the Grids needs to have the attached property Grid.IsSharedSizeScope set to True. <StackPanel Gri...
Angular's builtin $http service allows us to send HTTP requests. Oftentime, the need arise to do things before or after a request, for example adding to each request an authentication token or creating a generic error handling logic.
Create an HTML file with the following content: <!DOCTYPE html> <html> <head> <title>Angular Interceptor Sample</title> <script src="https://code.angularjs.org/1.5.8/angular.min.js"></script> <script src="app.js"></sc...
A letter with a diacritic may be represented with the letter, and a combining modifier letter. You normally think of é as one character, but it's really 2 code points: U+0065 — LATIN SMALL LETTER E U+0301 — COMBINING ACUTE ACCENT Similarly ç = c + ¸, and å = a + ˚ combined forms To compl...
There is this thing called Zalgo Text which pushes this to the extreme. Here is the first grapheme cluster of the example. It consists of 15 code points: the Latin letter H and 14 combining marks.   H̡̫̤̤̣͉̤ͭ̓̓̇͗̎̀   Although this doesn't show up in normal text, it shows that a “character” r...
A lot of emoji consist of more than one code point. 🇯🇵: A flag is defined as a pair of "regional symbol indicator letters" (🇯 + 🇵) 🙋🏿: Some emoji may be followed by a skin tone modifier: 🙋 + 🏿 😀︎ or 😀️: Windows 10 allows you to specify if an emoji is colored or black/white b...
public class PlayerJoinListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent evt) { Player joined = evt.getPlayer(); String joinedName = joined.getName(); //RETRIEVING THE JOIN MESSAGE ALREADY SET String joinMessage = ev...
public class PlayerMoveListener implements Listener { @EventHandler public void onPlayerMove(PlayerMoveEvent evt) { Location from = evt.getFrom(); Location to = evt.getTo(); double xFrom = from.getX(); double yFrom = from.getY(); double zFrom ...

Page 888 of 1336