This example will demonstrate how to get started with Firebase in your web apps with JavaScript.
We are going to add a text child in our Firebase Database and display it in realtime on our web app.
Lets get started.
Go to the Firebase Console - https://console.firebase.google.com and create a...
Opening a browser with to() method.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
class navigateWithTo{
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://www.example.com...
Sample Data
XML Document
First, let's define a sample XML document named "books.xml" in our current directory:
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<title>Of Mice And Men</title>
<author>Joh...
Each .NET Core component (SDK, Host and Shared Framework) is versioned independently.
You can find the version for each of them separately.
SDK
You can use the --version option to dotnet to see the SDK
version. For example:
$ ~/dotnet-1.1.1/dotnet --version
1.0.0-preview2-1-003176
dotne...
It's possible to have multiple .NET Core SDKs and Runtimes
available on disk. You can select the versions for each separately.
To select the version of the SDK to use, use global.json.
To select the version of the shared framework to use, target the specified framwork in the .csproj file (or proj...
This example expects an error, as the hello-world bucket already exists and S3 uses a global namespace.
New-S3Bucket -BucketName "hello-world"
New-S3Bucket : The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a dif...
This is a more flexible alternative to thread first or thread last. It can be inserted anywhere in the list of parameters of the function.
(as-> [1 2] x
(map #(+ 1 %) x)
(if (> (count x) 2) "Large" "Small"))
You can use any name for the function.
function custom_postype(){
register_post_type('cus_post',array(
'labels'=>array(
'name'=>'khaiyam'// Use any name you want to show in menu for your users
),
'public'=>true,// **Must required
...
Validating the Name entered by a User contain the following check
Ensure it is not empty
Ensure it contain only alphabets, space and/or dot.
So, the regular expression for this is
^[A-Z][a-z]*(\.?\s?[A-Z][a-z]*)+$
This means
^ -> Should start with
[A-Z] -> the first lette...
Let's take the Range is from 18 to 80.
So, to validate,
We should check that the age is a positive integer.
Then check it should be greater than or equal to 18 and less than or equal to 80.
The test to check whether it is a number or not can be performed by a simple regular expression like
^[0-...
Sometimes, we have to take input from users which should contain only alpha numeric characters.
For example, lets say a Username system which allow only letters and numbers,
Then this can be done with the following Regular Expression
^[a-zA-Z0-9]+$
^ is restrict the start
[a-zA-Z0-9]+ is th...
Minimal example based on PHP manual example found here:
http://php.net/manual/en/sockets.examples.php
Create a websocket script that listens to Port 5000
Use putty, terminal to run telnet 127.0.0.1 5000 (localhost).
This script replies with the message you sent (as a ping-back)
<?php
set_ti...
Each watchOS target includes an App and an Extension. App contains the UI stuff and Extension contains the actual logic (similar to Views and Models in MVC architecture in iOS).
Each WatchKit App has a Interface.storyboard file which you design the app in it, and a Assets.xcassets file to put your ...
Many watchOS apps (like Workout, Weather, Music, etc) have a main WKInterfaceTable or a set of buttons which are hooked up to another controller, similar to the navigation on iOS. This is called hierarchical view structure.
To connect a button, Ctrl-Drag from the button to a controller, and select ...
Using the previous example of calculating the factorial of an integer, put in the hash table all values of factorial calculated inside the recursion, that do not appear in the table.
As in the article about memoization, we declare a function f that accepts a function parameter fact and a integer pa...
SELECT e.emp_id , e.first_name , e.last_name FROM employees e INNER JOIN managers m ON m.mgr_id = e.mgr_id WHERE m.mgr_id = 'M01' ;
Results in:
EMP_IDFIRST_NAMELAST_NAMEE02ErinMacklemoreE04RonSonswan
Ultimately, for every manager we query for, we will see 1 or more employees returned.
Consult the above example tables when looking at this example.
SELECT m.mgr_id , m.first_name , m.last_name FROM managers m INNER JOIN employees e ON e.mgr_id = m.mgr_id WHERE e.emp_id = 'E03' ;
MGR_IDFIRST_NAMELAST_NAMEM03BarrelJones
As this is the inverse of the above example, we know that for ...