Template:Mainpage-rssfeeds

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 16:27, 29 July 2006 by Ramuk (Talk | contribs) (Usage:)

Jump to: navigation, search

UNIQae8e525d9662ae70-rss-00000000-QINU UNIQae8e525d9662ae70-rss-00000001-QINU

GISWiki/RSS

Uses an extension from: http://meta.wikimedia.org/wiki/GISWiki/RSS

RSS-Feed Mediawiki extension

  • original by mutante 25.03.2005
  • extended by Duesentrieb 30.04.2005
  • extended by Rdb78 07.07.2005
  • extended by Mafs 10.07.2005, 24.07.2005
  • extended by User:Arcy 07.09.2005
  • Updated for MediaWiki 1.6 by User:piku 13.06.2006
  • Update for Wikicode output, by User:cogdog 14.jul.2006

Requires:

Installation:

  • put this file (rss.php) into the extension directory of your mediawiki installation
  • add the following to the end of LocalSettings.php: include("extensions/rss.php");
  • make sure magpie can be found by PHP.

Usage:

Use one section between <rss>-tags for each feed. The rss section may contain parameters separated by a pipe ("|"), just like links and templates. These parameters are supported:

charset=... The charset used by the feed. iconv is used to convert this.
short Do not show the description text for each news item.
max=x Shows x most recent headlines.
highlight= term1 term2 The terms separated by a space are highlighted.
filter= term1 term2 Show only rss items containing at least one of the terms.
reverse display the rss items in reverse order.
title=x display an alternative title instead of chanel name.
title = none dont display any title.

Example:

<rss>http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5</rss>

NASA Spends 72 Cents of Every SLS Dollar On Overhead Costs, Says Report

Tue, 28 Mar 2017 07:00:00

A new report published by the nonpartisan think tank Center for a New American Security shows us where a lot of NASA's money is being spent. The space agency has reportedly spent $19 billion on rockets -- first on Ares I and V, and now on the Space Launch System rocket -- and $13.9 billion on the Orion spacecraft. If all goes according to plan and NASA is able to fly its first crewed mission with the new vehicles in 2021, "the report estimates the agency will have spent $43 billion before that first flight, essentially a reprise of the Apollo 8 mission around the Moon," reports Ars Technica. "Just the development effort for SLS and Orion, which includes none of the expenses related to in-space activities or landing anywhere, are already nearly half that of the Apollo program." From the report: The new report argues that, given these high costs, NASA should turn over the construction of rockets and spacecraft to the private sector. It buttresses this argument with a remarkable claim about the "overhead" costs associated with the NASA-led programs. These costs entail the administration, management, and development costs paid directly to the space agency -- rather than funds spend on contractors actually building the space hardware. For Orion, according to the report, approximately 56 percent of the program's cost, has gone to NASA instead of the main contractor, Lockheed Martin, and others. For the SLS rocket and its predecessors, the estimated fraction of NASA-related costs is higher -- 72 percent. This means that only about $7 billion of the rocket's $19 billion has gone to the private sector companies, Boeing, Orbital ATK, Aeroject Rocketdyne, and others cutting metal. By comparison the report also estimates NASA's overhead costs for the commercial cargo and crew programs, in which SpaceX, Boeing, and Orbital ATK are developing and providing cargo and astronaut delivery systems for the International Space Station. With these programs, NASA has ceded some control to the private companies, allowing them to retain ownership of the vehicles and design them with other customers in mind as well. With such fixed-price contracts, the NASA overhead costs for these programs is just 14 percent, the report finds.

Share on Google+


Read more of this story at Slashdot.

Climate Change Is Altering Global Air Currents

Tue, 28 Mar 2017 03:30:00

An anonymous reader quotes a report from The Independent: One of the scientists who demonstrated conclusively that global warming was an unnatural event with the famous "hockey stick" graph is now warning that giant jetstreams which circle the planet are being altered by climate change. Jetstreams are influenced by the difference in temperatures between the Arctic and the equator. But the Arctic has been warming much faster than tropical climates -- the island of Svalbard, for example was 6.5 degrees celsius warmer last year compared to the average between 1961 and 1990. The land has also been warming faster than the sea. Both of those factors were changing the flow of these major air currents to create "extreme meanders" which were helping to cause "extreme weather events", Professor Michael Mann said. In a paper in the journal Scientific Reports, Professor Mann and other researchers wrote that evidence of the effect of climate change on the jetstreams had "only recently emerged from the background noise of natural variability." They said that projections of the effect on the jetstreams in "state-of-the-art" climate models were "mirrored" in "multiple" actual temperature measurements. The jetstream normally flows reasonably consistently around the planet, but can develop loops extending north and south. The researchers, who studied temperature records going back to 1870 as well as satellite data, said these loops could grow "very large" or even "grind to a halt" rather than moving from west to east. The effect has been most pronounced during the past 40 years, they found.

Share on Google+


Read more of this story at Slashdot.

New AI Algorithm Beats Even the World's Worst Traffic

Tue, 28 Mar 2017 01:30:00

"Computer scientists at Nanyang Technological University in Singapore have developed a new intelligent routing algorithm that attempts to minimize the occurrence of spontaneous traffic jams -- those sudden snarls caused by greedy merges and other isolated disruptions -- throughout a roadway network," reports Motherboard. "It's both computationally distributed and fast, requirements for any real-world traffic management system. Their work is described in the April issue of IEEE Transactions on Emerging Topics in Computational Intelligence." From the report: The Nanyang researchers' algorithm starts off by just assuming that, given enough traffic density, shit is going to happen. Someone is going to make a greedy merge -- something is going to cause enough of a traffic perturbation to result in a network breakdown. Breakdown in this context is a technical-ish term indicating that for some period of time the traffic outflow from a segment of roadway is going to be less than the traffic inflow. "We assume that the traffic breakdown model has already been given, and the probability of traffic breakdown occurrence is larger than zero (meaning that traffic breakdowns would occur), and our goal is to direct the traffic flow so that the overall traffic breakdown probability is minimized," Hongliang Guo and colleagues write. Put differently, "our objective is to maximize the probability that none of the network links encounters a traffic breakdown." So, the goal of the algorithm is this maximization, which reduces to a fairly tidy equation. It then becomes a machine learning problem. Things get pretty messy at this point, but just understand that we're taking the current traffic load, adding an unknown additional load that might enter the network at any time, and then coming up with probabilities of network breakdown at each of the network's nodes or intersections. Crunch some linear algebra and we wind up with optimal routes through the network. Crucially, Guo and co. were able to come up with some mathematical optimizations that make this kind of calculation feasible in real-time. They were able to demonstrate their algorithm in simulations and are currently working on a further analysis with BMW, which is providing a vast trove of data from its Munich car-sharing fleet. This may not be as distant a technology as it might seem. As it turns out, only 10 percent of cars in a network need to be driving according to the optimizations for those optimizations to have a positive effect on the entire network.

Share on Google+


Read more of this story at Slashdot.

Facebook Launches 'Town Hall' For Contacting Government Reps, Adds Local Election Reminders

Tue, 28 Mar 2017 00:50:00

Facebook has officially launched their "Town Hall" feature that allows users to locate, follow and contact their local, state and federal government representatives. The social media company also announced that they will be launching local election reminders in an effort to get more users to vote in state, county, and municipal elections. TechCrunch reports: The feature was recently made available in the "More" menu on mobile and on desktop to a subset of users. When you launch it, you would be presented with a list of reps at the local, state and federal level, and you could click to visit their Facebook page or send them a message, call them, or email. Not all reps offer their contact information via Facebook, however. And Facebook doesn't yet pull in the missing phone numbers or emails from off-site sources, like official government websites, for example. The company tell us that's something it wants to address in time, though. Today, Town Hall is available to all U.S. Facebook users and some of its features will now be integrated in the News Feed. If you like or comment on a post made by one of your elected officials, a new feature below the comments will invite you to call, message or email the rep. After doing so, users will then be prompted to share a post saying that they contacted the rep, as a means of encouraging their friends to do the same. Facebook says that this Contact Your Rep post is not shown to everyone, but only to those who are also already engaging with an elected official's post, through a like or comment. Additionally, Facebook says it will now offer Election Reminders for local elections. The new, local election reminders will appear for all state, county, and municipal elections in the U.S. in areas with a population of over 10,000 people, and will include both primaries and general elections.

Share on Google+


Read more of this story at Slashdot.

Ask Slashdot: What's the Best Working Environment For a Developer?

Tue, 28 Mar 2017 00:10:00

New submitter Dorgendubal writes: I work for a company with more than a thousand developers and I'm participating in activities aimed at improving the work experience of developers. Our developers receive an ultrabook that is rather powerful but not really adapted for development (no admin rights, small storage capacity, restrictive security rules, etc.). They also have access to VDIs (more flexibility) but often complain of performance issues during certain hours of the day. Overall, developers want to have maximum autonomy, free choice of their tools (OS, IDE, etc.) and access to internal development environments (PaaS, GIT repositories, continuous delivery tools, etc.) . We recently had a presentation of VMWare on desktop and application virtualization (Workstation & Horizon), which is supposedly the future of the desktops. It sounds interesting on paper but I remain skeptical. What is the best working environment for a developer, offering flexibility, performance and some level of free choice, without compromising security, compliance, licensing (etc.) requirements? I would like you to share your experiences on BYOD, desktop virtualization, etc. and the level of satisfaction of the developers.

Share on Google+


Read more of this story at Slashdot.


===rss.php=== 

<?php
# RSS-Feed Mediawiki extension
# 
# original by mutante 25.03.2005
# extended by Duesentrieb 30.04.2005
# extended by Rdb78 07.07.2005
# extended by Mafs  10.07.2005, 24.07.2005
# extended by User:Arcy  07.09.2005
# Updated for MediaWiki 1.6 by User:piku 13.06.2006
# Update for Wikicode output, by User:cogdog 14.jul.2006
#
# Requires: 
#  * magpie rss parser <http://magpierss.sourceforge.net/>
#  * iconv <http://www.gnu.org/software/libiconv/>, see also <http://www.php.net/iconv>
#
# Installation:
#  * put this file (rss.php) into the extension directory of your mediawiki installation 
#  * add the following to the end of LocalSettings.php: include("extensions/rss.php");
#  * make sure magpie can be found by PHP.
#
# Usage:
#  Use one section between <rss>-tags for each feed. The rss section may contain parameters
#  separated by a pipe ("|"), just like links and templates. These parameters are supported:
#
#    * charset=...             The charset used by the feed. iconv is used to convert this.
#    * short                   Do not show the description text for each news item.
#    * max=x                   Shows x most recent headlines.
#    * highlight= term1 term2  The terms separated by a space are highlighted.
#    * filter= term1 term2     Show only rss items containing at least one of the terms.
#    * reverse                 display the rss items in reverse order.
#    * title=x                 display an alternative title instead of chanel name.
#    * title = none            dont display any title.
#
# Example: 
#    <rss>http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5</rss>
#

#change this according to your magpie installation!
require_once('rss_fetch.inc'); 

#install extension hook
$wgExtensionFunctions[] = "wfRssExtension"; 

#extension hook callback function
function wfRssExtension() { 
  global $wgParser;

  #install parser hook for <rss> tags
  $wgParser->setHook( "rss", "renderRss" );
}

#parser hook callback function
function renderRss($input, $argv, $parser = null) {
  if (!$parser) $parser =& $GLOBALS['wgParser'];
  global $wgOutputEncoding;

  $DefaultEncoding = "ISO-8859-1";
  $DisableCache = true;

  # $input = mysql_escape_string($input);

  if (!$input) return ""; #if <rss>-section is empty, return nothing

  #parse fields in rss-section
  $fields= explode("|",$input);
  $url= @$fields[0];

  $args= array();
  for ($i=1; $i<sizeof($fields); $i++) {
    $f= $fields[$i];

    if (strpos($f,"=")===False) $args[strtolower(trim($f))]= False;
    else {
      list($k,$v)= explode("=",$f,2);
      if (trim($v)==False) $args[strtolower(trim($k))] = False; 
      else $args[strtolower(trim($k))]= trim($v);
    }
  }

  #get charset from argument-array    
  $charset= @$args["charset"];
  if (!$charset) $charset= $DefaultEncoding;

  #get max number of headlines from argument-array
  $maxheads = @$args["max"];
  $headcnt = 0;

  #get short-flag from argument-array
  #if short is set, no description text is printed
  if (isset($args["short"])) $short = True; else $short = False;

  #get reverse-flag from argument-array
  if (isset($args["reverse"])) $reverse = True; else $reverse = False;

  #get highlight terms from argument-array    
  $rssHighlight= @$args["highlight"];
  $rssHighlight= str_replace("  "," ", $rssHighlight);
  $rssHighlight= explode(" ", trim($rssHighlight));

  #get filter terms from argument-array    
  $rssFilter= @$args["filter"];
  $rssFilter= str_replace("  "," ", $rssFilter);
  $rssFilter= explode(" ", trim($rssFilter));    

  #fetch rss. may be cached locally.
  #Refer to the documentation of magpie for details.
  $rss = @fetch_rss($url);


  #check for errors.
  if ($rss->ERROR) {
     # return "Feed error"; #localize...
      #return "<div>Failed to load RSS feed from $url: ".$rss->ERROR."</div>"; #localize...
  }

  if (!is_array($rss->items)) {
     # return "Feed error"; #localize...
      #return "<div>Failed to load RSS feed from $url!</div>"; #localize...
  }

  #Bild title line    
  #get title from argument-array    
  
  $rssTitle= @$args["title"];
  $rssTitle= trim($rssTitle);

  if ($rssTitle !=='none') {
    if ($rssTitle=='') {
        $title= iconv($charset,$wgOutputEncoding,$rss->channel['title']);
        if ($rss->channel['link']) $title= "[".$rss->channel['link']." $title]";
        $output = "=== $title ===\n";
    }
    else
    {
      $title= "[".$rss->channel['link']." $rssTitle]";
      $output="=== $title ===\n";
    }
  } else {
      $output="\n\n\n";
  }
  
  if ($reverse) $rss->items = array_reverse($rss->items);

  $description = False; 
  foreach ($rss->items as $item) {
      if ($item['description']) {$description = True; break;}
  }

  #Bild items
  if (!$short and $description) { #full item list

    $output.="";
    foreach ($rss->items as $item) {

      $d_text = true;
      $d_title = true;

      $href = trim(iconv($charset,$wgOutputEncoding,$item['link']));
      $title = trim(iconv($charset,$wgOutputEncoding,$item['title']));

      $d_title = wfRssFilter ($title, $rssFilter);
      $title= wfRssHighlight($title, $rssHighlight);

      #bild description text if desired
      if ($item["description"]) {
        $text= trim(iconv($charset,$wgOutputEncoding,$item['description']));

        #avoid pre-tags
        $text= str_replace("\r"," ",$text);
        $text= str_replace("\n"," ",$text);
        $text= str_replace("\t"," ",$text);

        $d_text = wfRssFilter ($text, $rssFilter);
        $text= wfRssHighlight($text, $rssHighlight);

        $display = $d_text or $d_title;

      }
        else   {
          $text = "";
          $display = $d_title;
        }       

      if ($display) {
        $output.="* [$href $title]";
        if ($text) $output.="<br>$text";
        $output .= "\n";
      }

    #Cut off output when maxheads is reached:
    if (++$headcnt == $maxheads)  break;

    }
    # $output.="</dl>";
  }
  else { #short item list
   #  $output.="<ul>";
    foreach ($rss->items as $item) {
      $href = trim(iconv($charset,$wgOutputEncoding,$item['link']));
      $title = trim(iconv($charset,$wgOutputEncoding,$item['title']));

        $d_title = wfRssFilter ($title, $rssFilter);
        $title= wfRssHighlight($title, $rssHighlight);

        if ($d_title ) $output.="* [$href $title]\n";

      #Cut off output when maxheads is reached:
      if (++$headcnt == $maxheads)  break;
    }
    # $output.="</ul>";
  }


  if ($DisableCache) {

    global $wgVersion;

    # Do not cache this wiki page.
    # for details see http://public.kitware.com/Wiki/User:Barre/MediaWiki/Extensions
    global $wgTitle, $wgDBprefix;
    $ts = mktime();
    $now = gmdate("YmdHis", $ts + 120);
    $ns = $wgTitle->getNamespace();
    $ti = wfStrencode($wgTitle->getDBkey());

    $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion);
    if ($version>14) $sql = "UPDATE $wgDBprefix"."page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'";
    else             $sql = "UPDATE $wgDBprefix"."cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";

    wfQuery($sql, DB_WRITE, "");
  }

  $out = $parser->parse ($output, $parser->mTitle,$parser->mOptions, true, false);
  return $out->getText();
}


function wfRssFilter ($text, $rssFilter) {

  $display = true;

  if (is_array($rssFilter)) {
    foreach($rssFilter as $term) {

      if ($term) {
        $display = false;
        if (preg_match("|$term|i", $text, $a))  {  $display = true; return $display; }
      }
    if ($display) break;
    }
  }
  return $display;
}


function wfRssHighlight($text, $rssHighlight) {

  $i=0;
  $starttag = "v8x5u3t3u8h";
  $endtag   = "q8n4f6n4n4x";

  $color[]="coral";
  $color[]="greenyellow";
  $color[]="lightskyblue";
  $color[]="gold";
  $color[]="violet";

  $count_color = count($color);

  if (is_array($rssHighlight)) {
    foreach($rssHighlight as $term) {
      if ($term) {
        $text = preg_replace("|\b(\w*?".$term."\w*?)\b|i", "$starttag"."_".$i."\\1$endtag", $text);
        $i++;
        if ($i == $count_color) $i=0;
        }
      }
    }
  # to avoid trouble should someone wants to highlight the terms "span", "style", ...
  for ($i=0; $i<5; $i++) {
    $text = preg_replace("|$starttag"."_".$i."|", "<span style=\"background-color:".$color[$i]."; font-weight: bold;\">", $text);
    $text = preg_replace("|$endtag|", "</span>", $text);
    }

  return $text;
}

?>