Tutorial by Examples

This is a minimalist module that only slurps files into variables, nothing else. use File::Slurper 'read_text'; my $contents = read_text($filename); read_text() takes two optional parameters to specify the file encoding and whether line endings should be translated between the unixish LF or DOS...
Don't use it. Although it has been around for a long time and is still the module most programmers will suggest, it is broken and not likely to be fixed.
With the use of the extends keyword among classes, all the properties of the superclass (also known as the Parent Class or Base Class) are present in the subclass (also known as the Child Class or Derived Class) public class BaseClass { public void baseMethod(){ System.out.println(&...
A generic class with the type parameter Type class MyGenericClass<Type>{ var value: Type init(value: Type){ self.value = value } func getValue() -> Type{ return self.value } func setValue(value: Type){ self.value = value }...
To install the latest version of a package named SomePackage: $ pip install SomePackage To install a specific version of a package: $ pip install SomePackage==1.0.4 To specify a minimum version to install for a package: $ pip install SomePackage>=1.0.4 If commands shows permission den...
To uninstall a package: $ pip uninstall SomePackage
To list installed packages: $ pip list # example output docutils (0.9.1) Jinja2 (2.6) Pygments (1.5) Sphinx (1.1.2) To list outdated packages, and show the latest version available: $ pip list --outdated # example output docutils (Current: 0.9.1 Latest: 0.10) Sphinx (Current: 1.1.2 Late...
Running $ pip install --upgrade SomePackage will upgrade package SomePackage and all its dependencies. Also, pip automatically removes older version of the package before upgrade. To upgrade pip itself, do $ pip install --upgrade pip on Unix or $ python -m pip install --upgrade pip on ...
Euler angles are "degree angles" like 90, 180, 45, 30 degrees. Quaternions differ from Euler angles in that they represent a point on a Unit Sphere (the radius is 1 unit). You can think of this sphere as a 3D version of the Unit circle you learn in trigonometry. Quaternions differ from Eu...
Quaternion.LookRotation(Vector3 forward [, Vector3 up]) will create a Quaternion rotation that looks forward 'down' the forward vector and has the Y axis aligned with the 'up' vector. If the up vector is not specified, Vector3.up will be used. Rotate this Game Object to look at a target Game Object...
When adding indented code blocks inside a list you first need a blank line, then to indent the code further. Different flavours of Markdown have different rules for this. StackExchange requires code to be indented by 8 characters instead of the usual 4. (Spaces replaced with * for clarity): 1...
Examine the following strings: foobarfoo bar foobar barfoo the regular expression bar will match all four strings, \bbar\b will only match the 2nd, bar\b will be able to match the 2nd and 3rd strings, and \bbar will match the 2nd and 4th strings.
uvloop is an implementation for the asyncio.AbstractEventLoop based on libuv (Used by nodejs). It is compliant with 99% of asyncio features and is much faster than the traditional asyncio.EventLoop. uvloop is currently not available on Windows, install it with pip install uvloop. import asyncio i...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/5/ HTML <div class="box_shadow"></div> CSS .box_shadow { width: 100px; height: 100px; margin: 100px; box-shadow: -52px -52px 0px 0px #f65314, 52px -52px 0px 0px #7cbb00, -52px 52px 0px 0px #00...
virtual and override The virtual keyword allows a method, property, indexer or event to be overridden by derived classes and present polymorphic behavior. (Members are non-virtual by default in C#) public class BaseClass { public virtual void Foo() { Console.WriteLine("Foo...
A recursive function is simply a function, that would call itself. function factorial (n) { if (n <= 1) { return 1; } return n * factorial(n - 1); } The above function shows a basic example of how to perform a recursive function to return a factorial. Another...
import locale locale.setlocale(locale.LC_ALL, '') Out[2]: 'English_United States.1252' locale.currency(762559748.49) Out[3]: '$762559748.49' locale.currency(762559748.49, grouping=True) Out[4]: '$762,559,748.49'
First of all, we need to add our first Fragment at the beginning, we should do it in the onCreate() method of our Activity: if (null == savedInstanceState) { getSupportFragmentManager().beginTransaction() .addToBackStack("fragmentA") .replace(R.id.container, FragmentA.n...
Python 2.x2.7 "1deadbeef3".decode('hex') # Out: '\x1d\xea\xdb\xee\xf3' '\x1d\xea\xdb\xee\xf3'.encode('hex') # Out: 1deadbeef3 Python 3.x3.0 "1deadbeef3".decode('hex') # Traceback (most recent call last): # File "<stdin>", line 1, in <module> ...
Detailed instructions on getting razor set up or installed.

Page 218 of 1336