易栈网-膘叔

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

VOASE:Hollywood Looks Overseas for Talent and Profit

This is the VOA Special English Economics Report.

This year, something happened at the Academy Awards that had not happened since nineteen sixty-four. All the winners for best acting were from outside the United States.

bb70fd4158e3699bea57880ee81c021f
From left, Daniel Day-Lewis, Tilda Swinton, Marion Cotillard and Javier Bardem
Daniel Day-Lewis and Tilda Swinton are British. He won best actor for "There Will Be Blood"; she won best supporting actress for "Michael Clayton." French actress Marion Cotillard won the Oscar for best actress for "La Vie en Rose." And Spain's Javier Bardem won best supporting actor in "No Country for Old Men."

Hollywood is increasingly looking outside America's borders for stars and profit.

Jonathan Taplin is a professor at the USC Annenberg School for Communication at the University of Southern California. He says that today, about fifty-four percent of the ticket sales for Hollywood studios now come from outside the United States.

For the last three months of two thousand seven, foreign sales totaled about eight hundred eighty million dollars. But there is fierce competition for each movie dollar.

Hollywood has lost market share in some places as other countries develop their own film industries. For example, in the mid-eighties, American films had eighty percent of the market in South Korea. Today that share is about forty percent.

Hollywood also faces competition from illegally copied movies, a major issue to the Motion Picture Association of America. The trade group estimated more than eighteen billion dollars in worldwide losses from piracy in two thousand five.

Hollywood reporter Alan Silverman says piracy has influenced how American movies are released. In the past, Hollywood studios waited months after the American release of a film to release it in foreign markets. Now, many aim to release films at the same time around the world.

Foreign markets may also influence how people get their movies. Different nations have different levels of technology.

Efforts to settle on the next-generation DVD got a lot of attention recently. Sony's Blu-ray technology for high-definition televisions won the competition with Toshiba's HD DVD format.

Yet DVD sales have dropped in recent years. This may be a sign that people are increasingly getting their movies off the Internet. The Internet is another front in Hollywood's war on piracy. But more than that, it presents complex business questions for an industry now built mostly on DVD and ticket sales.

And that's the VOA Special English Economics Report, written by Mario Ritter. I'm Steve Ember.

spec0041a0229.mp3

让人失望的dualface

让人失望的dualface

宁可相信世上有鬼,不能相信dualface那张嘴。当然,这句话不是我说的。。。

详情参考:http://www.fleaphp.org/bbs/viewthread.php?tid=2388&extra=page%3D1

QeePHP叫了好久了,到现在也没有出来。虽然google wiki上面的新功能介绍了很多,但,看不到产品的介绍再多,又有什么意义呢?如果确实是在进度外的,那么,可以说明一下,也不至于变成现在这样。

难道。。。这也是一种推广方式?有点失望而已

如何用DIV挡住SWF?

如何用DIV挡住SWF?

div在网页显示的时候,一般情况下都是被FLASH挡住,如何用div挡住flash呢?有一个小办法。。

由于现在flash在网页上显示大多用了swfObject的JS,因此,我也就拿它来举例:

<div id="flashContent">对不起,你的浏览器不支持flash</div>
<script>
var fso = new SWFObject("aaa.swf", "test", "100%", "100%", "8", "#FFFFFF");
//重点在这里
fso.addParam("wmode","opaque");
fso.write("flashContent");
</scirpt>
<div style="position:absolute;left:15;top:15;width:130px;height:30px;background:white"></div>

即,先给flash加上一个参数wmode,值为opaque,然后通过用DIV的绝对路径加上背景色来挡住flash,比如一个角,等等

Easy way to find a file in subdirectory with php

Easy way to find a file in subdirectory with php

原文地址:http://blog.makemepulse.com/2008/02/18/tips-easy-way-to-find-a-file-in-subdirectory-with-php/

<?php
class DirectorySearch {

private
$iterator,
$directoryname;
public function __construct($directoryname){
$this->iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directoryname,RecursiveDirectoryIterator::KEY_AS_FILENAME));
}

public function find($filename){
foreach($this->iterator as $entry){
if($filename == $this->iterator->current()){
return $this->iterator->getPathName();
}
}
return false;
}
}

实际应用:

<?php
$directory = dirname(__FILE__)."/directory";

$search_directory = new DirectorySearch($directory);
$path_file = $search_directory->find("file_to_find.php");

if($path_file !== false){
//include_once($path_file);
echo $path_file;
}

If we don’t use the KEY_AS_FILENAME with the recursiveDirectoryIterator we will have the whole path of the file in $this->iterator->current();

如果我们不使用recursiveDirectoryIterator类的KEY_AS_FILENAME,我们也可以使用文件的全路径$this->iterator->current();

All of this is a basic example of the RecursiveIteratorIterator with the RecursiveDirectoryIterator. SPL is a very powerfull toolkit !

这只是RecursiveDirectoryIterator的一个基本的功能,不得不说,SPL是一个非常好的工具。

自己的话:

以前遍历目录找文件一般是两种方法:1、opendir,2、glob,然后来遍历整个目录。如今SPL里有现成的,那肯定是这样的速度更快,效率更高喽?只是。。。不知道对中文文件名的支持会怎么[已测试,让我失望]

<?php
function read_dir( $dir) {
$array = array();
$d = dir($dir);
while (false !== ($entry = $d->read())) {
if($entry!='.' && $entry!='..') {
$entry = $dir.'/'.$entry;
if(is_dir($entry)) {
$array[] = $entry;
$array = array_merge($array, read_dir($entry));
} else {
$array[] = $entry;
}
}
}
$d->close();
return $array;
}
function get_file ($file, $file_path ){
foreach ( $file_path as $_k => $_v ){
if ( basename($_v) == $file ){
return $_v ;
}
}

}
?>

测试下来。。。让我失望。

<?php
$directory = dirname(__FILE__)."/Discuz!_6.0.0_SC_UTF8";
$sTime = microtime(true);

$search_directory = new DirectorySearch($directory);
$path_file = $search_directory->find("buy中文.htm");

if($path_file !== false){
//include_once($path_file);
echo( $path_file );
}
echo '<pre>';
print_r( microtime(true) - $sTime );
echo '</pre>';

$sTime = microtime(true);
$f = 'buy中文.htm';
echo( get_file($f,read_dir($directory)) );
echo '<pre>';
print_r( microtime(true) - $sTime );
echo '</pre>';

使用CLass的时间是0.86550688743591

使用function的时间是:0.54081797599792

鉴定完毕:支持中文文件名

PHP连贯接口

PHP连贯接口

  近期,看到很多人都在讨论连贯接口这个东西,仔细想想,这其实没有什么,用的早的如javascript中的jQuery,都早就在用了。只是PHP最近被人翻出来炒一炒而已。

  但不得不说的是,连贯接口也有它自身的好处,即可以让代码更清晰化,比如Zend的Select类里面,生成一个SQL并执行就是那样的直观:

<?php
$db = new Zend_Db(); //这是随便写的,主要是为了显示一下
$db->select()
->from('tablename')
->where('id = ?' , $id)
->orwhere('name != ?' , $name);

//最后也可以调用一下来生成这个SQL
$sql = $db->__toString();

自从到了PHP5,$a = new Object() ; $b = $a; 这个$b 直接变成了取址,而不是COPY后,这样的连贯接口比之用数组来实现效率是高上了很多,毕竟相对占用内存会少一点吧?(估计,没有实测过)。

不过,这东西确实也就和AJAX一样,属于老瓶装新酒。以前类里的函数是返回一个值,或者true等等等等,现在是return $this;直接返回自身(不知道这样效率是提升还是下降。),但总体来说,这个还是一个很不错的方法。

反正,自从我在Zend的FW里看到这个连贯接口后,接下来,在很多地方就看到了不同的介绍、应用。慢慢享受吧。HOHO

关于PHP正则的取反和逻辑思想的问题

关于PHP正则的取反和逻辑思想的问题

  众所周知,^这个符合在正则里非常有用,首先它代表了行首匹配,比如/^abc/,就代表了必须是abc开头,同样,它也是一个取反的标记。

  何为取反?就说刚才吧^abc是以abc开头,那么取反的意思就是不以abc三个字母的开头。

  正常情况下,这些都可以运用,不会有什么错误。

  再举个例子:我要判断字符串是否有特殊字符,怎么办?
  正常情况下,我会这样preg_match("/[_-~!@#$%^]+/",$string) ,当然特殊字符不止这么一些,只是举个简单的例子。
  如果我的$string = 'abcdefg--hijklmn',那么,我这样的匹配肯定是返回1的,因为有“-”被我匹配了。
  现在反过来讲,如果我不想匹配这些特殊字符怎么办?
  首先想到的就是取反,于是我preg_match("/[^-~!@#$%^]/",$string),再匹配一下,结果还是返回1。
  为啥呢?
  起初想半天就没想明白,为什么我明明取反了却匹配仍然成功呢?
  仔细思索了好久才明白,我取反之后,其实我的match的内容就变成了:与不是特殊字符匹配,那么我的string里面几乎全都不是特殊字符,当然就匹配成功了。
  所以,对于这种情况,还是先判断是否有特殊字符,然后再根据返回值再判断是否没有特殊字符吧。(有点象绕口令了)。

JS全选checkBox最佳方案

JS全选checkBox最佳方案

<input type="button" name="" value="不计算长度" onclick="a()">
<input type="button" name="" value="全选" onclick="b()">
<input type="button" value="缓存" onclick="c()">
<input type="checkbox" name="test[]" value="0"> 测试测试<br>
<script language="JavaScript">
<!--
var ca = new Array();
function a()
{
var m = document.getElementsByName('test[]');
for ( var i=0; i< m.length ; i++ ){
m[i].checked = !m[i].checked;
}
}

function b(){
var m = document.getElementsByName('test[]');
var l = m.length;
for ( var i=0; i< l; i++){
m[i].checked = !m[i].checked;
}
}

function c(){
if (ca.length == 0){
ca = cache();
}
cl = ca.length;
for ( var i=0; i< cl; i++){
ca[i].checked = ! ca[i].checked;
}
}

function cache(){
var m = document.getElementsByName('test[]');
var cache = new Array();
var l = m.length;
for ( var i=0; i< l; i++){
cache[i] = m[i];
}
return cache;
}
//-->
</script>

  黑黑,至于那个input type="checkbox"的,你们就尽量复制吧,尽量不要超过1W,否则。。别怪我没有提醒你,当然了,也不需要把浏览器关掉,跑到外面抽根烟再回来就行了。

  所以,我们要切实的记住,反正数组有长度的,坚决不能放在循环里面,而是先将这个长度取出来当成变量。PHP里也一样,循环数组的时候,先count数组的长度比较好。
当然了,我第三个采用了缓存,速度也是非常快的,比长度取好后再进行计算更快,因为连一次都不用取了(当然,除了第一次),全部扔给客户端了。

  上面的例子还是比较方便的,因为,checkbox的 name值都一样,如果不一样怎么办???
  只能这样:

<script language="JavaScript">
<!--
function check(){
var inputs = document.getElementsByTagName('input');
var inputsLen = inputs.length;
for (var i = 0; i < inputsLen ; i++ ){
if (inputs[i].type.toLowerCase() == 'checkbox') {
inputs[i].checked = !inputs[i].checked;
}
}
}
//-->
</script>
PHP常见错误(二)

PHP常见错误(二)

mySQL Result Source Errors
mySql 资源错误
Warning: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in…
You need to take a look at the $result variable used to define the loop. More than likely there is a syntax error on the reported line before the $result field, or the value of $result does not exist.
通常,在进行msyql_query后,你需要对取得的数据进行遍历,如果出现上面错误时,你得检查一下你的$result是否是一个resource,这种情况在SQL查询语句错误(但错误没有被抛出)的情况下,所以,发现此问题时,可以考虑打印出SQL,到PHPMYDMIN里执行一下看看是怎么回事。

Supplied argument is not a valid stream resource…
This is usually caused when your code is looking for a table or other resource in the database that does not exist.
这个问题的情况通常是你代码中指定的表或者资源不存在于该数据库

Sessions are not being created or maintained
Sessions 不能被创建或者被修改维护
This can apply to any of the scenarios below:
这可能会出现以下几种情况
(1) The program isn’t remembering your login 程序没有记录下你的登录状态
(2) Your shopping cart won’t hold items 你的购物车没有保持你的商品状态
(3) Your php script is redirecting like crazy 你的PHP代码跳转的太疯狂
(4) “Call undefined function session_start” error 你的服务器没有打开Session功能
(5) PHP isn’t processing pages called by something like index.php?page=home&id=7 你的PHP代码不能打开某个页面,比如index.php?page=home&id=7

Your site is most likely dependent on register_globals. You can enable them by putting this line in your .htaccess (or just enabling in your php.ini if you have access):
你的网站可能会依赖register_globals(全局变量)打开。你可以将下面这行加到你的.htaccess文件里(当然,如果你有权限更改PHP.ini,还是改php.ini更方便)
php_flag register_globals On

Stream Errors
文件流错误
Warning: failed to open stream…
Warning: main(/index.php): failed to open stream: No such file or directory in…

This is usually because either the specified file is missing, or a file declared in a require() or include() function is missing. The easiest way to fix this is by re-installing the PHP program from a freshly-uploaded copy, or restoring the original config.php and just changing the db information. The include path may also be incorrect, but either way your script is looking for a file that isn’t there, or it is looking in the wrong place.
这两个问题的出现,通常是文件没有找到或者文件不能被require和include。(上面的英文我觉得不太准,个人认为应该是:先检查一下文件是否确实存在,检查文件的路径,当然,还得看一下php.ini的include_path,如果这些都检查过了。那么尝试用绝对路径加载文件)

Warning: fopen(…): failed to open stream: Permission denied in…
This is a permissions and/or ownership issue. Try first setting the permissions to 777 just to see if the script will run. If so, you should narrow down the permissions to 775. If not, set the user/group to user:nobody.
文件没有权限被读取,如果你想要你的文件被读取,设置文件权限为775,如果该文件需要被执行,那么就设置成777。否则设置用户权限/组为:nobody

Warning: <…> is not a valid stream resource…
Warning: fread(): supplied argument is not a valid stream resource in…
This is an error seen when trying to use functions like fopen(), fread(), feof(), etc. and are usually caused by an invalid or unavailable resource that is being called in the line specified. For instance, if the fread() function is returning this error, it could be that the file it is trying to access does not have the correct permissions or does not exist.
这也是一个常见错误,当你使用fopen(), fread(), feof()等函数时,就可能会出现,错误原因一般是fopen()或者其他函数打开文件失败,但错误信息被屏蔽,如$fp=@fopen('file.txt');,在这种情况下,再使用fread()读取时,就会出现上面的出错信息。

Warning: Failed opening….
Warning: Failed opening ‘…’ for inclusion (include_path=’.:/usr/local/lib/php’) in Unknown on line 0
Make the sure that the file mentioned (and its holding directorie) has read + execute permissions, and that the path to the file is correct. If not, you’ll need to add the path into the PHP code: (or .htaccess)
请确认文件是否有读写权限并且路径是正确的。如果不是,你需要把路径加载到你的PHP代码或者.htaccess文件里

include(”/path/to/files”);
Blank PHP Pages

You go to a .php page, but it’s blank.
The scope of what can cause blank pages is very broad, but there are a few things to look at:
-Is error reporting turned off anywhere in the script or in the .htaccess? If so, turn it on to see what is happening (php_flag display_errors on), or add the lines at the top of this page into the script.
-Is the PHP script even generating any output (usually you can tell my finding the print function?
-Check the database connection, i.e, username, dbname, user added to db, etc.
-Try using the full <?PHP ?> tags, rather than the shorter versions <? ?>
当你转向到a.php的页面时,但是打开的却是空白页面,出现这种问题的原因有很多,这里只介绍一些让你尝试着解决一下:
1、错误报告是否关闭了?如果是,请打开错误报告,并且在你的这个文件里加上一些输出试试
2、是否PHP代码本身就是一个输出页面,试着寻找一下print之类的函数?
3、检查数据库连接,例如,用户名密码等
4、试着用完整的PHP标签:<?php?>,而尽量少用短标签<??>


Also, if the software is prebundled (like phpBB or Gallery), then the index or one of the include pages could be corrupted. Usually you can just replace the problem page with a working version from another installation.
有时,一些软件的测试版本中往往都会存在着一个错误或者BUG等,你可以试着将出错页用该程序的其他版本来替换掉。象(phpBB或者Ballery)


Max Execution Time Error
最大执行时间错误
You receive some variant of a “Max_execution_time” error when loading a page.
This is caused when a PHP script takes longer to execute than the server allows, but can be adjusted by adding a PHP directive to your .htaccess: (in seconds, 0 = unlimited) or modifying the value in php.ini.
php_value max_execution_time 0
打开页面时,显示 "Max_execution_time" 执行时间错误。
这应该是你的PHP代码在运行的时候,超过了服务器所允许的时候,但是,这是可以通过修改.htaccess或者php.ini来进行修改(0代表了不限制)
php_value max_execution_time 0


Open_basedir Errors

Warning: Unknown(): open_basedir restriction in effect.
This is a protective feature of Apache that restricts PHP from accessing files/folders outside the user’s home directory. Most of the time this is due to an incorrect include path in one or more of the config files (which are usually mentioned). Look for something like this:
/includes/somefile.php
/admin/files/anotherfile.php
The heading / tells the filesystem that these folders are on the server root, and thus prevents PHP from accessing them. You can usually fix this by changing the path to these files to be absolute to their location:
/home/username/public_html/includes/somefile.php
or
./includes/somefile.php
出现Open_basedir问题的时候,往往需要先检查,PHP_INI里面有没有设定open_basedir,如果PHP.ini里没有设定,还需要查看apache的http.conf的虚拟主机设定里,也否也进行了设置。如果设定了,还需要检查这些目录是否可读写,否则会出现受保护的错误。

周易:乾卦第一

周易:乾卦第一

乾:元亨、利贞。
初九:潜龙勿用。
九二:见龙在田,利见大人
九三:君子终日乾乾,夕惕若,厉,无咎。
九四:或跃在渊,无咎。
九五:飞龙在天,利见大人。
上九:亢龙有悔
用九:见群龙无首,吉。