Related to : loop to calculate timestamps

How to do loops with timestamps in a PostgreSQL function? 
I am assumming that `tposted dates are unique within the table.
Under this assumption the following query should work:
select t2.tposted, t1.record,
'< carried forward' as comment
from dx t1
join dx t2
on t1.chronic='True' and t1.tposted < t2.tposted
union all
select tposted, record, null
from dx
order by tposted, comment, record
Demo: http://sqlfiddle.com/#!15/e6456/17
If this

Storing Timestamps as two 32 bit words (pcapng format) 
I found the solution to the problem.
The timestamp was indeed correctly stored as milliseconds, however, I
did not store the ts_resol option correctly in the interface header
block. I simply stored a 32 bit aligned value (integer) as the option
value. Which is wrong, as the specification states that the most
significant bit determines the value of the timestamp resolution.
The solution was thus

How to use the Computed Value to calculate another 
You have to repeat the expression
Select cost ,
(service_charge*(costDiscount)) as service_charge ,
(service_tax*(costDiscount+((service_charge*(costDiscount))*(costDiscount))))
as service_tax
From VENDOR_ITEMS WHERE vendor_items_id = 264

why is distanceTo() not enough to calculate distance? 
6371.0 looks like the Earth's radius in km. Multiplying by Math.PI /
180 converts degrees to radians.
This is turning a distance in radians to kilometers.

Calculate Max of Sum Product of D3 array 
One way you can load your data as a text, and latter use
d3.csv.parseRows to parse your CSV as an array of arrays. So just take
the slice, ignoring the first 3 columns.
d3.text('data.csv', function(text)
{
var rows = d3.csv.parseRows(text, function(row, index)
{
// skip header, coerce to Number values
if(index > 0)
{
return row.map(Number);
}
});
var extent = rows
