Development notes

Thoughts, notes and ideas about development

How to start Ghost as a service on Ubuntu 16.04

Official Ghost documentation Deploying Ghost describes how to start Ghost as a service using script for /etc/init.d. This approach work well only for Ubuntu prior version 16.04. In this tutorial I’ll describe how to start Ghost as a service using new systemd service manager. Requirements Ghost should be already installed. *How to install Ghost described here: How to install Ghost on Ubuntu 16.04. Ghost is installed in /var/www/ghost Create systemd script Open terminal as root (or sudo user). Continue reading

SQL Transactions and ACID

Transaction is a sequence of one or more SQL operations treated as a logical unit. Transaction could be completed either entirely successfully or not executed at all. Transactions and locking are important aspects of database for supporting multiple users. Into this tutorial we’ll take a look atTransaction, ACID, Isolation Levels. ACID Transaction must have the following properties called ACID, which means the following: Atomicity: means that transaction must happen as a single unit and exactly once. Continue reading

PostgreSQL functions

PostgreSQL has a lot of built-in functions, such as Trigonometric Functions, String Functions, IP address functions, etc. But we’re not limited by built-in functions. PostgreSQL (as well as other RDBMS) allows to create custom functions. In this tutorial we will take a look at user-defined functions. PostgreSQL supports the following programming languages for writing functions: SQL PL/pgSQL C PL/Python PL/Tcl some other languages Create functions with PL/pgSQL Functions written in PL/pgSQL can contain a variable declaration, conditional and looping constructions, exception handling and so on. Continue reading

How to install Maven on Windows 10

Maven is build tool primary for Java projects. In this tutorial I will describe how to install maven on Windows 10 operating system. Download and install Java To use maven we need to install Java first. If maven is used for Java projects java jdk should be installed, otherwise jre would be enough. Jdk or Jre could be found here. Download maven After Java (jre or jdk) is installed we need to download Apache Maven from official web site https://maven. Continue reading

Git cheat sheet

2016-11-22 Git Alexey Bogdanov
Git is distributed version control system It is very powerful tool and has a lot of features. Also there’re a lot GUI tools for working with git. But in this post I’ll show how to work with git from terminal (console) in Linux or using git-bash in Windows. The list of commands will be updated periodically. Identifying yourself To add user name and email globally: git config --global "John Doe" git config --global user. Continue reading

PostgreSQL data types cheat sheet

In this tutorial I will show main PostgreSQL data types such as Boolean, Character, Number, Temporal. Also I will describe when and how we can use them. By the way, Postgres is not limited by the mentioned data types. It also supports such types like JSON, Monetary, Geometric, Network Addresses, etc. The full list of supported data types could be found here: Data Types Boolean Data Type The boolean type (could be shortened to bool) can store only 2 possible values true or false and NULLin case when value is unknown. Continue reading

Java: Ambicious method call

2016-10-30 Java Alexey Bogdanov
Ambicious method call error occurs when Java compiler doesn’t know which of the overloaded method to call. Let’s assume that we have the following overloaded methods: first method accepts the String parameter and prints it. The second method accepts Integer parameter and also prints it. public void print(String param) { System.out.println("Printing parameter + "param" + " as String"); } and public void print(Integer param) { System.out.println("Printing parameter + " + param + " as Integer"); } Calling one of the methods into the following way print(null) will attempt to the error like this: Continue reading
Older posts Newer posts