Dependencies:
GNU Make Version > 3.80
an ISO/ ANSI C-Compiler (e.g. gcc)
an extractor like tar or gzip
zlib-devel
readline-devel oder libedit-devel
Sources:
Link to the latest source (9.6.3)
Now you can extract the source files:
tar -xzvf postgresql-9.6.3.tar.gz
There are a large ...
How to read a netCDF file (.nc) with python gdal ?
import gdal
# Path of netCDF file
netcdf_fname = "/filepath/PREVIMER_WW3-GLOBAL-30MIN.nc"
# Specify the layer name to read
layer_name = "hs"
# Open netcdf file.nc with gdal
ds = gdal.Open("NETCDF:{0}:{1}".f...
Ruby 2.3.0 added the safe navigation operator, &.. This operator is intended to shorten the paradigm of object && object.property && object.property.method in conditional statements.
For example, you have a House object with an address property, and you want to find the street_n...
If you want to get the properties of the file (like the name or the size) you can do it before using the File Reader. If we have the following html piece of code:
<input type="file" id="newFile">
You can access the properties directly like this:
document.getElementById...
Viridis (named after the chromis viridis fish) is a recently developed color scheme for the Python library matplotlib (the video presentation by the link explains how the color scheme was developed and what are its main advantages). It is seamlessly ported to R.
There are 4 variants of color scheme...
Quite often there is a need to glimpse the chosen color palette. One elegant solution is the following self defined function:
color_glimpse <- function(colors_string){
n <- length(colors_string)
hist(1:n,breaks=0:n,col=colors_string)
}
An example of use
color_glimpse(...
The package colorspace provides GUI for selecting a palette. On the call of choose_palette() function the following window pops-up:
When the palette is chosen, just hit OK and do not forget to store the output in a variable, e.g. pal.
pal <- choose_palette()
The output is a function that t...
Function colors() lists all the color names that are recognized by R. There is a nice PDF where one can actually see those colors.
colorRampPalette creates a function that interpolate a set of given colors to create new color palettes. This output function takes n (number) as input and produces a...
Before we get our hands dirty with code, I feel it is necessary to understand how data is stored in firebase. Unlike relational databases, firebase stores data in JSON format. Think of each row in a relational database as a JSON object (which is basically unordered key-value pair). So the column nam...
I am gonna assume you already know about adding gradle dependencies firebase in android studio. If you don't just follow the guide from here. Add your app in firebase console, gradle sync android studio after adding dependencies. All dependencies are not needed just firebase database and firebase au...
Take a use case, like a chat app or a collaborative grocery list app (that basically requires a list of objects to be synced across users). If you use firebase database and add a value event listener to the chat parent node or grocery list parent node, you will end with entire chat structure from th...
In [1]: df = pd.DataFrame({'A': [1, 2, 3], 'B': [1.0, 2.0, 3.0], 'C': ['a', 'b', 'c'],
'D': [True, False, True]})
In [2]: df
Out[2]:
A B C D
0 1 1.0 a True
1 2 2.0 b False
2 3 3.0 c True
Getting a python list from a series:
In [3]: df['...
Magento is a very popular eCommerce application. It offers a great deal of customization and abilities from initial install. Here are a few suggestions for optimizing a Magento installation.
Enabling Output Compression
In your .htaccess file for Magento you will find a section of text starting wit...
The model Magento uses to store customer and product data results in longer than average SQL queries and more reads. Enabling the Flat Catalog option for Categories and Products will merge product data into one table, therefore improving performance.
Login to your administration area and go to – Sy...
Given coins of different denominations and a total, in how many ways can we combine these coins to get the total? Let's say we have coins = {1, 2, 3} and a total = 5, we can get the total in 5 ways:
1 1 1 1 1
1 1 1 2
1 1 3
1 2 2
2 3
The problem is closely related to knapsack problem. The o...
Given coins of different denominations and a total, how many coins do we need to combine to get the total if we use minimum number of coins? Let's say we have coins = {1, 5, 6, 8} and a total = 11, we can get the total using 2 coins which is {5, 6}. This is indeed the minimum number of coins require...
The caching problem arises from the limitation of finite space. Lets assume our cache C has k pages. Now we want to process a sequence of m item requests which must have been placed in the cache before they are processed.Of course if m<=k then we just put all elements in the cache and it will wo...
Adding the aurelia-configuration to a cli application sometimes produces a build error. This is caused by a missing dependency so we simply add the dependency to the build bundle.
Try the following:
npm install deep-extend --save
npm install aurelia-configuration --save
Now add the followi...
Two-element tuples
(,) is an example of a type that has a Bifunctor instance.
instance Bifunctor (,) where
bimap f g (x, y) = (f x, g y)
bimap takes a pair of functions and applies them to the tuple's respective components.
bimap (+ 2) (++ "nie") (3, "john") --> (5,...