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.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
| Android's Limits | Jun 04, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- Introduction to MapReduce with Hadoop on Linux
- Senior Perl Developer
- Technical Support Rep
- Weechat, Irssi's Little Brother
- UX Designer
- One Tail Just Isn't Enough
- Android's Limits
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?





2 hours 23 min ago
6 hours 34 min ago
6 hours 37 min ago
1 day 2 hours ago
1 day 3 hours ago
1 day 3 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 7 hours ago
1 day 7 hours ago