Ajax Timelines and the Semantic Web
Listing 3. Dates and durations are defined in an XML file.
<data>
<event
start="Sep 9 2006 09:00:00 GMT"
end="Sep 14 2006 09:00:00 GMT"
isDuration="true"
title="Visit the Vierzehnheiligen"
image="vierzehnheiligen-thumb.jpg"
>
Visit this impressive church in Germany. More
information can be found at its
<a href=
"http://en.wikipedia.org/wiki/Vierzehnheiligen"
>Wikipedia page</a>.
</event>
<event
start="Sep 16 2006 00:00:00 GMT"
end="Sep 26 2006 00:00:00 GMT"
title="A visit to Versailles?"
image="versailles-thumb.jpg"
link="http://www.chateauversailles.fr/en/"
>
Sometime in this window I should
get out to Versailles.
</event>
<event
start="Sep 30 2006 00:00:00 GMT"
title="Flight back home :("
>
The joy has to end sometime :(
</event>
</data>The default timeline theme is low contrast grey on grey for the font and background with blue highlights for events. This can be customized using a combination of JavaScript and Cascading Style Sheets (CSS), depending on what you want to change. To change the background colors and some of the time bands, you can create an instance of the default theme JavaScript object, make modifications to that object and then pass it to Timeline.createBandInfo(). The font colors are set using CSS.
Listing 4 shows the changes needed for the previous HTML file to modify the band colors and font information. After including the timeline-api, we override two of the CSS classes to change the font color and enlarge the major date markers. The band colors and click bubble size are properties of the theme object. This modified theme object is then passed as a parameter to the Timeline.createBandInfo() function when creating the bands. The result is shown in Figure 2.
Listing 4. A More Lively Theme
<script src=
"http://simile.mit.edu/timeline/api/timeline-api.js"
type="text/javascript"></script>
<style type="text/css">
.timeline-ether-marker-bottom {
width: 5em;
height: 1.5em;
border-left: 1px solid #aaa;
padding-left: 2px;
color: black;
}
.timeline-ether-marker-bottom-emphasized {
width: 5em;
height: 2em;
border-left: 1px solid #aaa;
padding-left: 2px;
color: black;
font-size: 120%;
font-weight: bold;
}
</style>
<script>
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();
var theme = Timeline.ClassicTheme.create();
theme.ether.backgroundColors[0] = '#DFD';
theme.ether.backgroundColors[1] = '#EDD';
theme.ether.highlightColor = '#E00';
theme.ether.highlightOpacity = '30';
theme.event.bubble.width = 520;
theme.event.bubble.height = 120;
var bandInfos = [
Timeline.createBandInfo({
...
intervalPixels: 100,
theme: theme
}),
Timeline.createBandInfo({
...
intervalPixels: 100,
theme: theme
})
};
...syslog is a great source of highly time-related information. Perl makes it easy to convert syslog files into the XML format required by Timeline. In this example, I convert from the format used by /var/log/messages in Fedora Core 5 into a Timeline XML file, shown in Listing 5. The main complication is that, by default, the year is not included in the date and time specification in the syslog file. This makes the regular expression to split the input more complicated, as we want to get the date and time separately, so we can insert the year between them in the output.
Listing 5. Converting a syslog File from stdin into a Timeline XML File on stdout
#!/usr/bin/perl
use XML::Writer;
my $writer = XML::Writer->new();
$writer->xmlDecl();
$writer->startTag('data');
$thisyear=((localtime)[5]+1900);
while( <> ) {
# The if() is all one line.
if( /([a-zA-Z ]+[0-9]+) ([0-9]+
:[0-9]+:[0-9]+) ([^:]+):(.*)/)
{
$date=$1; $time=$2;
$src=$3;
$msg=$4;
$writer->startTag(
'event',
'start' => "$date $thisyear $time",
'title' => $src
);
$writer->characters( $msg );
$writer->endTag('event');
}
}
$writer->endTag('data');
$writer->end();Making the Timeline higher and including three bands makes jumping around in the logs easier, as shown in Listing 6.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- RSS Feeds
- What's the tweeting protocol?
- New Products
- Trying to Tame the Tablet
- Dart: a New Web Programming Experience
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.





14 hours 30 min ago
17 hours 3 min ago
18 hours 20 min ago
18 hours 55 min ago
19 hours 17 min ago
1 day 6 min ago
1 day 52 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 6 hours ago