A Functor is defined in category theory as a structure-preserving map (a 'homomorphism') between categories. Specifically, (all) objects are mapped to objects, and (all) arrows are mapped to arrows, such that the category laws are preserved.
The category in which objects are Haskell types and morph...
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[...
tslint can extend an existing rule set and is shipped with the defaults tslint:recommended and tslint:latest.
tslint:recommended is a stable, somewhat opinionated set of rules which we encourage for general TypeScript programming. This configuration follows semver, so it will not have breaking ch...
To set the timezone in Codeigniter by extending date helper is an alternative way. For doing that need to follow the following two step activity.
Extend date helper with the following function:
if ( ! function_exists('now'))
{
/**
* Get "now" time
*
* Returns tim...
On Debian-based distributions (e.g. Ubuntu), follow the following steps.
Get Bitcoin Package:
apt-add-repository ppa:bitcoin/bitcoin
Update:
apt-get update
Install:
apt-get install bitcoind –y
Reboot:
reboot
After rebooting confirm Bitcoin was installed by checking for the directory ~/.bitc...
<div *ngFor="let item of items; let i = index">
<p>Item number: {{i}}</p>
</div>
In this case, i will take the value of index, which is the current loop iteration.
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 ...
add the following function into .bash_profile, save and exit
function wekaflstart() {
export R_HOME=/Library/Frameworks/R.framework/Resources
java -Xss10M -Xmx4096M -cp :weka.jar weka.gui.knowledgeflow.KnowledgeFlow "$1"
}
inside a directory with a weka.jar file, open its termin...
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'
Camel Case is the practise of writing compound words or phrases where every word begins with Capital letter, without space between word. The function camelize($string) helps to make a string camelized. It converts a string of words separated by spaces or underscores to camel case.
echo camelize('Mc...