6 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
My high school started a tech lab where students like myself can take apart computers, build circuit boards, learn to program and lots more.
I got the job of building a cluster with 4 old work stations we have. This is just a trial if it works well we can get more work stations.
We have one... (3 Replies)
Discussion started by: PC-2011
3 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file
See the below link-
http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs-
Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies
3. AIX
Hi
I'm logged in as root in an aix box
Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies
4. Solaris
When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies
5. High Performance Computing
In my company, it's fallen on me to serve as the admin of our new HPC cluster, a task that's very new to me. It's very important to me to lay a solid foundation and avoid any unnecessary pitfalls. So, can anyone recommend a succinct guide or list of do's-and-don'ts for adiminstering an HPC cluster?... (0 Replies)
Discussion started by: DBryan
0 Replies
6. What is on Your Mind?
Hello,
I am planning to revise the RSS News subforum areas, here:
News, Links, Events and Announcements - The UNIX Forums
... maybe with a subforum for each OS specific news, like HP-UX, Solaris, RedHat, OSX, etc. RSS subforums....
Please post your favorite OS specific RSS (RSS2) link... (0 Replies)
Discussion started by: Neo
0 Replies
LEARN ABOUT DEBIAN
parse::mediawikidump::links
Parse::MediaWikiDump::Links(3pm) User Contributed Perl Documentation Parse::MediaWikiDump::Links(3pm)
NAME
Parse::MediaWikiDump::Links - Object capable of processing link dump files
ABOUT
This object is used to access content of the SQL based category dump files by providing an iterative interface for extracting the
indidivual article links to the same. Objects returned are an instance of Parse::MediaWikiDump::link.
SYNOPSIS
$pmwd = Parse::MediaWikiDump->new;
$links = $pmwd->links('pagelinks.sql');
$links = $pmwd->links(*FILEHANDLE);
#print the links between articles
while(defined($link = $links->next)) {
print 'from ', $link->from, ' to ', $link->namespace, ':', $link->to, "
";
}
STATUS
This software is being RETIRED - MediaWiki::DumpFile is the official successor to Parse::MediaWikiDump and includes a compatibility library
called MediaWiki::DumpFile::Compat that is 100% API compatible and is a near perfect standin for this module. It is faster in all instances
where it counts and is actively maintained. Any undocumented deviation of MediaWiki::DumpFile::Compat from Parse::MediaWikiDump is
considered a bug and will be fixed.
METHODS
Parse::MediaWikiDump::Links->new
Create a new instance of a page links dump file parser
$links->next
Return the next available Parse::MediaWikiDump::link object or undef if there is no more data left
EXAMPLE
List all links between articles in a friendly way
#!/usr/bin/perl
use strict;
use warnings;
use Parse::MediaWikiDump;
my $pmwd = Parse::MediaWikiDump->new;
my $links = $pmwd->links(shift) or die "must specify a pagelinks dump file";
my $dump = $pmwd->pages(shift) or die "must specify an article dump file";
my %id_to_namespace;
my %id_to_pagename;
binmode(STDOUT, ':utf8');
#build a map between namespace ids to namespace names
foreach (@{$dump->namespaces}) {
my $id = $_->[0];
my $name = $_->[1];
$id_to_namespace{$id} = $name;
}
#build a map between article ids and article titles
while(my $page = $dump->next) {
my $id = $page->id;
my $title = $page->title;
$id_to_pagename{$id} = $title;
}
$dump = undef; #cleanup since we don't need it anymore
while(my $link = $links->next) {
my $namespace = $link->namespace;
my $from = $link->from;
my $to = $link->to;
my $namespace_name = $id_to_namespace{$namespace};
my $fully_qualified;
my $from_name = $id_to_pagename{$from};
if ($namespace_name eq '') {
#default namespace
$fully_qualified = $to;
} else {
$fully_qualified = "$namespace_name:$to";
}
print "Article "$from_name" links to "$fully_qualified"
";
}
perl v5.10.1 2010-12-05 Parse::MediaWikiDump::Links(3pm)