易栈网-膘叔

发文热力图 2025-12-07 ~ 2026-12-06
少 多 近 365 天共 27 篇
浏览模式: 标准 | 列表 | 图文
使用WPS打印PDF文档

使用WPS打印PDF文档

说来奇怪,我在前期写过一篇文章,说WPS的pdf查看是鸡肋一般的功能: 鸡肋一般的wps插件:PDF查看 ,然而,今天我却觉得他有用了。。。

缘由是我打开一个PDF文件,用的是福昕,结果,打印按钮显示的是灰色的。用了adobe reader也是如此,我在想不到该如何做的情况下,尝试用WPS打开它,结果发现打印也是灰色的。本想着泪奔而走的,忽然发现,在插件栏上的打印按钮居然可以点,而且上点了之后确实可以打印。。。泪流满面啊【套用:内牛满面】。。

截图如下:5713d974b88305c661241e25263c4356

如果你有WPS,在无法打印的情况,可以尝试一下哦。

步骤如下:

1、打开WPS文字,在打开界面中把文件类型改为PDF,否则,是看不到PDF文件的。

ce1d2e7eb09abc37c7d580751b26075f

2、然后就可以操作了。

如果你没有PDF插件,可以打开工具栏:f5f3c34804bbb2eb7d992b2b36dd27d9

选择PDF插件进行加载:416bd6e8c6ea1d806cd337bce1d659bd

然后你就可以 重复上面的步骤1、2了

OK,完成这件事后,是不是很开心啊?

关注:为之漫步的翻译CSS之父论文《层叠样式表》

关注:为之漫步的翻译CSS之父论文《层叠样式表》

为这漫步的翻译功底还是比较厉害的。看他的博客上对于一些单词的深究也能够看出一些来,这好象是他最新的工作?不过对于WEB开发人员还是有意义 的

以下为链接:

中文链接:

www.cn-cuckoo.com/css/thesis-of-Hakon-Wium-Lie/

原文链接:

people.opera.com/howcome/2006/phd/

翻译进度列表:


Håkon Wium Lie出生于1965年7月26日,是土生土长的挪威人。现为Opera Software的CTO(Chief Technology Officer,首席技术官)。他的个人页面、维基百科词条。

1994年,Håkon Wium Lie提出了层叠样式表的概念,并于当年10月提交了他的样式表建议——Cascading HTML style sheets。1996年12月,他亲自主持并以他的建议为基础创建的Cascading Style Sheets, level 1,正式成为W3C的推荐标准。后来,几乎所有主要浏览器都实现了CSS。CSS的普及,结束了长达数年之久的“表现性HTML”的历史,开创了标准Web开发中结构、表现、行为分离的新时代。

1995年, Håkon Wium Lie针对测试Web浏览器在呈现HTML标记、CSS2.1样式、PNG图像及数据URI方面的支持情况,提出了Acid2建议。该建议后来由Web标准组织开发并发布,成为判定新(版)浏览器对Web标准支持情况的一个重要依据。

另外,Håkon Wium Lie与另一位CSS标准的制定者Bert Bos合著的Cascading Style Sheets: Designing for the Web, 3rd Edition 2005年5月由Addison-Wesley Professional出版。也是学习CSS的一本优秀图书。这里还有一篇发表于A List Apart的他们合写的文章:Printing a Book with CSS: Boom!

总而言之,翻译这篇论文的想法由来已久了。原因很简单,这篇论文是Håkon Wium Lie在他提出CSS的建议10年后写就的,其中全面翔实地包含了大量与CSS及Web发展有关的珍贵资料,是研究和学习CSS不可多得的重要参考文献。 翻译这篇论文的过程,也是学习和研究的过程。希望自己在翻译完这篇论文后,对CSS和Web的理解能上升到一个新的层次。

原文地址则是:翻译CSS之父论文《层叠样式表》

汇报行程

汇报行程

这两天不在是因为:看牙齿和朋友结婚,明天回来后会在手机博客上贴照片,呵呵

自 WAP 发表
修改Linux操作系统下22端口两种方法

修改Linux操作系统下22端口两种方法

公司内部禁用了一堆端口...唉...SSH连不上去
不得不换端口...

第一种:

01假如要改SSH的默认端口(22),那么你只要修改:/etc/ssh/sshd_config中Port 22,这里把22改成自己要设的端口就行了,不过千万别设和现已有的端口相同哦,以防造成未知后果。

02假如要限制SSH登陆的IP,那么可以如下做:

先:修改/etc/hosts.deny,在其中加入sshd:ALL

然后:修改:/etc/hosts.allow,在其中进行如下设置:sshd:192.168.0.241

这样就可以限制只有192.168.0.241的IP通过SSH登陆上LINUX机器了。

第二种:

首先修改配置文件

vi /etc/ssh/sshd_config

找到#Port 22一段,这里是标识默认使用22端口,修改为如下:

Port 22

Port 50000

然后保存退出

执行/etc/init.d/sshd restart

这样SSH端口将同时工作与22和50000上。

现在编辑防火墙配置:vi /etc/sysconfig/iptables

启用50000端口。

执行/etc/init.d/iptables restart

现在请使用ssh工具连接50000端口,来测试是否成功。如果连接成功了,则再次编辑sshd_config的设置,将里边的Port22删除,即可。

之所以先设置成两个端口,测试成功后再关闭一个端口,是为了方式在修改conf的过程中,万一出现掉线、断网、误操作等未知情况时候,还能通过另外一个端口连接上去调试以免发生连接不上必须派人去机房,导致问题更加复杂麻烦。

来源:http://if.vc/

Zend framework quickstart -> create project

Zend framework quickstart -> create project

仍然是quickstart的内容之一:create project

Create Your Project

In order to create your project, you must first install Zend Framework.

为了创建您的ZF项目,你必须先安装ZF框架

Install Zend Framework

The easiest way to get Zend Framework along with a complete PHP stack is by installing Zend Server. Zend Server has native installers for Mac OSX, Windows, Fedora Core, and Ubuntu, as well as a universal installation package compatible with most Linux distributions.

最简单安装ZF的方法就是安装ZendServer,ZendServer可以安装在苹果系统,windows, fedora,ubuntu,而且支持大多数的linux操作系统 。

After you have installed Zend Server, the Framework files may be found under /Applications/ZendServer/share/ZendFramework on Mac OSX, C:\Program Files\Zend\ZendServer\share\ZendFramework on Windows, and /usr/local/zend/share/ZendFramework on Linux. The include_path will already be configured to include Zend Framework.

在你安装完zendserver后,如果您是使用MAC系统,你将在/Applications/ZendServer/share/ZendFramework目录下找到框架文件,windows平台的话,是在, C:\Program Files\Zend\ZendServer\share\ZendFramework目录中,而linux平台则在/usr/local/zend/share/ZendFramework目录中。同时include_path也已经被配置好支持ZF框架了。

Alternately, you can download the latest version of Zend Framework and extract the contents; make a note of where you have done so.

当然你也可以直接下载ZF的最新版本并解压到你想使用的目录中

Optionally, you can add the path to the library/ subdirectory of the archive to your php.ini's include_path setting.

或者,你也可以把library这个目录加载到你的php.ini中的include_path设置中。

That's it! Zend Framework is now installed and ready to use.

这时候,ZF框架就已经被安装好并能够被使用了。

In your Zend Framework installation is a bin/ subdirectory, containing the scripts zf.sh and zf.bat for Unix-based and Windows-based users, respectively. Make a note of the absolute path to this script.
在你的ZF安装目录下,有两个可执行文件:zf.sh和zf.bat,他们分别对应着Unix平台和windows平台。记录下这个文件的绝对路径

Wherever you see references to zf.sh or zf.bat, please substitute the absolute path to the script. On unix-like systems, you may want to use your shell's alias functionality: alias zf.sh=path/to/ZendFramework/bin/zf.sh.
当你想要引用这zf.sh或者zf.bat文件 的时候,请先设置它的详细路径。例如在Unix平台下,你可以使用shell功能来进行替代:alias zf.sh=path/to/ZendFramework/bin/zf.sh

If you have problems setting up the zf command-line tool, please refer to the manual.
如果你还对ZF命令行工具有疑问,那就只能查看官方的手册了

Open a terminal (in Windows, Start -> Run, and then use "cmd"). Navigate to a directory where you would like to start a project. Then, use the path to the appropriate script, and execute one of the following:

打开终端(在windows下面为:开始->运行->输入cmd),转到你想要创建项目的子目录中,开始就可以开始使用你刚才设置的路径来运行那两个script之一了。

# Unix:
% zf.sh create project quickstart

# DOS/Windows:
C:> zf.bat create project quickstart

Running this command will create your basic site structure, including your initial controllers and views. The tree looks like the following:

运行了这个命令,你将会得到ZF框架的项目的最基本结构,包含了初始化后的控制和和视图(controllers and vews),这个树形结构类似如下:

quickstart
|-- application
| |-- Bootstrap.php
| |-- configs
| | `-- application.ini
| |-- controllers
| | |-- ErrorController.php
| | `-- IndexController.php
| |-- models
| `-- views
| |-- helpers
| `-- scripts
| |-- error
| | `-- error.phtml
| `-- index
| `-- index.phtml
|-- library
|-- public
| `-- index.php
`-- tests
|-- application
| `-- bootstrap.php
|-- library
| `-- bootstrap.php
`-- phpunit.xml

At this point, if you haven't added Zend Framework to your include_path, we recommend either copying or symlinking it into your library/ directory. In either case, you'll want to either recursively copy or symlink the library/Zend/ directory of your Zend Framework installation into the library/ directory of your project. On unix-like systems, that would look like one of the following:

在这点中,如果你没有将ZF框架加入到你的 include_path ,我们推荐你将它 COPY或者 symlinking到你的 library目录下。两种方法其中都是将library/Zend 目录 链至你的项目。在unlx系统中,它大致是这样操作的:

# Symlink:
% cd library; ln -s path/to/ZendFramework/library/Zend .

# Copy:
% cd library; cp -r path/to/ZendFramework/library/Zend .

On Windows systems, it may be easiest to do this from the Explorer.

在windows平台下,直接在资源管理器中就能够操作完毕。

Now that the project is created, the main artifacts to begin understanding are the bootstrap, configuration, action controllers, and views.

项目创建完毕后,the main artifact【不知道如何翻译】先了角解一下:bootstrap,configuration,action,controllers和views

The Bootstrap

Your Bootstrap class defines what resources and components to initialize. By default, Zend Framework's Front Controller is intialized, and it uses the application/controllers/ as the default directory in which to look for action controllers (more on that later). The class looks like the following:

Bootstrap类定义了资源和构成的初始化。默认情况下ZF只初始化了Front Controller【前端操作器】,它使用了 application/controllers 作为默认目录,在该目录里有着controller控制类的文件。bootstrap最初是这样的:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}

As you can see, not much is necessary to begin with.

就你看到的内容来说,好象没有多少是必需的。

Configuration

While Zend Framework is itself configurationless, you often need to configure your application. The default configuration is placed in application/configs/application.ini, and contains some basic directives for setting your PHP environment (for instance, turning error reporting on and off), indicating the path to your bootstrap class (as well as its class name), and the path to your action controllers. It looks as follows:

ZF本身的配置是极少的,你通常需要为你自己的项目进行单独配置。默认的配置文件是/application/configs/application.ini,在文件中定义了一些PHP环境变量(如error_reporting的打开与否)和bootstrap类的路径(甚至是bootstrap类的名称),以前你的控制器的路径,内容如下:

; application/configs/application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
Several things about this file should be noted. First, when using INI-style configuration, you can reference constants directly and expand them; APPLICATION_PATH is actually a constant. Additionally note that there are several sections defined: production, staging, testing, and development. The latter three inherit settings from the "production" environment. This is a useful way to organize configuration to ensure that appropriate settings are available in each stage of application development.

关于这个文件的必须要注意一些事。首先,当你使用ini格式的配置文件时,你可以直接引用常量,如APPLICATION_PATH就是一个常量。另外,还有一些选择器是默认定义过的:production,staging,testing和defelopment。后面三个设置都是从production的环境变量中扩展的。这样,你就可以很好的为你的项目开发进行适当的配置。

原文:http://framework.zend.com/docs/quickstart/create-your-project

有点长,写的也乱。先写这么多,下次补全。

其实不太想翻译这个,毕竟太初级了。。。我想翻译的是这个:http://devzone.zend.com/tag/PHP101

但是翻译现在这个QuickStart是可以让我在言语组织上学习点东西。先为我想翻译的东西打点基础吧。

CSS Position Fixed for IE6

我对CSS的了解少之又少,还好公司有美工,非常精通这些。但偶尔在自己写的时候可就没有人帮助了。所以,看到点资料,都会想着记下来。。

想来司徒正美的英文比我好多了,他还能经常去国外的网站,我就不行。。。

以下就来自他的博客了:

逛mootools核心成员Thomas Aylott的 博客看到,不过有点标题党了,实际效果并没有那么灵光,只是定义四个类,分别用来固定视口的上下左右。很遗憾,它无法解决与 top,bottom,left,right并用的问题(见例子)。它利用到IE8已经废弃的expression来计算页面的大小,从而固定我们想固定 的元素。里面用到一技巧,就是给html或body元素添加一张背景图片,并设置background-attachment:fixed,用于强制在页 面重绘之前执行CSS,也就是执行它里面的expression。另,我们也不需要一张真的图片,我们给它一个about:blank命令就可以,就像平 时对付链接一样,仅仅就是想要一个hover效果非得塞给它一个href。

.fixed-top {position:fixed;bottombottom:auto;top:0px;}
.fixed-bottombottom {position:fixed;bottombottom:0px;top:auto;}
.fixed-left {position:fixed;rightright:auto;left:0px;}
.fixed-rightright {position:fixed;rightright:0px;left:auto;}

* html,* html body {background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top {position:absolute;bottombottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-rightright {position:absolute;rightright:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0)));}
* html .fixed-bottombottom {position:absolute;bottombottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
* html .fixed-left {position:absolute;rightright:auto;left:expression(eval(document.documentElement.scrollLeft));}
原文中还有例子,而且用他的话来说:要真正解决IE6的这个bug,就需要用到Dean Edwards大神的IE7.js。我是没用过啦。。。。毕竟不做前端

原文来自于:http://www.cnblogs.com/rubylouvre/archive/2009/11/14/1603113.html

e1f6493ced594c19fcc9d7e6dfc428c8

zend framdwork quick start

zend framdwork quick start

最近重操旧业,看起了zend framework,如今的1.9x与以前不一样了。所以,把ZF的quick start逐步翻译一下,权当复习和温故了。

原文地址:http://framework.zend.com/docs/quickstart/create-a-model-and-database-table

ZF & MVC Introduction

Zend Framework

Zend Framework is an open source, object oriented web application framework for PHP 5. ZF is often called a 'component library', because it has many loosely coupled components that you can use more or less independently. But Zend Framework also provides an advanced Model-View-Controller (MVC) implementation that can be used to establish a basic structure for your ZF applications. A full list of Zend Framework components along with short descriptions may be found in the components overview. This QuickStart will introduce you to some of ZF's most commonly used components, including Zend_Controller, Zend_Layout, Zend_Config, Zend_Db, Zend_Db_Table, Zend_Registry, along with a few view helpers.

Using these components, we will build a simple database-driven guest book application within minutes. The complete source code for this application is available in the following archives:

zend framework 介绍

ZF是一个开源且面向对象的,支持PHP5的WEB应用框架。ZF通常被叫做“组件库”,因为他拥有很多松耦合的组件,因此你可以在应用中或多或少的独立使用它们。但ZF更多的是为你的ZF应用提供了一个高级的MVC架构【??翻译不来了】所有的ZF组件列表,你可以从 组件预览 页进行查看。而这个QuickStart会给你的ZF最通常使用的组件进行介绍,如Zend_Controller,Zend_layout,Zend_Config,Zend_Db,Zend_Db_table,Zend_Registry,以及一些视图助手【这个应该是讲View的,但不知道怎么翻译好。现在终于明白那些翻译书的朋友们的痛苦之处了。明知道啥意思就是说不出口,还是词汇量少啊】

Model-View-Controller

So what exactly is this MVC pattern everyone keeps talking about, and why should you care? MVC is much more than just a three-letter acronym (TLA) that you can whip out anytime you want to sound smart; it has become something of a standard in the design of modern web applications. And for good reason. Most web application code falls under one of the following three categories: presentation, business logic, and data access. The MVC pattern models this separation of concerns well. The end result is that your presentation code can be consolidated in one part of your application with your business logic in another and your data access code in yet another. Many developers have found this well-defined separation indispensable for keeping their code organized, especially when more than one developer is working on the same application.

MVC

那么我们就来讲讲什么是MVC了以及你对于MVC来说,最关心的是什么。MVC虽然只是三个单词的开始每个字母组成的新词,然而他已经成为了网页程序的标准设计模式了。而且,有充分的理由证明,大多数的网络程序代码都被归于以下三种分类之一:表达方式【?】,商业逻辑 和数据访问层。MVC模式则能够使你们将关注点进行分离。最终你的表示代码只占你的商业逻辑的一小部分,同样数据访问层也是这样。大多数开发人员发觉这能够使得他们保持代码分离并且条理清晰,尤其是在同一项目中有多名开发人员时。

翻译的很迷惘。。。

其实上面的大意无非就是MVC结构使得程序员可以将更多的精力放在业务逻辑上,而不是将大量的精力浪费在表现层和数据访问上。

不过,虽然翻译的很乱,但我还是多少又理解了一点这方面的知识。MVC如今已经被很多人所接受,很多招聘上也都写着,熟悉MVC模式开发。其实,如果真正项目已经按着MVC模式开发的话,那么招聘进去的人,又有多少是同时对于这三个方面进行开发的呢?

Model - View - Controller,在ZF框架中也是很分离的。看框架的 application目录就很清楚了。除了module和config目录外,剩下的就是:controllers,models和views目录了。。由此可见,基本上也分得比较清楚了

激动人心的时刻到了。。。

激动人心的时刻到了。。。

国庆的时候,因为备案问题关闭了几个网站,然后就是天天查询我的备案是否下来,今天是12日,刚过丨丨节,再次查询的时候,激动人心的时刻到了。。。

e1f6493ced594c19fcc9d7e6dfc428c8

啥也不说了,泪流满面啊

几段JS的小技巧

几段JS的小技巧

这又是一篇来自于 帕兰映像 的文章:14条最佳JS代码编写技巧,但并非全部,我只复制粘贴了一小部分我所需要了解的,如果需要看全文,还是点上面的链接去他那里看吧。

1、总是使用 ‘var’ ,其实这个真的很重要。如果你一个不小心,你就会遇到变量重名或者无意中就引用了全局变量。
2、使用方括号记法。对于JS的对象,一般我们都是采用 aa.bb.cc来访问的,但其实也可以用aa["bb"]["cc"]来进行访问。

使用”.”号,属性名是硬代码,不能在执行时改变。使用”[ ]“方括号,属性名是一个通过计算属性名而来的字符串。字符串要以是硬代码,也可能是变量,甚至可以是一个调回一个字母串值的函数。 如果一个属性名在执行产生,方括号是必须,如果你有 “value1″, “value2″, 和 “value3″这样的属性,并且想利用变量 i=2来访问
如:MyObject["value"+i] ,你就不能写成:MyObject.value+i
并且在某些服务器端环境(PHP、Struts等)下,Form 表单被附加了 [ ] 号来表示 Form 表单在服务器端必须被当作数组来对待。如此,用”.”号来引用一个包含 [ ] 号的字段将不会执行,因为 [ ] 是引用一个 Javascript 数组的语法。所以,[ ] 号记法是必须的。推荐使用”[ ]“方括号记法是说当其需要时(明显地)总是使用它。当不是严格需要使用它的时候,它是一个私人的偏好和习惯。一个好的经验原则是,使用”.”号记法访问标准的对象属性,使用”[ ]“方括号记法访问由页面定义的对象属性。这样,document["getElementById"]() 是一个完美可行的”[ ]“方括号记法用法,但 document.getElementById() 在语法上是首选,因为 getElementById 是一个 DOM 规范中定义的一个标准文档对象属性。混合使用这两个记法使哪个是标准对象属性,哪个属性名是由上下文所定义的,在代码中显得清晰明了

3、在锚点中使用 “onclick” 替代 “javascript: Pseudo-Protocol” :如果你想在 <a> 标签中触发Javascript 代码,选择 onclick 而非 JavaScript: pseudo-protocol;使用 onclick 来运行的 Javascript 代码必须返回 ture 或者false(or an expression than evalues to true or false [这句要怎么翻译呢? 我是这样理解的:一个优先性高于true 或 false 的表达式])来返回标签本身:如果返回 true,则锚点的 href 将被当作一个一般的链接;如果返回 false,则 href 会被忽略。这就是为什么”return false;” 经常被包含在 onclick 所处理代码的尾部。

4、使用一元 ‘+’ 号运算符使类型转向Number:大家都知道“+”是javascript的连接符,但其实他也可以作为转换符来使用,如可以使用”+”号来把数组转换成数字。给变量或者表达式前置一个”+”号将会强制其当作一个数字来处理,而这也将使得数学”+”得以成功应用。

5、避免乱用全局命名空间。一般很少需要全部变量和函数。全局使用将可能导致 Javascript 源文件文档冲突,和代码中止。因此,一个好的做法是在一个全局命名空间内采用函数性的封装。有多个方法可以完成这个任务,有此相对比较复杂。最简单的方法 是创建一个全局对象,并把属性和方法指派给这个对象。但即使这样,命名空间也可以使用 Closures(闭包?) 来创建,并且 Private Member Variables (私有变量?) 也可以伪装于 Javascript中。

6、避免同步的 ‘Ajax’ 调用:当使用”Ajax”请求时,你要么选择异步模式,要么使用同步模式。当浏览器行为可以继续执行,异步模式将请求放在后台执行,同步模式则会等待请求完成后才继续。应该避免同步模式做出的请求。这些请求将会对用户禁用浏览器,直至请求返回。一旦服务器忙,并需要一段时间来完成请求,用户的浏览器(或者 OS)将不能做任何其他的事,直至请求超时。如果你觉得自己的情况需要同步模式,最大的可能是你需要时间来重新想一下你的设计。很少(如果有的话)实际上需要同步模式的 Ajax 请求。

这些,是我所关注的。。。一共有14条,你会关注哪条?

终于跨进10W大关

前段时间,我做了一个小记录: 即将进入10W以内,今天终于跨进10W大关

10W其实也算一个坎了。04年左右进来过,但后来停站后就再也没有了。
去年差一点进来,但还是离他而去了。。。

如今,我终于进来了,虽然有点辛苦,但。继续喽

努力。向前冲

1d04aede18691f7d7b5a295ccdfbb727