All of the interesting technological, artistic or just plain fun subjects I'd investigate if I had an infinite number of lifetimes. In other words, a dumping ground...

Wednesday 30 April 2008

Postgresql - versioning the schema and running totals, sums and moving averages

Robert Treat

http://people.planetpostgresql.org/xzilla/index.php?/archives/341-getddl-now-available.htmlgetddl now available

One common discussion we see on the postgresql mailing lists is that of how to track changes and do versioning of schema within a database. One of the common solutions offered is the idea of grabbing schema from the system catalogs, writing it to a file, and then committing that to svn. In theory you could write an elegant tool for such a task, but given the number of times someone has asked me to send them a copy of the script we use at OmniTI, I'm guess that even the hacky script we use will probably be helpful. To that end, I've finally gone ahead and put a public copy of our getddl tool up on labs. Be aware that the script has some issues; I've include a TODO of some items that I'd like to see improved, but it meets our current needs, so you're better off writing patches than waiting for a new release (;-)), but hopefully it will still be of some value.

Leo Hsu and Regina Obe

How to calculate Running Totals and Sums in SQL

People have asked us how to calculate running totals a number of times; not a lot but enough that we feel we should document the general technique. This approach is fairly ANSI-SQL standard and involves using SELF JOINS. In a later article we shall describe how to calculate moving averages which follows a similar technique but with some extra twists.

Note that the below examples can also be done with a correlated sub-select in the SELECT clause and in some cases that sometimes works better. Perhaps we shall show that approach in a later issue. We tend to prefer the look of the SELF JOIN though and in practice it is generally more efficient since its easier for planners to optimize and doesn't always result in a nested loop strategy. Just feels a little cleaner and if you are totaling a lot of columns (e.g number of items, products) etc, much more efficient.



Tuesday 29 April 2008

Literate Programming

http://www.literateprogramming.com/

Donald Knuth. "Literate Programming (1984)" in Literate Programming. CSLI, 1992, pg. 99.

I believe that the time is ripe for significantly better documentation of programs, and that we can best achieve this by considering programs to be works of literature. Hence, my title: "Literate Programming."

Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

The practitioner of literate programming can be regarded as an essayist, whose main concern is with exposition and excellence of style. Such an author, with thesaurus in hand, chooses the names of variables carefully and explains what each variable means. He or she strives for a program that is comprehensible because its concepts have been introduced in an order that is best for human understanding, using a mixture of formal and informal methods that reinforce each other.


http://www-cs-faculty.stanford.edu/~knuth/cweb.html
http://www.amazon.com/Literate-Programming-Center-Language-Information/dp/0937073806/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1208825413&sr=1-1
http://www.google.com.au/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Fwww.codesourcery.com%2Fvsiplplusplus&ei=b50WSJ6iDJqYoQSplaiQAg&usg=AFQjCNHTSRxmKfTemxCOKWoXHC1M4vwq6Q&sig2=OQj0AIdV1HXYTYD9nkRl1A

More NTP

http://www.schlitt.net/scripts/ntp/index.html

NTP management scripts

I've been participating in the NTP pool project since July 2003, and during this time, I've developed a few scripts to help monitor and manage NTP stuff. I figure that these scripts might be useful to others, so I'm posting them here, but please don't expect anything fancy. The documentation is bad, there are few comments, and they haven't been tested on any machine other than mine. Feel free to use the scripts for anything you want. They are in the public domain.

I recommend getting at least ntp_clients, ntp_clients_stats, and ntp_pool_dns. These can all be downloaded via ntp_scripts.tar.gz.


http://gpsd.mainframe.cx/
This is a gpsd server in a really bad location beautiful suburban Sunnyvale. Very poor visibility from here: view1.png view2.png The hardware is a Garmin GPS18/LVC attached to a Soekris Net4801 (view the dmesg). running OpenBSD, gpsd and some custom utilities This machine is maintained by Chris Kuethe.

http://tycho.usno.navy.mil/gpstt.html

USNO GPS Time Transfer



The U.S. Naval Observatory (USNO) monitors the timing of the GPS to provide a reliable and stable coordinated time reference for the satellite navigation system. The USNO provides two modes of operation to monitor the GPS: the Standard Positioning Service (SPS) and the Precise Positioning Service (PPS). The USNO SPS consists of a coarse acquisition (C/A) code, single channel timing receiver and the processed data are available on the USNO GPS timing data website http://tycho.usno.navy.mil/gps_datafiles.html.

IGS Products

The IGS collects, archives, and distributes GPS and GLONASS observation data sets of sufficient accuracy to meet the objectives of a wide range of scientific and engineering applications and studies. These data sets are analyzed and combined to form the IGS products shown in the table below.

IGS products support scientific activities such as improving and extending the International Terrestrial Reference Frame (ITRF) maintained by the International Earth Rotation and Reference Systems Service (IERS), monitoring deformations of the solid Earth and variations in the liquid Earth (sea level, ice sheets, etc.) and in Earth rotation, determining orbits of scientific satellites, and monitoring the troposphere and ionosphere.

http://www.penninespringmusic.co.uk/rich/software/

Wednesday 23 April 2008

Ext js - javascript library

Ext JS 2.0 Samples


 
View Samples

Combination Samples

Feed Viewer 2.0

RSS 2.0 feed reader sample application that features a swappable reader panel layout.

Simple Tasks 2.0

Complete personal task management application sample that runs on Adobe AIR.

Simple Tasks

Personal task management application sample that uses Google Gears for data storage.

Image Organizer

DataView and TreePanel sample that demonstrates dragging data items from a DataView into a TreePanel.

Web Desktop

Demonstrates how one could build a desktop in the browser using Ext components including a module plugin system.

Grids

Basic Array Grid

A basic read-only grid loaded from local array data that demonstrates the use of custom column renderer functions.

Editable Grid

An editable grid loaded from XML that shows multiple types of grid ediors as well as defining custom data records.

XML Grid

A simple read-only grid loaded from XML data.

Paging

A grid with paging, cross-domain data loading and custom- rendered expandable row bodies.

Grouping

A basic grouping grid showing collapsible data groups that can be customized via the "Group By" header menu option.

Live Group Summary

Advanced grouping grid that allows cell editing and includes custom dynamic summary calculations.

Grid Plugins

Multiple grids customized via plugins: expander rows, checkbox selection and row numbering.

Grid Filtering

Grid plugins providing custom data filtering menus that support various data types.

Grid From Markup

Custom GridPanel extension that can convert a plain HTML table into a dynamic grid at runtime.

Grid Data Binding (basic)

Data binding a grid to a detail preview panel via the grid's RowSelectionModel.

Grid Data Binding (advanced)

Refactoring the basic data binding example to use a class-based application design model.

Tabs

Basic Tabs

Basic tab functionality including autoHeight, tabs from markup, Ajax loading and tab events.

Advanced Tabs

Advanced tab features including tab scrolling, adding tabs programmatically and a context menu plugin.

Windows

Hello World

Simple "Hello World" window that contains a basic TabPanel.

MessageBox

Different styles include confirm, alert, prompt, progress and wait and also support custom icons.

Layout Window

A window containing a basic BorderLayout with nested TabPanel.

Trees

Drag and Drop Reordering

A TreePanel loaded asynchronously via a JSON TreeLoader that shows drag and drop with container scroll.

Multiple trees

Drag and drop between two different sorted TreePanels.

Column Tree

A custom TreePanel implementation that demonstrates extending an existing component.

Layout Managers

Layout Browser

Includes examples for each standard Ext layout, several custom layouts and combination examples.

Border Layout

A complex BorderLayout implementation that shows nesting multiple components and sub-layouts.

Anchor Layout

A simple example of anchoring form fields to a window for flexible form resizing.

Portal Demo

A page layout using several custom extensions to provide a web portal interface.

ComboBox

Basic ComboBox

Basic combos, combos rendered from markup and customized list layout to provide item tooltips.

ComboBox Templates

Customized combo with template-based list rendering, remote loading and paging.

Forms

Dynamic Forms

Various example forms showing collapsible fieldsets, column layout, nested TabPanels and more.

Ajax with XML Forms

Ajax-loaded form fields from remote XML data and remote field validation on submit.

Custom Search Field

A TriggerField search extension combined with an XTemplate for custom results rendering.

Binding a Grid to a Form

A grid embedded within a FormPanel that automatically loads records into the form on row selection.

Advanced Validation

Relational form field validation using custom vtypes.

Toolbars and Menus

Basic Toolbar

Toolbar and menus that contain various components like date pickers, color pickers, sub-menus and more.

Ext Actions

Bind the same behavior to multiple buttons, toolbar and menu items using the Ext.Action class.

Templates and DataView

Templates

A simple example of rendering views from templates bound to data objects.

DataView

A basic DataView with custom plugins for editable labels and drag selection of items.

DataView (advanced)

A more customized DataView supporting sorting and filtering with multiple templates.

Miscellaneous

StatusBar

A simple StatusBar that can be dropped into the bottom of any panel to display status text and icons.

StatusBar (advanced)

Customizing the StatusBar via a plugin to provide automatic form validation monitoring and error linking.

Slider

A slider component that supports vertical mode, snapping, tooltips, customized styles and more.

Custom Drag and Drop

Enabling drag and drop between a DataView and a grid using DragZone and DropZone extensions.

QuickTips

Various tooltip and quick tip configuration options including Ajax loading and mouse tracking.

Progress Bar

A basic progress bar component shown in various configurations and with custom styles.

Panels

A basic collapsible panel example.

Resizable

Examples of making any element resizable with various configuration options.

Spotlight

A utility for masking everything except a single element on the page to visually highlight it.

Localization (static)

Demonstrates fully localizing a form by including a custom locale script.

Localization (dynamic)

Dynamically render various Ext components in different locales by selecting from a locale list.

© 2006-2008 Ext, LLC

tim's shared items

Add to Google Reader or Homepage