Create a folder where you would like to have your game live, and move into that
mkdir my-new-game
cd my-new-game
Initialize the directory using npm.
npm init -y
Install phaser as a node package.
npm install phaser
Install http-server as a global module, to be used on the...
The HTML <p> element defines a paragraph:
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Display-
You cannot be sure how HTML will be displayed.
Large or small screens, and resized windows will create different results.
With HTML, you cannot chang...
In order to create a scheduler,the entry needs to be created in
liferay-portlet.xml
provding scheduler class and trigger value for timing of scheduler triggering
<portlet-name>GetSetGo</portlet-name>
<icon>/icon.png</icon>
<scheduler-entry>
...
This package generates a file that your IDE understands, so it can provide accurate autocompletion. Generation is done based on the files in your project.
Read more about this here
Cards are a great way to display important pieces of content, and are quickly emerging as a core design pattern for apps. They're are a great way to contain and organize information, while also setting up predictable expectations for the user. With so much content to display at once, and often so li...
Below code is basic example of spark launcher.This can be used if spark job has to be launched through some application.
val sparkLauncher = new SparkLauncher
//Set Spark properties.only Basic ones are shown here.It will be overridden if properties are set in Main class.
sparkLauncher.setSparkHom...
Overview: There are typically two types of SAS Deployments:
SAS Foundation only installation (BASE SAS). This is typically is installed on a PC. It does not run any server software.
SAS Planned Deployment for their server architecture which will install the SAS server environment along wit...
Alias Declaration are affected by preceding using statements
namespace boost
{
namespace multiprecision
{
class Number ...
}
}
using namespace boost;
// Both Namespace are equivalent
namespace Name1 = boost::multiprecision;
namespace Name2 = multiprecision;
...
For a circular View (in this case TextView) create a drawble round_view.xml in drawble folder:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid...
Php arrayiterator allows you to modify and unset the values while iterating over arrays and objects.
Example:
$array = ['1' => 'apple', '2' => 'banana', '3' => 'cherry'];
$arrayObject = new ArrayObject($array);
$iterator = $arrayObject->getIterator();
for($iterator; $iterator-...
To declare a single namespace with hierarchy use following example:
namespace MyProject\Sub\Level;
const CONNECT_OK = 1;
class Connection { /* ... */ }
function connect() { /* ... */ }
The above example creates:
constant MyProject\Sub\Level\CONNECT_OK
class MyProject\Sub\Level\Connection...
Although not necessary in PHP however it is a very good practice to initialize variables. Uninitialized variables have a default value of their type depending on the context in which they are used:
Unset AND unreferenced
var_dump($unset_var); // outputs NULL
Boolean
echo($unset_bool ? "tr...
You can declare functions that serve as type guards using any logic you'd like.
They take the form:
function functionName(variableName: any): variableName is DesiredType {
// body that returns boolean
}
If the function returns true, TypeScript will narrow the type to DesiredType in any bl...
The following lines of code is more smart way to setting up the base_url in codeigniter:
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config[...
Angular2 provides several exported values that can be aliased to local variables. These are:
index
first
last
even
odd
Except index, the other ones take a Boolean value. As the previous example using index, it can be used any of these exported values:
<div *ngFor="let item of item...
Sometimes we don't want to load the entire XML file in order to get the information we need. In these instances, being able to incrementally load the relevant sections and then delete them when we are finished is useful. With the iterparse function you can edit the element tree that is stored while ...
Function singular($string), convert a plural word to singular. To get perfect result parameter $string should be a single word. The function will return string.
echo singular("books"); //prints 'book'
The NgFor directive instantiates a template once per item from an iterable. The context for each instantiated template inherits from the outer context with the given loop variable set to the current item from the iterable.
To customize the default tracking algorithm, NgFor supports trackBy option. ...