zip columns from separate files together in bash

NAME paste — merge corresponding or subsequent lines of files SYNOPSIS paste [-s] [-d list] file … DESCRIPTION The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file’s newline characters with a single tab character, and writes the resulting lines to standard output.

LISTEN/NOTIFY using pg_notify(text, text) in PostgreSQL

I have discussed this on the PostgreSQL mailing list (http://archives.postgresql.org/pgsql-bugs/2011-03/msg00041.php) and was informed on the reasoning for the behavior. Their answer is that “..you have to double quote relnames (listen “Test”). if you want the server not to case fold them. pg_notify takes a string, not a relname, which uses different rules.” (Thanks Merlin and … Read more

Error 404: The requested resource is not available using HelloWorld servlet [duplicate]

Try this (if the Java EE V6) package crunch; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; @WebServlet(name=”hello”,urlPatterns={“/hello”}) // added this line public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(“Hello World”); } } now reach the servlet by http://127.0.0.1:8080/yourapp/hello where 8080 is default Tomcat … Read more

Mock variable in function

Just use @patch() to mock out get_complex_data_structure(): @patch(‘module_under_test.get_complex_data_structure’) def test_function_to_test(self, mocked_function): foo_mock = mocked_function.return_value When the test function then calls get_complex_data_structure() a mock object is returned and stored in the local name foo; the very same object that mocked_function.return_value references in the above test; you can use that value to test if do_work() got passed … Read more

Parent pom and microservices

The ‘problem’ with a multi-module parent pom is that, without complicated profiles, it locks the modules in the same release cycle (assuming you’re using the Release Plugin, which you should be). The way I work with Maven is to have a parent pom that declares: common dependencies (logging APIs, JUnit, etc). common plugins. all dependencies … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)