分页: 7/19 第一页 上页 2 3 4 5 6 7 8 9 10 11 下页 最后页 [ 显示模式: 摘要 | 列表 ]

PHP运行到Windows上的几个弊端 不指定

admin , 2010/05/04 15:49 , PHP , 评论(0) , 阅读(364) , Via 宝华的博客 原创
PHP是Linux的原生服务,运行到Windows上究竟有什么不好呢?

尽管PHP是一个多平台语言,在Windows上运行PHP还是一个挑战。这是因为PHP是基于UNIX平台开发的,每个请求由一个不同的进程来处理。然 而在Windows平台下面,同一类型的请求是由同一进程的不同线程来处理的。这个区别意味运行着PHP的IIS的频繁崩溃。进一步来说,对这一问题的唯 一的解决方案就是把PHP运行在外部方式下(CGI)。最终导致PHP性能的降低。关键问题还是以下几点:

多线程:
PHP原生为多处理器环境(APACHE),因此最常用于LAMP (Linux, Apache, MySQL, PHP) 平台。windows的工作方式不同,web服务器,不管是iis还是apache都是多线程运行,即一个处理器上跑所有客户请求。为了使php在 多线服务器上跑的好,必须考虑线程安全的问题。如果线程安全处理失败,会导致php运行不稳定是当然的,同时是iis或apache崩溃的情况也经常发 生。还有更糟糕,一个崩溃的线程会导致整个web服务器挂掉,这也是为什么iis进程池会频繁的崩溃。相对于多进程环境,就算一个进程崩溃又有什么关系, 第web 服务器没有影响,下一个请求来的时候自动唤醒一个新的进程就可以了,就跟没发生过一样。时至今日,唯一防止php在windows上崩溃的做法还是把 php设置为外部CGI,但会比ISAPI慢很多。

CGI:
CGI表示 “通用网关接口”。CGI是一个联接平台,用于web服务器和web应用程序之前的对话连接,PHP就是CGI。CGI按照web服务器的应用标准被创 建,接口的好处是简单,更重要是和开发语言无关,而且相互直接是隔离的。这种隔离方式有效的阻止了崩溃程序错误引起的web服务器崩溃。要知道2003 sp2之前的asp程序错误会异常频繁引起整个web服务器崩溃,可想而知当时的主机商是生活在地狱中一样。CGI并都是好处,显著地缺点是-严重的拖慢 服务器性能。CGI 机制本身就包含了巨大的系统开销,为一个新的请求生成PHP进程的初始化工作最终导致了极端的性能地下,一个新进程的生成需要的内存分配和代码载入对于每 次http请求都要重复一次,而且请求结束后还会清理掉,对操作系统来说是严重的拖累。

本地web服务器模块:
为了解决CGI的性能问题,web服务器提供商会提供为web服务器提供API。知名的API包括netscape的NSAPI和MS的ISAPI. 这些API支持PHP跑在几个服务进程里面,每个处理进程处理一组请求,而不是一个,这样做能节约进程初始化的过多开销。API运行在单个处理器上,但不 是多线程的服务器。当部分PHP被修改成线程安全的,那线程安全版本绝不会比多进程版更稳定和高效。一个php中的一个小错,不管来自于一个模块调用,或 第三方库,都可能导致线程挂掉,并传播到整个服务器线程导致web 服务器停止。这点从IIS的进程池监控可以看出来,在LInux上并不需要这个监管程序。为此,在windows上使用本地服务模块或插件,不管是 apache还是iis,都被证明是不具备大规模的应用价值,常常会不可预期的出现崩溃,即使使用ISAPI模式。
原文地址:http://freezingsun.com/news/domain-email/
之前,冰点阳光工作室的域名邮箱一直使用的是腾讯的QQ域名邮箱服务。如今网易推出了免费的企业域名邮箱,工作室将freezingsun.com的MX记录修改到了ym.163.com,在此感谢网易的免费提供。
目前网易的企业域名邮箱还是测试版,很多功能不是很完善,但是对于我们来说已经可以满足了。
网易将在不久的将来,会推出个性化域名登录邮箱的服务,以及提供一些用户注册的服务。
目前还不提供用户注册功能,只能由管理员手动添加用户,有需要的用户可以发送邮件到:webmaster@freezingsun.com,进行注册@.freezingsun.com的域名。

在面板中使用HTML的Demo 不指定

admin , 2010/04/28 21:59 , Java开发 , 评论(0) , 阅读(347) , Via 宝华的博客 原创
新建一个HtmlDemo类
以下是源码

package components;

/* HtmlDemo.java needs no other files. */

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class HtmlDemo extends JPanel
                      implements ActionListener {
    JLabel theLabel;
    JTextArea htmlTextArea;

    public HtmlDemo() {
        setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));

        String initialText = "<html>\n" +
                "Color and font test:\n" +
                "<ul>\n" +
                "<li><font color=red>red</font>\n" +
                "<li><font color=blue>blue</font>\n" +
                "<li><font color=green>green</font>\n" +
                "<li><font size=-2>small</font>\n" +
                "<li><font size=+2>large</font>\n" +
                "<li><i>italic</i>\n" +
                "<li><b>bold</b>\n" +
                "</ul>\n";

        htmlTextArea = new JTextArea(10, 20);
        htmlTextArea.setText(initialText);
        JScrollPane scrollPane = new JScrollPane(htmlTextArea);

        JButton changeTheLabel = new JButton("Change the label");
        changeTheLabel.setMnemonic(KeyEvent.VK_C);
        changeTheLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
        changeTheLabel.addActionListener(this);

        theLabel = new JLabel(initialText) {
            public Dimension getPreferredSize() {
                return new Dimension(200, 200);
            }
            public Dimension getMinimumSize() {
                return new Dimension(200, 200);
            }
            public Dimension getMaximumSize() {
                return new Dimension(200, 200);
            }
        };
        theLabel.setVerticalAlignment(SwingConstants.CENTER);
        theLabel.setHorizontalAlignment(SwingConstants.CENTER);

        JPanel leftPanel = new JPanel();
        leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.PAGE_AXIS));
        leftPanel.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder(
                    "Edit the HTML, then click the button"),
                BorderFactory.createEmptyBorder(10,10,10,10)));
        leftPanel.add(scrollPane);
        leftPanel.add(Box.createRigidArea(new Dimension(0,10)));
        leftPanel.add(changeTheLabel);

        JPanel rightPanel = new JPanel();
        rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.PAGE_AXIS));
        rightPanel.setBorder(BorderFactory.createCompoundBorder(
                        BorderFactory.createTitledBorder("A label with HTML"),
                        BorderFactory.createEmptyBorder(10,10,10,10)));
        rightPanel.add(theLabel);

        setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
        add(leftPanel);
        add(Box.createRigidArea(new Dimension(10,0)));
        add(rightPanel);
    }

    //React to the user pushing the Change button.
    public void actionPerformed(ActionEvent e) {
        theLabel.setText(htmlTextArea.getText());
    }

    /**
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event dispatch thread.
     */
    private static void createAndShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("HtmlDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Add content to the window.
        frame.add(new HtmlDemo());

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event dispatch thread:
        //creating and showing this application's GUI.
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                //Turn off metal's use of bold fonts
          UIManager.put("swing.boldMetal", Boolean.FALSE);
          createAndShowGUI();
            }
        });
    }
}

Tags: , ,

Resin 4.0.6支持IPV6 不指定

admin , 2010/04/28 21:33 , 软件工具 , 评论(0) , 阅读(296) , Via 宝华的博客 原创
the open source Web Profile leader for Java EE application server, announced today that Resin 4.0.6 features support for IPv6, Internet Protocol Version 6.

IPv6 is the next-generation Internet protocol that addresses the issue of IPv4 address exhaustion with added benefits of improved network auto-configuration, routing and security. Government and business mandates across the globe are increasing demand for the technology in a variety of applications, including the web and enterprise spaces. Rapid growth in Asian network infrastructure is driving heavy regional investment, requiring compatibility throughout hardware and software stacks.

“Caucho is poised to support our international customers and partners in their transitions to IPv6,” said Emil Ong, Chief Evangelist of Caucho Technology. “We share a close technological relationship with our customers. When one of our partners in Japan recently requested enhanced IPv6 support, we responded quickly with the release of Resin 4.0.6.” Ong added, “because of our developer-driven culture at Caucho, we are able to address our users’ needs with incredibly fast turnaround.”

Resin, Caucho’s open source Java application server, features Hessian serialization protocol and Quercus Java-PHP solutions. Resin is the Web Profile of choice for high performance Java EE applications. Leading companies including Salesforce, the Toronto Stock Exchange and CNET uses Resin to power web applications with high demands for reliability and performance.
Resin 4.0.6下载地址:
Pro版本:

TAR.GZ版本

Ubuntu用户下载版本

用PHP生成RSS实例 不指定

admin , 2010/04/28 20:14 , PHP , 评论(0) , 阅读(434) , Via 宝华的博客 原创

<?php
/**
* rss操作类
*
* FeedCreator class v1.7.2
* originally (c) Kai Blankenhorn
* www.bitfolge.de
* kaib@bitfolge.de
*
*/
// your local timezone, set to "" to disable or for GMT
define("TIME_ZONE","");
/**
* Version string.
**/
define("FEEDCREATOR_VERSION", "www.273.cn");
/**
* A FeedItem is a part of a FeedCreator feed.
*
* @author Kai Blankenhorn <kaib@bitfolge.de>
* @since 1.3
*/
class FeedItem extends HtmlDescribable {
/**
  * Mandatory attributes of an item.
  */
var $title, $description, $link;

/**
  * Optional attributes of an item.
  */
var $author, $authorEmail, $image, $category, $comments, $guid, $source, $creator;

/**
  * Publishing date of an item. May be in one of the following formats:
  *
  * RFC 822:
  * "Mon, 20 Jan 03 18:05:41 +0400"
  * "20 Jan 03 18:05:41 +0000"
  *
  * ISO 8601:
  * "2003-01-20T18:05:41+04:00"
  *
  * Unix:
  * 1043082341
  */
var $date;

/**
  * Any additional elements to include as an assiciated array. All $key => $value pairs
  * will be included unencoded in the feed item in the form
  *     <$key>$value</$key>
  * Again: No encoding will be used! This means you can invalidate or enhance the feed
  * if $value contains markup. This may be abused to embed tags not implemented by
  * the FeedCreator class used.
  */
var $additionalElements = Array();
// on hold
// var $source;
}

/**
* An FeedImage may be added to a FeedCreator feed.
* @author Kai Blankenhorn <kaib@bitfolge.de>
* @since 1.3
*/
class FeedImage extends HtmlDescribable {
/**
  * Mandatory attributes of an image.
  */
var $title, $url, $link;

/**
  * Optional attributes of an image.
  */
var $width, $height, $description;
}

/**
* An HtmlDescribable is an item within a feed that can have a description that may
* include HTML markup.
*/
class HtmlDescribable {
/**
  * Indicates whether the description field should be rendered in HTML.
  */
var $descriptionHtmlSyndicated;

/**
  * Indicates whether and to how many characters a description should be truncated.
  */
var $descriptionTruncSize;

/**
  * Returns a formatted description field, depending on descriptionHtmlSyndicated and
  * $descriptionTruncSize properties
  * @return    string    the formatted description  
  */
function getDescription() {
  $descriptionField = new FeedHtmlField($this->description);
  $descriptionField->syndicateHtml = $this->descriptionHtmlSyndicated;
  $descriptionField->truncSize = $this->descriptionTruncSize;
  return $descriptionField->output();
}
}
/**
* An FeedHtmlField describes and generates
* a feed, item or image html field (probably a description). Output is
* generated based on $truncSize, $syndicateHtml properties.
* @author Pascal Van Hecke <feedcreator.class.php@vanhecke.info>
* @version 1.6
*/
class FeedHtmlField {
/**
  * Mandatory attributes of a FeedHtmlField.
  */
var $rawFieldContent;

/**
  * Optional attributes of a FeedHtmlField.
  *
  */
var $truncSize, $syndicateHtml;

/**
  * Creates a new instance of FeedHtmlField.
  * @param  $string: if given, sets the rawFieldContent property
  */
function FeedHtmlField($parFieldContent) {
  if ($parFieldContent) {
   $this->rawFieldContent = $parFieldContent;
  }
}
  
  /**
  * Creates the right output, depending on $truncSize, $syndicateHtml properties.
  * @return string    the formatted field
  */
function output() {
  // when field available and syndicated in html we assume
  // - valid html in $rawFieldContent and we enclose in CDATA tags
  // - no truncation (truncating risks producing invalid html)
  if (!$this->rawFieldContent) {
   $result = "";
  } elseif ($this->syndicateHtml) {
   $result = "<![CDATA[".$this->rawFieldContent."]]>";
  } else {
   if ($this->truncSize and is_int($this->truncSize)) {
    $result = FeedCreator::iTrunc(htmlspecialchars($this->rawFieldContent),$this->truncSize);
   } else {
    $result = htmlspecialchars($this->rawFieldContent);
   }
  }
  return $result;
}
}

/**
* UniversalFeedCreator lets you choose during runtime which
* format to build.
* For general usage of a feed class, see the FeedCreator class
* below or the example above.
*
* @since 1.3
* @author Kai Blankenhorn <kaib@bitfolge.de>
*/
class UniversalFeedCreator extends FeedCreator {
var $_feed;

function _setFormat($format) {
  switch (strtoupper($format)) {
  
   case "2.0":
    // fall through
   case "RSS2.0":
    $this->_feed = new RSSCreator20();
    break;
  
   case "0.91":
    // fall through
   case "RSS0.91":
    $this->_feed = new RSSCreator091();
    break;
  
   default:
    $this->_feed = new RSSCreator091();
    break;
  }
        
  $vars = get_object_vars($this);
  foreach ($vars as $key => $value) {
   // prevent overwriting of properties "contentType", "encoding"; do not copy "_feed" itself
   if (!in_array($key, array("_feed", "contentType", "encoding"))) {
    $this->_feed->{$key} = $this->{$key};
   }
  }
}

/**
  * Creates a syndication feed based on the items previously added.
  *
  * @see        FeedCreator::addItem()
  * @param    string    format    format the feed should comply to. Valid values are:
  *   "PIE0.1", "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3", "HTML", "JS"
  * @return    string    the contents of the feed.
  */
function createFeed($format = "RSS0.91") {
  $this->_setFormat($format);
  return $this->_feed->createFeed();
}


  /**
  * Saves this feed as a file on the local disk. After the file is saved, an HTTP redirect
  * header may be sent to redirect the use to the newly created file.
  * @since 1.4
  *
  * @param string format format the feed should comply to. Valid values are:
  *   "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM", "ATOM0.3", "HTML", "JS"
  * @param string filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
  * @param boolean displayContents optional send the content of the file or not. If true, the file will be sent in the body of the response.
  */
function saveFeed($format="RSS0.91", $filename="", $displayContents=true) {
  $this->_setFormat($format);
  $this->_feed->saveFeed($filename, $displayContents);
}

   /**
    * Turns on caching and checks if there is a recent version of this feed in the cache.
    * If there is, an HTTP redirect header is sent.
    * To effectively use caching, you should create the FeedCreator object and call this method
    * before anything else, especially before you do the time consuming task to build the feed
    * (web fetching, for example).
    *
    * @param   string   format   format the feed should comply to. Valid values are:
    *       "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3".
    * @param filename   string   optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
    * @param timeout int      optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)
    */
   function useCached($format="RSS0.91", $filename="", $timeout=3600) {
      $this->_setFormat($format);
      $this->_feed->useCached($filename, $timeout);
   }
}

/**
* FeedCreator is the abstract base implementation for concrete
* implementations that implement a specific format of syndication.
*
* @abstract
* @author Kai Blankenhorn <kaib@bitfolge.de>
* @since 1.4
*/
class FeedCreator extends HtmlDescribable {
/**
  * Mandatory attributes of a feed.
  */
var $title, $description, $link;


/**
  * Optional attributes of a feed.
  */
var $syndicationURL, $image, $language, $copyright, $pubDate, $lastBuildDate, $editor, $editorEmail, $webmaster, $category, $docs, $ttl, $rating, $skipHours, $skipDays;
/**
* The url of the external xsl stylesheet used to format the naked rss feed.
* Ignored in the output when empty.
*/
var $xslStyleSheet = "";


/**
  * @access private
  */
var $items = Array();
  

/**
  * This feed's MIME content type.
  * @since 1.4
  * @access private
  */
var $contentType = "application/xml";


/**
  * This feed's character encoding.
  * @since 1.6.1
  **/
var $encoding = "utf-8";


/**
  * Any additional elements to include as an assiciated array. All $key => $value pairs
  * will be included unencoded in the feed in the form
  *     <$key>$value</$key>
  * Again: No encoding will be used! This means you can invalidate or enhance the feed
  * if $value contains markup. This may be abused to embed tags not implemented by
  * the FeedCreator class used.
  */
var $additionalElements = Array();
  
    
/**
  * Adds an FeedItem to the feed.
  *
  * @param object FeedItem $item The FeedItem to add to the feed.
  * @access public
  */
function addItem($item) {
  $this->items[] = $item;
}
/**
  * 清空当前数组值
  *
  * @param object FeedItem $item The FeedItem to add to the feed.
  * @access public
  */
  function clearItem2Null() {
  $this->items = array();
}

/**
  * Truncates a string to a certain length at the most sensible point.
  * First, if there's a '.' character near the end of the string, the string is truncated after this character.
  * If there is no '.', the string is truncated after the last ' ' character.
  * If the string is truncated, " ..." is appended.
  * If the string is already shorter than $length, it is returned unchanged.
  *
  * @static
  * @param string    string A string to be truncated.
  * @param int        length the maximum length the string should be truncated to
  * @return string    the truncated string
  */
function iTrunc($string, $length) {
  if (strlen($string)<=$length) {
   return $string;
  }
  
  $pos = strrpos($string,".");
  if ($pos>=$length-4) {
   $string = substr($string,0,$length-4);
   $pos = strrpos($string,".");
  }
  if ($pos>=$length*0.4) {
   return substr($string,0,$pos+1)." ...";
  }
  
  $pos = strrpos($string," ");
  if ($pos>=$length-4) {
   $string = substr($string,0,$length-4);
   $pos = strrpos($string," ");
  }
  if ($pos>=$length*0.4) {
   return substr($string,0,$pos)." ...";
  }
  
  return substr($string,0,$length-4)." ...";
  
}


/**
  * Creates a comment indicating the generator of this feed.
  * The format of this comment seems to be recognized by
  * Syndic8.com.
  */
function _createGeneratorComment() {
  return "<!-- generator=\"".FEEDCREATOR_VERSION."\" -->\n";
}


/**
  * Creates a string containing all additional elements specified in
  * $additionalElements.
  * @param elements array an associative array containing key => value pairs
  * @param indentString string a string that will be inserted before every generated line
  * @return    string    the XML tags corresponding to $additionalElements
  */
function _createAdditionalElements($elements, $indentString="") {
  $ae = "";
  if (is_array($elements)) {
   foreach($elements AS $key => $value) {
    $ae.= $indentString."<$key>$value</$key>\n";
   }
  }
  return $ae;
}

function _createStylesheetReferences() {
  $xml = "";
  if ($this->cssStyleSheet) $xml .= "<?xml-stylesheet href=\"".$this->cssStyleSheet."\" _fcksavedurl="\"".$this->cssStyleSheet."\"" type=\"text/css\"?>\n";
  if ($this->xslStyleSheet) $xml .= "<?xml-stylesheet href=\"".$this->xslStyleSheet."\" type=\"text/xsl\"?>\n";
  return $xml;
}


/**
  * Builds the feed's text.
  * @abstract
  * @return    string    the feed's complete text
  */
function createFeed() {
}

/**
  * Generate a filename for the feed cache file. The result will be $_SERVER["PHP_SELF"] with the extension changed to .xml.
  * For example:
  *
  * echo $_SERVER["PHP_SELF"]."\n";
  * echo FeedCreator::_generateFilename();
  *
  * would produce:
  *
  * /rss/latestnews.php
  * latestnews.xml
  *
  * @return string the feed cache filename
  * @since 1.4
  * @access private
  */
function _generateFilename() {
  $fileInfo = pathinfo($_SERVER["PHP_SELF"]);
  return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".xml";
}



以下为引用的内容:

/**
  * @since 1.4
  * @access private
  */
function _redirect($filename) {
  // attention, heavily-commented-out-area
  
  // maybe use this in addition to file time checking
  //Header("Expires: ".date("r",time()+$this->_timeout));
  
  /* no caching at all, doesn't seem to work as good:
  Header("Cache-Control: no-cache");
  Header("Pragma: no-cache");
  */
  
  // HTTP redirect, some feed readers' simple HTTP implementations don't follow it
  //Header("Location: ".$filename);
  Header("Content-Type: ".$this->contentType."; charset=".$this->encoding."; filename=".basename($filename));
  Header("Content-Disposition: inline; filename=".basename($filename));
  readfile($filename, "r");
  die();
}
    
/**
  * Turns on caching and checks if there is a recent version of this feed in the cache.
  * If there is, an HTTP redirect header is sent.
  * To effectively use caching, you should create the FeedCreator object and call this method
  * before anything else, especially before you do the time consuming task to build the feed
  * (web fetching, for example).
  * @since 1.4
  * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
  * @param timeout int  optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour)
  */
function useCached($filename="", $timeout=3600) {
  $this->_timeout = $timeout;
  if ($filename=="") {
   $filename = $this->_generateFilename();
  }
  if (file_exists($filename) AND (time()-filemtime($filename) < $timeout)) {
   $this->_redirect($filename);
  }
}


/**
  * Saves this feed as a file on the local disk. After the file is saved, a redirect
  * header may be sent to redirect the user to the newly created file.
  * @since 1.4
  *
  * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()).
  * @param redirect boolean optional send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file.
  */
function saveFeed($filename="", $displayContents=true) {
  if ($filename=="") {
   $filename = $this->_generateFilename();
  }
  $feedFile = fopen($filename, "w+");
  if ($feedFile) {
   fputs($feedFile,$this->createFeed());
   fclose($feedFile);
   if ($displayContents) {
    $this->_redirect($filename);
   }
  } else {
   echo "<br /><b>Error creating feed file, please check write permissions.</b><br />";
  }
}

}
/**
* FeedDate is an internal class that stores a date for a feed or feed item.
* Usually, you won't need to use this.
*/
class FeedDate {
var $unix;

/**
  * Creates a new instance of FeedDate representing a given date.
  * Accepts RFC 822, ISO 8601 date formats as well as unix time stamps.
  * @param mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used.
  */
function FeedDate($dateString="") {
  if ($dateString=="") $dateString = date("r");
  
  if (is_integer($dateString)) {
   $this->unix = $dateString;
   return;
  }
  if (preg_match("~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~",$dateString,$matches)) {
   $months = Array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
   $this->unix = mktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]);
   if (substr($matches[7],0,1)=='+' or substr($matches[7],0,1)=='-') {
    $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60;
   } else {
    if (strlen($matches[7])==1) {
     $oneHour = 3600;
     $ord = ord($matches[7]);
     if ($ord < ord("M")) {
      $tzOffset = (ord("A") - $ord - 1) * $oneHour;
     } elseif ($ord >= ord("M") AND $matches[7]!="Z") {
      $tzOffset = ($ord - ord("M")) * $oneHour;
     } elseif ($matches[7]=="Z") {
      $tzOffset = 0;
     }
    }
    switch ($matches[7]) {
     case "UT":
     case "GMT": $tzOffset = 0;
    }
   }
   $this->unix += $tzOffset;
   return;
  }
  if (preg_match("~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~",$dateString,$matches)) {
   $this->unix = mktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1]);
   if (substr($matches[7],0,1)=='+' or substr($matches[7],0,1)=='-') {
    $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60;
   } else {
    if ($matches[7]=="Z") {
     $tzOffset = 0;
    }
   }
   $this->unix += $tzOffset;
   return;
  }
  $this->unix = 0;
}
/**
  * Gets the date stored in this FeedDate as an RFC 822 date.
  *
  * @return a date in RFC 822 format
  */
function rfc822() {
  //return gmdate("r",$this->unix);
  $date = gmdate("Y-m-d H:i:s", $this->unix);
  if (TIME_ZONE!="") $date .= " ".str_replace(":","",TIME_ZONE);
  return $date;
}

/**
  * Gets the date stored in this FeedDate as an ISO 8601 date.
  *
  * @return a date in ISO 8601 format
  */
function iso8601() {
  $date = gmdate("Y-m-d H:i:s",$this->unix);
  $date = substr($date,0,22) . ':' . substr($date,-2);
  if (TIME_ZONE!="") $date = str_replace("+00:00",TIME_ZONE,$date);
  return $date;
}

/**
  * Gets the date stored in this FeedDate as unix time stamp.
  *
  * @return a date as a unix time stamp
  */
function unix() {
  return $this->unix;
}
}

/**
* RSSCreator10 is a FeedCreator that implements RDF Site Summary (RSS) 1.0.
*
* @see http://www.purl.org/rss/1.0/
* @since 1.3
* @author Kai Blankenhorn <kaib@bitfolge.de>
*/
class RSSCreator10 extends FeedCreator {
/**
  * Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
  * The feed will contain all items previously added in the same order.
  * @return    string    the feed's complete text
  */
function createFeed() {    
  $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
  $feed.= $this->_createGeneratorComment();
  if ($this->cssStyleSheet=="") {
   $cssStyleSheet = "http://www.w3.org/2000/08/w3c-synd/style.css";
  }
  $feed.= $this->_createStylesheetReferences();
  $feed.= "<rdf:RDF\n";
  $feed.= "    xmlns=\"http://purl.org/rss/1.0/\"\n";
  $feed.= "    xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n";
  $feed.= "    xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\n";
  $feed.= "    xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
  $feed.= "    <channel rdf:about=\"".$this->syndicationURL."\">\n";
  $feed.= "        <title>".htmlspecialchars($this->title)."</title>\n";
  $feed.= "        <description>".htmlspecialchars($this->description)."</description>\n";
  $feed.= "        <link>".$this->link."</link>\n";
  if ($this->image!=null) {
   $feed.= "        <image rdf:resource=\"".$this->image->url."\" />\n";
  }
  $now = new FeedDate();
  $feed.= "       <dc:date>".htmlspecialchars($now->iso8601())."</dc:date>\n";
  $feed.= "        <items>\n";
  $feed.= "            <rdf:Seq>\n";
  for ($i=0;$i<count($this->items);$i++) {
   $feed.= "                <rdf:li rdf:resource=\"".htmlspecialchars($this->items[$i]->link)."\"/>\n";
  }
  $feed.= "            </rdf:Seq>\n";
  $feed.= "        </items>\n";
  $feed.= "    </channel>\n";
  if ($this->image!=null) {
   $feed.= "    <image rdf:about=\"".$this->image->url."\">\n";
   $feed.= "        <title>".$this->image->title."</title>\n";
   $feed.= "        <link>".$this->image->link."</link>\n";
   $feed.= "        <url>".$this->image->url."</url>\n";
   $feed.= "    </image>\n";
  }
  $feed.= $this->_createAdditionalElements($this->additionalElements, "    ");
  
  for ($i=0;$i<count($this->items);$i++) {
   $feed.= "    <item rdf:about=\"".htmlspecialchars($this->items[$i]->link)."\">\n";
   //$feed.= "        <dc:type>Posting</dc:type>\n";
   $feed.= "        <dc:format>text/html</dc:format>\n";
   if ($this->items[$i]->date!=null) {
    $itemDate = new FeedDate($this->items[$i]->date);
    $feed.= "        <dc:date>".htmlspecialchars($itemDate->iso8601())."</dc:date>\n";
   }
   if ($this->items[$i]->source!="") {
    $feed.= "        <dc:source>".htmlspecialchars($this->items[$i]->source)."</dc:source>\n";
   }
   if ($this->items[$i]->author!="") {
    $feed.= "        <dc:creator>".htmlspecialchars($this->items[$i]->author)."</dc:creator>\n";
   }
   $feed.= "        <title>".htmlspecialchars(strip_tags(strtr($this->items[$i]->title,"\n\r","  ")))."</title>\n";
   $feed.= "        <link>".htmlspecialchars($this->items[$i]->link)."</link>\n";
   $feed.= "        <description>".htmlspecialchars($this->items[$i]->description)."</description>\n";
   $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, "        ");
   $feed.= "    </item>\n";
  }
  $feed.= "</rdf:RDF>\n";
  return $feed;
}
}

/**
* RSSCreator091 is a FeedCreator that implements RSS 0.91 Spec, revision 3.
*
* @see http://my.netscape.com/publish/formats/rss-spec-0.91.html
* @since 1.3
* @author Kai Blankenhorn <kaib@bitfolge.de>
*/
class RSSCreator091 extends FeedCreator {
/**
  * Stores this RSS feed's version number.
  * @access private
  */
var $RSSVersion;
function RSSCreator091() {
  $this->_setRSSVersion("0.91");
  $this->contentType = "application/rss+xml";
}

/**
  * Sets this RSS feed's version number.
  * @access private
  */
function _setRSSVersion($version) {
  $this->RSSVersion = $version;
}
/**
  * Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0.
  * The feed will contain all items previously added in the same order.
  * @return    string    the feed's complete text
  */
function createFeed() {
  $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
  $feed.= $this->_createGeneratorComment();
  $feed.= $this->_createStylesheetReferences();
  $feed.= "<rss version=\"".$this->RSSVersion."\">\n";
  $feed.= "    <channel>\n";
  $feed.= "        <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n";
  $this->descriptionTruncSize = 500;
  $feed.= "        <description>".$this->getDescription()."</description>\n";
  $feed.= "        <link>".$this->link."</link>\n";
  $now = new FeedDate();
  $feed.= "        <lastBuildDate>".htmlspecialchars($now->rfc822())."</lastBuildDate>\n";
  $feed.= "        <generator>".FEEDCREATOR_VERSION."</generator>\n";
  if ($this->image!=null) {
   $feed.= "        <image>\n";
   $feed.= "            <url>".$this->image->url."</url>\n";
   $feed.= "            <title>".FeedCreator::iTrunc(htmlspecialchars($this->image->title),100)."</title>\n";
   $feed.= "            <link>".$this->image->link."</link>\n";
   if ($this->image->width!="") {
    $feed.= "            <width>".$this->image->width."</width>\n";
   }
   if ($this->image->height!="") {
    $feed.= "            <height>".$this->image->height."</height>\n";
   }
   if ($this->image->description!="") {
    $feed.= "            <description>".$this->image->getDescription()."</description>\n";
   }
   $feed.= "        </image>\n";
  }
  if ($this->language!="") {
   $feed.= "        <language>".$this->language."</language>\n";
  }
  if ($this->copyright!="") {
   $feed.= "        <copyright>".FeedCreator::iTrunc(htmlspecialchars($this->copyright),100)."</copyright>\n";
  }
  if ($this->editor!="") {
   $feed.= "        <managingEditor>".FeedCreator::iTrunc(htmlspecialchars($this->editor),100)."</managingEditor>\n";
  }
  if ($this->webmaster!="") {
   $feed.= "        <webMaster>".FeedCreator::iTrunc(htmlspecialchars($this->webmaster),100)."</webMaster>\n";
  }
  if ($this->pubDate!="") {
   $pubDate = new FeedDate($this->pubDate);
   $feed.= "        <pubDate>".htmlspecialchars($pubDate->rfc822())."</pubDate>\n";
  }
  if ($this->category!="") {
   $feed.= "        <category>".htmlspecialchars($this->category)."</category>\n";
  }
  if ($this->docs!="") {
   $feed.= "        <docs>".FeedCreator::iTrunc(htmlspecialchars($this->docs),500)."</docs>\n";
  }
  if ($this->ttl!="") {
   $feed.= "        <ttl>".htmlspecialchars($this->ttl)."</ttl>\n";
  }
  if ($this->rating!="") {
   $feed.= "        <rating>".FeedCreator::iTrunc(htmlspecialchars($this->rating),500)."</rating>\n";
  }
  if ($this->skipHours!="") {
   $feed.= "        <skipHours>".htmlspecialchars($this->skipHours)."</skipHours>\n";
  }
  if ($this->skipDays!="") {
   $feed.= "        <skipDays>".htmlspecialchars($this->skipDays)."</skipDays>\n";
  }
  $feed.= $this->_createAdditionalElements($this->additionalElements, "    ");
  for ($i=0;$i<count($this->items);$i++) {
   $feed.= "        <item>\n";
   $feed.= "            <title>".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100)."</title>\n";
   $feed.= "            <link>".htmlspecialchars($this->items[$i]->link)."</link>\n";
   $feed.= "            <description>".$this->items[$i]->getDescription()."</description>\n";
  
   if ($this->items[$i]->author!="") {
    $feed.= "            <author>".htmlspecialchars($this->items[$i]->author)."</author>\n";
   }
   /*
   // on hold
   if ($this->items[$i]->source!="") {
     $feed.= "            <source>".htmlspecialchars($this->items[$i]->source)."</source>\n";
   }
   */
   if ($this->items[$i]->category!="") {
    $feed.= "            <category>".htmlspecialchars($this->items[$i]->category)."</category>\n";
   }
   if ($this->items[$i]->comments!="") {
    $feed.= "            <comments>".htmlspecialchars($this->items[$i]->comments)."</comments>\n";
   }
   if ($this->items[$i]->date!="") {
   $itemDate = new FeedDate($this->items[$i]->date);
    $feed.= "            <pubDate>".htmlspecialchars($itemDate->rfc822())."</pubDate>\n";
   }
   if ($this->items[$i]->guid!="") {
    $feed.= "            <guid>".htmlspecialchars($this->items[$i]->guid)."</guid>\n";
   }
   $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, "        ");
   $feed.= "        </item>\n";
  }
  $feed.= "    </channel>\n";
  $feed.= "</rss>\n";
  return $feed;
}
}

/**
* RSSCreator20 is a FeedCreator that implements RDF Site Summary (RSS) 2.0.
*
* @see http://backend.userland.com/rss
* @since 1.3
* @author Kai Blankenhorn <kaib@bitfolge.de> */
class RSSCreator20 extends RSSCreator091 {
    function RSSCreator20() {
        parent::_setRSSVersion("2.0");
    }
    
}


PHP生成RSS类的具体实现


使用:
include_once('Rss.class.php');
$rss = new UniversalFeedCreator();
$rss->title = "PHP开源项目";
$rss->link = "http://www.coderhome.net";
$rss->description = "最全最新最丰富的PHP开源项目";
$softList = $query->select('select * from soft_list where status=1 order by id desc','array',1,100);
foreach ($softList as $rs) {
$item = new FeedItem();
$item->title = $rs['title'];
$item->link = 'http://www.coderhome.net/?id='.$rs['id'];
$item->description = $rs['content'];
$rss->addItem($item);
}
$rss->saveFeed("RSS2.0", "rss.xml");

XWork 源码下载 不指定

admin , 2010/04/27 17:59 , Java开发 , 评论(0) , 阅读(442) , Via 宝华的博客 原创
由于学习Struts2的需要,所以需要下载XWork源码拿来参考参考。如今很多的开放源码都使用的是SVN作为源码分享的服务器。像前两年都是使用CVS作为代码库,如今大多数都是采用SVN,XWork也不例外。
安装SVN客户端之后使用右键的Checkout,输入以下地址即可

http://svn.opensymphony.com/svn/xwork/trunk

struts2 异常处理总结 不指定

admin , 2010/04/26 22:24 , Java开发 , 评论(0) , 阅读(289) , Via 宝华的博客 原创


1—:java.lang.NoClassDefFoundError: org/apache/struts2/dojo/views/jsp/ui/HeadTag

解决办法:原因缺少了dojo的JAR包,引入即可:struts2-dojo-plugin-2.1.2.jar

(

The "head" tag renders required JavaScript code to configure Dojo and is required in order to use any of the tags included in the Dojo plugin.

——————–

If you are planning to nest tags from the Dojo plugin, make sure you set parseContent="false", otherwise each request made by the inner tags will be performed twice.

)



2—:Unable to load configuration. - bean - jar:file:/F:/Struts2/Struts2/WebRoot/WEB-INF/lib/struts2-core-       2.1.2.jar!/struts-default.xml:46:178

       Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest -       bean - jar:file:/F:/Struts2/Struts2/WebRoot/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178

       Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext

       解决办法:缺少JAR包,引入commons-fileupload-1.2.1.jar,commons-io-1.3.2.jar即可



3—:No tag "datetimepicker" defined in tag library imported with prefix "s"

       原因版本问题:缺少struts-dojo-plugin JAR包,以及HTML的,<HEAD></HEAD>中没有使用<s:head/>标签

         If you’re using Struts 2.1.x you’re probably missing the> struts-dojo-plugin.  Michaël’s reference below applies to Struts 2.1.xonly. In the lasts versions (since 2.0.9 I guess), all AJAX are in dojo> plugin.

> > So you need to include <%@ taglib uri="/struts-dojo-tags" prefix="sx"%>

> > and <sx:head/>

> >( Temp1:

   <sx:datetimepicker name="picker" />

   Temp2:

   <sx:datetimepicker type="time" name="picker" /><br/>

   Temp3:

   <sx:datetimepicker value="%{’2008-06-08′}" name="picker" />

   Temp4:

   <sx:datetimepicker value="date" name="picker" />)

> > and call  :<sx:datetimepicker …/>







4—:使用TILES框架    

    If you use the Tiles 2 plugin, check your tiles.xml file(s) to ensure they contain a DOCTYPE.

    <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
     "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
    <tiles-definitions>
5---:struts2中不支持EL表达式 Convert EL expressions to OGNL      Struts2.1 tags do not allow evaluation of JSP EL within their attributes.
    Instead, Struts2 tags evaluate attribute values as OGNL. Allowing both
    expression languages within the same attribute opens major security
    vulnerabilities. 6---文件上传过程中取不到文件名和文件类型,即都取到NULL    原因:如果页面中file的name=“a”则我们ACTION中设置String aContentType,String aFileName;(此两个其实无所谓,关键是SET方法)    setA(File file)(){}; setAContentType(String s){};setAFileName(String name){} 即格式如下:setXContentType() setXFileName().X代表你给FILE取的NAME名字    必须和它相同,固定格式7---严重: Unable to parse request    org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (8523356) exceeds the configured maximum (2097152)     at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn    警告: Could not find property [struts.valueStack]    2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error    严重: the request was rejected because its size (8523356) exceeds the configured maximum (2097152)    2008-5-27 17:46:51 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn    警告: Could not find property [org.apache.catalina.jsp_file] 原因:上传文件大小超过预定大小,可以在struts.properties配置文件中设置struts.multipart.maxSize=XXX(XXX为文件大小) 8---配置了文件类型限制后,当传错误类型可以拦截不让用户上传该文件,可是跳转的页面却没有跳转到input配置的错误页面,而是返回    到了success正确页面。    严重: Content-Type not allowed: filedata "upload__5b01657_11a329d4dcf__8000_00000000.tmp" text/plain    《我的打印输出DEBUG语句内容:File:null  FlieName:null      type:null》即拦截类型成功了    java.lang.NullPointerException     at java.io.FileInputStream.<init>(FileInputStream.java:103)     at com.study.web.util.FileUploadUtil.uploadFile(FileUploadUtil.java:36)     at com.study.web.action.UploadFileAction.execute(UploadFileAction.java:58)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)。。。    2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn    警告: Could not find property [org.apache.catalina.jsp_file]    2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn    警告: Could not find property [struts]    2008-5-29 10:59:07 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info    信息: Removing file filedata \tmp\upload__5b01657_11a329d4dcf__8000_00000000.tmp    原因及解决办法:在该文件上传Action中只配置了FileUploadInterceptor后缺少配置了defaultStack拦截器.    在ACTION中配置玩defaultStack拦截器后改错误消失。9---struts.properties中全局配置文件大小,再使用默认FileUploadInterceptor拦截器时候能实现拦截的功能但是后台出现异常。    严重: Unable to parse request    org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (380) exceeds the configured maximum (10)     at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)原因:未知。将全局配置中的限制大小去掉,再重新在ACTION中覆盖配置FileUploadInterceptor拦截器设置大小和文件类型限制,可消除异常。10---多文件上传中,其中一个传被限制的文件如限制aplication/msword(即.doc)文件,允许传文本文件。然而当夹杂在一起传的时候,后台能截获类型错误不可传信息,但是    实际却还是上传成功。严重: Content-Type not allowed: filedata "upload_4d958287_11a33e76ab9__8000_00000007.tmp" application/mswordfile is :\tmp\upload_4d958287_11a33e76ab9__8000_00000006.tmp  fileName:project.txt  fileType:text/plainfile is :\tmp\upload_4d958287_11a33e76ab9__8000_00000007.tmp  fileName:application base.doc  fileType:application/mswordfile is :\tmp\upload_4d958287_11a33e76ab9__8000_00000008.tmp  fileName:zhongqi-bug.txt  fileType:text/plain原因:忘记了继承ActionSupport类。继承后异常消失。11--文件上传异常,不能创建File文件    Cannot create type class java.io.File from value C:\Documents and Settings\admin\桌面\OrderReporterServiceImp.java - [unknown location]    原因:忘记了在form表单里将enctype设置成文件上传格式:enctype="multipart/form-data"12--当使用限制文件类型和大小的时候抛出空指针异常    java.lang.NullPointerException
  demo.struts2.action.ValidatFileUploadAction.execute(ValidatFileUploadAction.java:71)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    原因:在ACTION中配置了fileUpload拦截器后忘记了配置默认拦截器:defautlStack。注意当ACTION中配置自己的拦截器后需要显示配置默认        拦截器defaultStack13--在国际化时候抛空指针异常:
     16:31:12,812 ERROR [jsp]:253 - Servlet.service() for servlet jsp threw exception    java.lang.NullPointerException  at java.text.MessageFormat.applyPattern(MessageFormat.java:414)
     at java.text.MessageFormat.<init>(MessageFormat.java:350)     at com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:70)
    
     原因:忘记了在struts.xml中配置国际化常量,或者在struts.properties中配置全局国际化常量 struts.custom.i18n.resources=globeMessage

14-- struts action的配置文件加载失败:
    Unable to load configuration. - result - file:/D:/Java/apache-tomcat-5.5.20/webapps/mysts/WEB-INF/classes/test.xml:10:26
     Caused by: No result type specified for result named 'error', perhaps the parent package does not specify the result type? - result - file:/D:/Java/apache-tomcat-5.5.20/webapps/mysts/WEB-INF/classes/test.xml:10:26     at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:609)

     原因:忘记了继承包struts-default
15-- struts action 配置文件注意事项:
     1. 别忘记了继承struts-default默认配置包
     2.如果配置命名空间,一定要以"/"开始,例如:namespace="/test"
     3.每个模块struts action配置文件中都可以配置全局result,global-result 经测试不会冲突,STRTUS会智能寻找该Action请求的
       模块STRUTS ACTION配置包

Tags: ,

office 2010 MSDN版激活码 绝对可以安装 不指定

admin , 2010/04/25 18:24 , 软件工具 , 评论(0) , 阅读(1502) , Via 宝华的博客 原创
众所周知,微软前几天在MSDN上发布了Office 2010正式版,网友也在第一时间分享了出来给大家下载
Microsoft Office 2010 MSDN版简体中文正式版下载

但是安装需要输入产品密钥,很多网友下载了Office 2010正式版由于没有密钥,所以都无法安装,今天某网友在网上发现了一枚office 2007密钥可以用来输入验证以完成安装激活MSDN Office 2010!在此分享给大家!


Office 2010密钥(序列号):

6QFDX-PYH2G-PPYFD-C7RJM-BBKQ8
BDD3G-XM7FB-BD2HM-YK63V-VQFDK
VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB


(以上KEY有朋友直接输入后即激活的!未通过的按照下面操作进行激活!)
使用方法和之前分享过的经验分享:使用windows 7密钥+电话成功激活windows 7系统大致相同;
激活具体要点:
1,所安装的office 2010必须是 MSDN原版;
2,安装过程中不要选择联网自动激活,安装结束后,重启电脑,打开Word或其他,它会提示你激活,选择电话激活。
电话激活过程中提示:
(1)“是不是在同一台机器上重新安装系统?”—选“是”,即"1";
(2)“是不是已经卸载了前一个安装?”—选“是”,即“1”。
  
3,不要尝试人工激活(你忽悠不过微软的!)
使用此KEY有人激活过,也有朋友未能够激活,未能激活的可以尝试,禁用网卡试试!
目前的安装步骤比较另类(先输入密钥才能安装),所以激活方法比较单一,另一种“替换法”因为要替换程序文件,所以就不分享了!

ecshop去掉Powered by ECShop和底部信息 不指定

admin , 2010/04/25 11:53 , 心情文摘 , 评论(0) , 阅读(669) , Via 宝华的博客 原创
当你刚刚装ecshop的时候,他的标题的版权Powered by ECShop显示如此信息.很多时候需要修改,或者是去除.此信息不但不是在模板中,而是在php公共文件中。 打开includes/lib_main.php,找到as

        当你刚刚装ecshop的时候,他的标题的版权Powered by ECShop显示如此信息.很多时候需要修改,或者是去除.此信息不但不是在模板中,而是在php公共文件中。
     打开includes/lib_main.php,看到ecshop函数 assign_ur_here(),找到$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' . 'Powered by ECShop';这句,只要把'Powered by ECShop去掉,修改成$page_title = $GLOBALS['_CFG']['shop_title'] ;就可以了。更新后台缓存,就可以去掉他.
    如果要修改网站底部信息,你可以找到library/page_footer.lbi文件,修改你所需要的文字和变量.保存就可以.
改完以上的之后,还会出现power by ecshop的一个链接


接下来我们去除那个链接

找到js文件夹下的common.js文件
查找
onload = function()

把代码块去掉就可以了
以下是需要去掉的代码

onload = function()
{
    var link_arr = document.getElementsByTagName(String.fromCharCode(65));
    var link_str;
    var link_text;
    var regg, cc;
    var rmd, rmd_s, rmd_e, link_eorr = 0;
    var e = new Array(97, 98, 99,
                      100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
                      110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
                      120, 121, 122
                      );

  try
  {
    for(var i = 0; i < link_arr.length; i++)
    {
      link_str = link_arr[i].href;
      if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, e[18], e[7], e[14],
                                             e[15], 46, 99, 111, e[12])) != -1)
      {
        if ((link_text = link_arr[i].innerText) == undefined)
        {
            throw "noIE";
        }
        regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
        if ((cc = regg.exec(link_text)) != null)
        {
          if (link_arr[i].offsetHeight == 0)
          {
            break;
          }
          link_eorr = 1;
          break;
        }
      }
      else
      {
        link_eorr = link_eorr ? 0 : link_eorr;
        continue;
      }
    }
  } // IE
  catch(exc)
  {
    for(var i = 0; i < link_arr.length; i++)
    {
      link_str = link_arr[i].href;
      if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, 115, 104, e[14],
                                               e[15], 46, 99, 111, e[12])) != -1)
      {
        link_text = link_arr[i].textContent;
        regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
        if ((cc = regg.exec(link_text)) != null)
        {
          if (link_arr[i].offsetHeight == 0)
          {
            break;
          }
          link_eorr = 1;
          break;
        }
      }
      else
      {
        link_eorr = link_eorr ? 0 : link_eorr;
        continue;
      }
    }
  } // FF

  try
  {
    rmd = Math.random();
    rmd_s = Math.floor(rmd * 10);
    if (link_eorr != 1)
    {
      rmd_e = i - rmd_s;
      link_arr[rmd_e].href = String.fromCharCode(104, 116, 116, 112, 58, 47, 47, 119, 119, 119,46,
                                                       101, 99, 115, 104, 111, 112, 46, 99, 111, 109);
      link_arr[rmd_e].innerHTML = String.fromCharCode(
                                        80, 111, 119, 101, 114, 101, 100,38, 110, 98, 115, 112, 59, 98,
                                        121,38, 110, 98, 115, 112, 59,60, 115, 116, 114, 111, 110, 103,
                                        62, 60,115, 112, 97, 110, 32, 115, 116, 121,108,101, 61, 34, 99,
                                        111, 108, 111, 114, 58, 32, 35, 51, 51, 54, 54, 70, 70, 34, 62,
                                        69, 67, 83, 104, 111, 112, 60, 47, 115, 112, 97, 110, 62,60, 47,
                                        115, 116, 114, 111, 110, 103, 62);
    }
  }
  catch(ex)
  {
  }
}

Office 2010官方简体中文版下载MSDN版 不指定

admin , 2010/04/24 22:14 , 软件工具 , 评论(0) , 阅读(382) , Via 宝华的博客 原创
今天凌晨 Microsoft Office 2010正式版的下载,MSDN 用户可以通过订阅下载正式版本的Office 2010。令人可喜的是首发语言中包括简体中文版。其中产品包括:Office 2010 Professional Plus,Project Professional 2010,Project Standard 2010,Visio 2010和SharePoint Server 2010。目前,已有MSDN用户上传官方简体中文正式版的Microsoft Office 2010 RTM:




Office Professional Plus 2010 (x86) – (Chinese-Simplified)


大小: 841530616 字节
MD5: 97F6021EBDCA5525616D43DE8F3782CA
文件名 cn_office_professional_plus_2010_x86_515501.exe
发布日期 (UTC): 4/22/2010 8:53:17 AM
上次更新日期 (UTC): 4/22/2010 8:53:17 AM
SHA1: AD9F7E48EBAF648169E34833E2E218D62B69FB84 ISO/CRC: 34D30E63

序列号 chung-ecuny-ement-iexue-zhenh-anzi

Office Professional Plus 2010 (x64) – (Chinese-Simplified)

文件名 cn_office_professional_plus_2010_x64_515528.exe
发布日期 (UTC): 4/22/2010 8:53:14 AM
上次更新日期 (UTC): 4/22/2010 8:53:14 AM
SHA1: E8AB0CA8C1BC44B62445E0B9E37A0DFD13933DDB ISO/CRC: 83D5D206

Office Professional Plus 2010 (x86) – (English)

大小: 681867016 字节
MD5: 3C25F66D31E3B18FFF8EF340BA21EC31
文件名 en_office_professional_plus_2010_x86_515486.exe
发布日期 (UTC): 4/22/2010 8:45:06 AM
上次更新日期 (UTC): 4/22/2010 8:53:18 AM
SHA1: 0E1840BF1AA81077692AF651BEFB75648CD9FAA7 ISO/CRC: 986EB4A1

Office Professional Plus 2010 (x64) – (English)


文件名 en_office_professional_plus_2010_x64_515489.exe
发布日期 (UTC): 4/22/2010 8:45:06 AM
上次更新日期 (UTC): 4/22/2010 8:53:14 AM
SHA1: 7C2F2D5F8C273724EEC70A9EFA2DDD800FE3265F ISO/CRC: BFE0338C
分页: 7/19 第一页 上页 2 3 4 5 6 7 8 9 10 11 下页 最后页 [ 显示模式: 摘要 | 列表 ]