cli for postgres in linux

If  your PostgreSQL server is not started, start it with the following command. sudo service postgresql start To getting started with postgreSQL, open your Terminal, and type: username$ sudo su – postgres Now you are logged into your vm with the postgres user. Then connect to template1 database using the postgresql’s psql client: postgres ~$…

partition key, composite key and clustering key in Cassandra

There is a lot of confusion around this, I will try to make it as simple as possible. The primary key is a general concept to indicate one or more columns used to retrieve data from a Table. The primary key may be SIMPLE create table stackoverflow ( key text PRIMARY KEY, data text );…

spring injection variable setter constructor

1 field.  @Autowired     private Point center; 2 setter.  @Autowired     public void setCenter(Point center) {         this.center = center;     } If you weren’t using autowiring, there is a big difference between constructor and setter injection. You write the XML differently in order to inject the dependencies. And setter injection dependencies are optional while constructor injection dependencies are…

Spring 4 MVC ContentNegotiatingViewResolver example

This article demonstrates supporting multiple output formats for your Spring 4 MVC application using Spring’sContentNegotiatingViewResolver. We will be generating application output in XML, JSON, PDF, XLS and HTML format, all using Annotation based configuration. ContentNegotiatingViewResolver is an implementation of ViewResolver, which uses the requested media type (based on filetype extension, URL parameter specifying type of…

git pull fetch merge

Difference In the simplest terms, git pull does a git fetch followed by a git merge. You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I…

Security Stocks Bond Equities Shares 区别

Securities:证券,是各类财产所有权或债权凭证的通称,是用来证明证券持有人有权依票面所载内容,取得相就权益的凭证。所以,证券的本质是一种交易契约或合同,该契约或合同赋予合同持有人根据该合同的规定,对合同规定的标的采取相应的行为,并获得相应的收益的权利。按其性质不同可将证券分为证据证券,凭证证券和有价证券。有价证券又可分为:(1)资本证券,如股票、债券等;(2)货币证券,包括银行券、银行票据等;(3)财物证券,如货运单、提单、栈单等。 An instrument representing ownership (stocks), a debt agreement (bonds) or the rights to ownership (derivatives). A security is essentially a contract that can be assigned a value and traded. Examples of a security include a note, stock, preferred share, bond, debenture, option, future, swap, right, warrant, or virtually any other financial asset. Securities are…

PUT or POST: The REST API

The crux of the issue comes down to a concept known as idempotency. An operation is idempotent if a sequence of two or more of the same operation results in the same resource state as would a single instance of that operation. According to the HTTP 1.1 specification, GET, HEAD, PUT and DELETE are idempotent,…

Use fish shell as login shell in Ubuntu

Install fish first Then the change shell command makes fish the default shell. chsh -s /usr/bin/fish​ If the fish is not there, use ‘which fish’ to locate it first and then chsh -s to it. install wahoo curl -L git.io/wa | sh Wahoo is an all-purpose framework for the fishshell. It looks after your configuration, themes and…

inspect angularjs scope controller in chrome(webkit)

Pick an element in the HTML panel of the developer tools and type this in the console angular.element($0).scope() In webkit $0 is a reference to the selected DOM node in the elements tab, so by doing this you get the selected DOM node scope printed out in the console Also you could assign this to…

angularjs form validation

Official documentation is pretty good. novalidate is used to disable browser’s native form validation. A form is an instance of FormController. The form instance can optionally be published into the scope using the name attribute. Similarly, an input control that has the ngModel directive holds an instance of NgModelController. Such a control instance can be…