|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
select tposted, record, null
order by tposted, comment, record
|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*(cost-Discount)) as service_charge ,
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.
var rows = d3.csv.parseRows(text, function(row, index)
// skip header, coerce to Number values
if(index > 0)
var extent = rows