技术

WindowsLiveWriterU3APP_AE5Bimage_4.png

自己动手制作U3P安装软件

使用PackageFactory for U3可以自己制作U3软件安装到自己的U3优盘上.

软件下载地址: http://www.eure.ca/

因为很多软件在设计的时候都会保存信息到Documents目录或者使用注册表项,所以从零开始制作优盘移动软件很难,幸好有Portable Apps项目,该项目已经把很多热门软件移动化,我利用这些程序制作自己的U3软件,就非常简单了. 首先下载需要的软件,安装,(路径可以选择安装在硬盘上,安装速度快)

本文末尾提供了我制作的二十几个u3p文件,您可以直接下载.

使用方法:

1,启动界面

2,点击右下角Advanced Mode (Wizard Mode我不会用,会出错)进入下图界面

更多 >

IEEE P802.16m标准即将结束投票

本文是专题:IEEE标准动态中的第4篇,共4篇

关于P802.16m标准

标题: IEEE本地和城域网标准 – 第16部分: 固定和移动宽带无线接入系统的空接口 – 修正案: 高级空接口
Title: IEEE Standard for Local and Metropolitan Area Networks – Part 16: Air Interface for Fixed and Mobile Broadband Wireless Access Systems – Amendment: Advanced Air Interface
Scope: This standard amends the IEEE 802.16 WirelessMAN-OFDMA specification to provide an advanced air interface for operation in licensed bands. It meets the cellular layer requirements of IMT-Advanced next generation mobile networks. This amendment provides continuing support for legacy WirelessMAN-OFDMA equipment.
Purpose: The purpose of this standard is to provide performance improvements necessary to support future advanced services and applications, such as those described by the ITU in Report ITU-R M.2072.

该项投票2010年7月9日结束.

有需要该标准文本或那个ITU2072报告的同行可以联系我.

IEEE P1547.8 标准提升智能电网性能

本文是专题:IEEE标准动态中的第3篇,共4篇

Draft standard provides common technical platform, addresses emerging energy storage challenges in distributed
power generation, Smart Grid industries
IEEE, the world’s leading professional association for the advancement of technology today announced IEEE P1547.8,
a draft standard establishing a common technical platform for distributed resources interconnection applications. The
proposed standard expands upon IEEE 1547, while incorporating industry and National Institute of Standards and
Technology (NIST) recommendations for improved interconnection performance functionality. It also addresses energy
storage challenges coming into play across the distributed resources and Smart Grid industries. Ratification of IEEE P1547.8,
which is sponsored by the IEEE Standards Coordinating Committee 21 (SCC21), is targeted for calendar year 2012.
As a complement to the IEEE 1547 standard, IEEE P1547.8 establishes a common technical platform to address functionality
for the interconnection of distributed resources across the power grid. The standard provides greater support for intermittent
renewable energy sources, and more flexible use of inverters such as found in home solar power systems, enabling easier
and more robust connections to the grid. It also addresses energy storage devices, hybrid generation-storage systems
(ES-DER), and ES-DER aspects of plug-in electric vehicles (PEV), as well as taking into account a variety of industry-driven
recommendations. IEEE P1547.8 is targeted to distributed resource owners, interconnection contractors, equipment
manufacturers, system integrators, area electric power system owners, planners and operators, and regulatory agencies.
In August 2009, NIST established an initial set of priority actions plans (PAPs) for developing standards necessary to build
an interoperable Smart Grid. IEEE P1547.8 will support NIST PAP07 Energy Storage Interconnection Guidelines.
IEEE has more than 100 standards and standards in development relevant to smart grid, including the over 20 IEEE standards
named in the NIST Framework and Roadmap for Smart Grid Interoperability Standards.
For more information on IEEE P1547.8, please visit http://ieeestandards.org/ct.html?rtr=on&s=8nv,1e16q,2xny,kijn,m7pr,gxzm,3xa8
For more information about IEEE’s leadership role in Smart Grid technology development, please visit the IEEE Smart Grid
Web Portal at http://ieeestandards.org/ct.html?rtr=on&s=8nv,1e16q,2xny,c8zn,5dek,gxzm,3xa8
To view the complete article, please visit: http://standards.ieee.org/announcements/2010/P15478.html

修改主题支持两种菜单并存

在本站升级到WordPress 3.0后,浏览了一下许久没有看过的themes目录,发现几个我喜欢的主题,经过一番试用,发现Mystique也就是您现在看到的主题最合我心意,后来才发现这也是digitalnature的作品,good job!

美中不足的是,Mystique配置界面中主菜单只能在无、链接、页面、分类目录和自定义菜单中做单选,我希望能把分类目录和自定义菜单并存,一起显示出来。可惜作者没有设计这样的功能。Hacking的真谛就是要自己动手,当然还有无私分享。下面我就贴出我的做法:

先来看看core.php中相关功能实现函数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// print the main navigation menu
function mystique_navigation() {
  $navtype = get_mystique_option('navigation');
  if($navtype): ?>
 
   <div class="shadow-left">
   <div class="shadow-right clearfix">
   <?php
    $nav_extra = apply_filters("mystique_navigation_extra", '');  // check for new icons and output
    if($nav_extra) echo '<p class="nav-extra">'.$nav_extra.'</p>';  ?>
 
   <ul id="navigation" class="clearfix">
     <?php
      if((get_option('show_on_front')<>'page') && get_mystique_option('exclude_home')<>'1'):
       if(is_home() && !is_paged()): ?>
        <li class="active home"><a class="home active fadeThis" href="<?php echo get_settings('home'); ?>" title="<?php _e('You are Home','mystique'); ?>"><span class="title"><?php _e('Home','mystique'); ?></span><span class="pointer"></span></a></li>
       <?php else: ?>
        <li class="home"><a class="home fadeThis" href="<?php echo get_option('home'); ?>" title="<?php _e('Click for Home','mystique'); ?>"><span class="title"><?php _e('Home','mystique'); ?></span><span class="pointer"></span></a></li>
      <?php
       endif;
      endif; ?>
     <?php
       if($navtype=='categories'):
        mystique_list_categories(array('hide_empty' => false, 'exclude' => get_mystique_option('exclude_categories')));
 
       elseif($navtype=='links'):
        $links = get_bookmarks(array(
        'orderby'        => 'name',
        'order'          => 'ASC',
        'limit'          => -1,
        'category'       => null,
        'category_name'  => get_mystique_option('navigation_links'),
        'hide_invisible' => true,
        'show_updated'   => 0,
        'include'        => null,
        'search'         => '.'));
 
        foreach ($links as $link):
         if($link->link_target) $target = ' target="'.wp_specialchars($link->link_target).'"'; else $target = '';
         if($link->link_rel) $rel = ' rel="'.wp_specialchars($link->link_rel).'"'; else $rel = '';
         if($link->link_description) $title = ' title="'.wp_specialchars($link->link_description).'"'; else $title = '';
         echo '<li><a class="fadeThis" href="'.$link->link_url.'"'.$target.$rel.$title.'><span class="title">'.$link->link_name.'</span><span class="pointer"></span></a><li>';
        endforeach;
 
       else:
        mystique_list_pages(array('exclude' => get_mystique_option('exclude_pages'), 'sort_column' => 'menu_order'));
       endif;
 
       do_action('mystique_navigation'); ?>
   </ul>
   </div>
   </div>
  <?php endif;
}

可以看出,作者整体设计的时候,就没有想要让用户做复选,在条件判断中使用了连续的if … elseif… 实现。

我采用了一个偷懒的方法仅把

1
if($navtype=='categories'):

注释掉,然后把接下来的

1
 elseif($navtype=='links'):

改成

1
 if($navtype=='links'):

就可以啦。

C语言嵌入式系统编程修炼之二:软件架构篇

本文是专题:程序员修炼之路中的第4篇,共5篇

作者:宋宝华 来源:天极网

朱文昊按语: 最近读到的一篇文章,收藏并作为一篇程序员修炼之路专辑中的一篇文章.

模块划分

模块划分的”划”是规划的意思,意指怎样合理的将一个很大的软件划分为一系列功能独立的部分合作完成系统的需求。C语言作为一种结构化的程序设计语言,在模块的划分上主要依据功能(依功能进行划分在面向对象设计中成为一个错误,牛顿定律遇到了相对论),C语言模块化程序设计需理解如下概念:

(1) 模块即是一个.c文件和一个.h文件的结合,头文件(.h)中是对于该模块接口的声明;

(2) 某模块提供给其它模块调用的外部函数及数据需在.h中文件中冠以extern关键字声明;

(3) 模块内的函数和全局变量需在.c文件开头冠以static关键字声明;

(4) 永远不要在.h文件中定义变量!定义变量和声明变量的区别在于定义会产生内存分配的操作,是汇编阶段的概念;而声明则只是告诉包含该声明的模块在连接阶段从其它模块寻找外部函数和变量。如:

/*module1.h*/
int a = 5; /* 在模块1的.h文件中定义int a */

/*module1 .c*/
#include “module1.h” /* 在模块1中包含模块1的.h文件 */

/*module2 .c*/
#include “module1.h” /* 在模块2中包含模块1的.h文件 */

/*module3 .c*/
#include “module1.h” /* 在模块3中包含模块1的.h文件 */

以上程序的结果是在模块1、2、3中都定义了整型变量a,a在不同的模块中对应不同的地址单元,这个世界上从来不需要这样的程序。正确的做法是:

/*module1.h*/
extern int a; /* 在模块1的.h文件中声明int a */

/*module1 .c*/
#include “module1.h” /* 在模块1中包含模块1的.h文件 */
int a = 5; /* 在模块1的.c文件中定义int a */

/*module2 .c*/
#include “module1.h” /* 在模块2中包含模块1的.h文件 */

/*module3 .c*/
#include “module1.h” /* 在模块3中包含模块1的.h文件 */

这样如果模块1、2、3操作a的话,对应的是同一片内存单元。

一个嵌入式系统通常包括两类模块:

(1)硬件驱动模块,一种特定硬件对应一个模块;

(2)软件功能模块,其模块的划分应满足低偶合、高内聚的要求。

多任务还是单任务

所谓”单任务系统”是指该系统不能支持多任务并发操作,宏观串行地执行一个任务。而多任务系统则可以宏观并行(微观上可能串行)地”同时”执行多个任务。

多任务的并发执行通常依赖于一个多任务操作系统(OS),多任务OS的核心是系统调度器,它使用任务控制块(TCB)来管理任务调度功能。TCB包括任务的当前状态、优先级、要等待的事件或资源、任务程序码的起始地址、初始堆栈指针等信息。调度器在任务被激活时,要用到这些信息。此外,TCB还被用来存放任务的”上下文”(context)。任务的上下文就是当一个执行中的任务被停止时,所要保存的所有信息。通常,上下文就是计算机当前的状态,也即各个寄存器的内容。当发生任务切换时,当前运行的任务的上下文被存入TCB,并将要被执行的任务的上下文从它的TCB中取出,放入各个寄存器中。

嵌入式多任务OS的典型例子有Vxworks、ucLinux等。嵌入式OS并非遥不可及的神坛之物,我们可以用不到1000行代码实现一个针对80186处理器的功能最简单的OS内核,作者正准备进行此项工作,希望能将心得贡献给大家。

究竟选择多任务还是单任务方式,依赖于软件的体系是否庞大。例如,绝大多数手机程序都是多任务的,但也有一些小灵通的协议栈是单任务的,没有操作系统,它们的主程序轮流调用各个软件模块的处理程序,模拟多任务环境。

更多 >