Posts

Showing posts from April, 2013

Tutorial 5: Some Useful (sample )join queries (specially for monetdb)

select * from (select 'a' as b,'c' as "c") as t1  left join (select 'b' as b,'d' as "d") as t2 using (b); select * from (select 'a' as b,'c' as "c") as t1  left join (select 'a' as b,'d' as "d") as t2 using (b); select * from (select 'a' as b,'c' as "c") as t1 right join (select 'a' as b,'d' as "d") as t2 using(b); select * from (select 'a' as b,'c' as "c") as t1 right join (select 'b' as b,'d' as "d") as t2 using(b); select * from (select 'a' as b,'c' as c) as t1 full join (select 'a' as b,'d' as d) as t2 using (b); select * from (select 'a' as b,'c' as c) as t1 full join (select 'b' as b,'d' as d) as t2 using (b); select * from (select 'a' as b,'c' as "c") as t1 natural full join (se

Tutorial 4: Node.js - common error 1: contentType and undesired downloading

Image
Many of beginners may face problem where they want to show some content and the file gets downloaded (the browser does not show the content in its window). This problem arises because of not setting the content type of response.  It is advisable to set the content type, If no content type is defined browser try to detect the type of content. If it contain some buffer (or any type that browser is not designed to render)  it tries to download the file. Normally it does not happen as most of the time the file is in html (or other browser/plugin known format like images, videos, text, pdf). A small file demonstrating use and effect of setting content type with node.js: var http = require('http'); /*var server = http.createServer(function (request, response) {   response.writeHead(200, {"Content-Type": "text/plain"});   response.end(" \n"); }); var server = http.createServer(function (request, response) {   response.writeHead(200, {"Cont