??xml version="1.0" encoding="utf-8" standalone="yes"?>
又做了一些小东东而且跟着DFLYING大虾学会PHP以后Q开始接校内的小zd……一个团委旗下网?/strong>
成立Enwell Studio
]]>
web20有一点很重要Q就是社会网l。就?a >豆瓣|?/font>来说Q我通过豆瓣提供的以书会友的功能认识了几个志相投的朋友。豆瓣会Ҏ你喜Ƣ读的书Q看的电影,听得音乐Q推荐给你和你兴相投的人,rss订阅也应该这栗比如Bloglines可以查看都有谁订阅了q个feedQ可是ؓ什么不更近一步,两个h的订阅内容作比较Q做匚w呢?通过在你的网站提供的 rss订阅服务我可以认识朋友,q也是网站粘性之一。否则像我现在可以毫无顾忌的从bloglines搬家到rojo和抓虄。而更多自取相同的人可以组成圈子。甚臌生更q一点,大家通过查看你的profileQ浏览你的BlogQ决定跟你做朋友的时候,你会得到一个vote的分敎ͼ在朋友圈的聚合门户上排名考前Q这个不是联络?/font>么?
推荐l我其他ȝ
当我用豆瓣的时候,q有一个功能特别脓心,是它会推荐l我相类似的图书。比如我d弟,它会在旁边给我推荐活着Q许三关卖血{等……rss的小门户Q可以根据每个h的兴不同,推荐在此cd中背diggơ数最多的blogl我Q省得我L感慨:哎呀Q怎么没早点看到这个网站呢Q?br />信息{?/span>
订阅了好多rss feed的h都有此种l历Q那是有的时候忙Q你好久没看了,H然以上来,成百上千的新条目Q当x倒。脓心的{选是很必要的Qrss订阅服务|站完全可以Ҏ其他用户的digg rank来按照重要程度给我排序,大家认ؓ重要的先看,大家认ؓ不重要的后看……我惻I众的眼睛还是雪亮的?br />冗余的剔?/span>
订阅了大量rss的h来说Q有一些种子可能已l坏掉了Q或者作者更新频率很低,或者过了一D|间以后,你已l不太认为那个对你有价g(q个可以从你digg it和收藏的频率来判?Q但是因为我们进行了大量的订阅,要把它剔除需要花Ҏ间的。RSS订阅服务只需要替订阅者看着点坏掉的U子Q统计下订阅者对其的x度,然后剔除哪些没有价值的feedQ这给我带来巨大的方便?br />抓虾与rojo相比bloglines的改q?/span>
rojo有一点很好,当你大开一个feed的时候,他们昄的是titleQ只有当点击十字查看具体内容,它才认ؓ你读q了Q下ơ你再打开q个U子Q这个条目便不会昄出来。之前用bloglines有的条目很多Q一天可能看不完Q下一ơ再打开q不到了,因ؓ你之前的打开被bloglines认ؓ是阅读过的表现。而有些条目我们认为是很有价值的Qrojo和抓N提供了收藏的功能。此外rojo对bloglines对feedL的分cd能进行了改善Q替代的是tagQ就是说一个feed可以属于多个tagQ你甚至可以Ҏ目进行tagQ这h加有利于门户分门别cȝ聚合?br />更进一?br />我一直感觉blog的互动性还不够Q这个不动不是指comment。而是无法像BBS一P对一个讨论Ş成一个有ȝ的跟q。大家对一些东襉K有自q看法Q可是都是零敲碎打,自己说自qQ对别h的想法可能不了解。仅仅靠track back是无法串联v来的。如果你的rss订阅服务能够有够的_性,那么用户基本都从你这里获得信息,当他要发表对某个条目的看法,让用L陆他自己?BlogQ快L引用到自qblog里面Q而订阅服务网站将通过某种方式用L评论内容得到。这P众多的用户的内Ҏ理出来,cMBBS讨论的Ş式,聚合在门户里。这PBlog之间才Ş成了有效的互动。可惜,q个xQ似乎还不知道怎么实现?br />我的面&&个h门户
几乎q种rss订阅服务|站都提供我收藏的feed的展C,我感觉这个是不够的。而还应该展示的则是跟我上面所说的有联pȝQ最qdigg的条目,最q收藏的条目Q以及我最q评论的条目Q以及我的朋友圈{等。这才Ş成了真正的“我的页面”?br />用keso的话_rss阅读器的技术门槛很高啊?/div>
]]>
public
class
Artist
{
String[] others;
/** */
/**
Creates a new instance of Artist
*/
public
Artist()
{
}
public
Artist(String name,String
others)
{
for
(String other : others)
{
System.out.println(other);
}
this
.others
=
others;
}
public
void
wildestMethod(Object
objs)
{
//
this method will accept any arguments
}
public
static
void
main(String[] args)
{
Artist artist
=
new
Artist(
"
You
"
,
"
1
"
,
"
2
"
);
artist.wildestMethod(
1
,
3.5
,
"
AA
"
,
new
Artist());
}
}
]]>
public
class
AutoBoxing
{
/** */
/**
Creates a new instance of AutoBoxing
*/
public
AutoBoxing()
{
}
public
void
boxingDemo()
{
//
auto boxing
Integer i
=
0
;
float
f
=
1.66f
;
Float F
=
f;
//
auto unboxing
Integer I
=
new
Integer(
1
);
int
i2
=
I;
//
null value test, it will case NullPointerException
Integer I2
=
null
;
int
i3
=
I2;
}
public
void
testOperator()
{
Integer i
=
1
;
while
(
true
)
{
i
++
;
System.out.println(
"
Counter:
"
+
i);
if
(i
>
5
)
break
;
}
}
public
void
testCompare()
{
//
it's equal because -127~127 are immutable objects
Integer i
=
1
;
Integer i2
=
1
;
if
(i
==
i2) System.out.println(
"
1:Equal
"
);
else
System.out.println(
"
1:Not Equal
"
);
//
it's not equal because j and j2 are different objects
Integer j
=
200
;
Integer j2
=
200
;
if
(j
==
j2) System.out.println(
"
200:Equal
"
);
else
System.out.println(
"
200:Not Equal
"
);
}
public
void
testControl()
{
Boolean flag
=
true
;
Integer i
=
20
;
Integer j
=
30
;
if
(flag)
{
System.out.println(
"
Boolean affects
"
);
}
if
(i
<
j)
System.out.println(
"
Integer affects
"
);
}
public
void
testMethod(
double
arg)
{
System.out.println(
"
public void testMethod(double arg) is invoked
"
);
}
public
void
testMethod(Integer arg)
{
System.out.println(
"
public void testMethod2(Integer arg) is invoked
"
);
}
public
static
void
main(String args[])
{
AutoBoxing auto
=
new
AutoBoxing();
auto.testCompare();
auto.testOperator();
auto.testControl();
int
i
=
1
;
//
public void testMethod(Integer arg) wouldn't be invoked
//
because public void testMethod(double arg) will be invoked in JDK1.4
//
Java tiger consider the backward capability
auto.testMethod(i);
auto.boxingDemo();
}
}
]]>
public
enum
User
{
Admin,User,Guest,Unknown
}
public
class
Login
{
private
User user;
EnumMap
<
User,String
>
userName
=
new
EnumMap
<
User, String
>
(User.
class
);
/** */
/**
Creates a new instance of Login
*/
public
Login()
{
userName.put(User.Admin,
"
Administrator
"
);
userName.put(User.User,
"
David
"
);
userName.put(User.Guest,
"
Steve
"
);
}
public
boolean
isAdmin(User user)
{
if
(user.equals(User.Admin))
{
return
true
;
}
return
false
;
}
public
void
printUserRole()
{
User[] users
=
user.values();
for
(User u : user.values())
{
System.out.println(u.toString());
}
}
public
void
isRole(User user)
{
switch
(user)
{
case
Admin:
System.out.println(
"
admin
"
);
break
;
case
User:
System.out.println(
"
User
"
);
break
;
case
Guest:
System.out.println(
"
Guest
"
);
break
;
default
:
System.out.println(
"
unknow
"
);
}
}
public
static
void
main(String[] args)
{
Login login
=
new
Login();
System.out.println(login.isAdmin(User.Admin));
login.printUserRole();
login.isRole(User.User);
}
}
]]>
]]>Rasmus Lerdorf, creator of the PHP langauge, has a new tutorial on his site today that looks at the creation of a "no-framework PHP MVC framework" using PHP5, the Yahoo! User Interface Library, and JSON.
He steps through the entire process of working up the "non-framework" - the goals of the project, why to go with the MVC approach for the structure, and, of course, the code.
That arose the PHP's own MVC Pattern discussion in PHP Community.But i have my own view.Here is my response in one of most famous PHP community:
其实我认为由于lerdorf演示的是一个PHP AJAX应用,所以其实很难跟cid的方案有什么对比。由于AJAX应用的特殊性,lerdorf这个所谓的controller根本不需要考虑进行完了相关的操作以后View到底应该去哪里,应该转向哪里?因为直接push给客户端JSON对象就好了,完全不用操心到a.php还是b.php
另外,虽然lerdorf说以后可能可以多个请求Include一个xxx.inc就是他的controller,但是目前的状况,即使成为MVC也是page controller,而cid想要做的是一个Front controller做请求委派,Front Controller的复杂的明显要比PC要高,考虑的问题也多。但是并不是说FC就好,asp.net不就是典型的page controller模式么?
但是说句我的真实感受:读完之后我把它看作PHP AJAX应用示例教程更合适,lerdorf的标题起的有点大了,而且读完以后没有给我任何架构上启示性的东西
而且那个if(isset($_POST[''])){}在里面做相关操作,我还是认为挺简陋甚至丑陋的。如果一个挺复杂的view采用此种方式,还是不优雅。
所以AJAX应用的controller有一部分应该放在View里面,一个页面a.html不一定非要请求到a.php,叶面里面的操作也是要有不同逻辑划分的,但是目前没有成熟的应用示例和解决方案。大家有没有自己的尝试?
AutoAssist is an auto completion web widget that written in pure JavaScript. It can help enhance the accessibility of existing website, let the users to work effective and feel comfortable. AutoAssist Javascript only and is built upon prototype and rico. Its main features are :
* improve the User Experience
* Don't require an Ajax experience
* pretty managed JavaScript, easy to understand and customize
* works well on Mozilla/FireFox, IE and Opera
* have a nice solution for fast user typing, reduce a lot of corresponding server loading (20% - 80% *)
The code for the screenshot is very simple :
var foo = function() {
var tt = new AutoAssist("t", {setRequestOptions: function() {
var pars = "name=" + this.txtBox.value;
return { url: "/country.php", parameters: pars };
}});
}
Event.observe(window, "load", foo);
You can find a ten minutes tutorial for AutoAssist explaining in details how to use this script to create an auto-complete list based on country data.
By the way,script.aculo.us also has it's impelmention:http://demo.script.aculo.us/ajax/autocompleter
But,You still need to care javascript's FUNCTION SCOPE.Also see code snippet:
var scope = "global";
function f( ) {alert(scope); // Displays "undefined", not "global"var scope = "local"; // Variable initialized here, but defined everywherealert(scope); // Displays "local"}f( );
Right,thought you alert(scope) first and then define a new functin scope variable scope.However,once you define a function scope vriable,it will hide the global variable in the function body,whatever the definition order.