Finally i understand primitive root, so happy so share here.
1st - How many primitive root of mod n ?
let n = 11
total primitive root is:-
phi(n-1) = phi(10)
...How to find phi(n-1) in case it is too big ???????
Got method 10 = 2 x 5 ( 2 also prime, 5 also prime),
let p = 2, q = 5,
so formula is phi(a) = a x ( 1 - 1/p) x (1 - 1/q)
phi(10) = 10 x (1 - 1/2) x (1 - 1/5)
= 10 x (1/2) x(4/5)
=4
**** teacher method is
phi(10) = phi(5) x phi(2)
= ( how many prime number less than 5) x
( how many prime number less than 2)
= 4 x 1
= 4
2nd - What is primitive root of mod n?
let n = 11
primitive root of n where all the integer numbers < 10 that
your power of mod n there is no repeatation
we start to test with 2
2^k, where 0 < k < 10
a , b , c , d, e, f , g , h , i
2^1, 2^2,2^3,2^4,2^5,2^6,2^7,2^8,2^9,
2 , 4 , 8, 5 ,10 , 9, 7, 3, 6 ------------>( mod 11)
.... see, there is no number repeat,
so we conclude 2 is primitive root of mod 11
3rd - Find all primitive root of mod n
continue..... let n = 11
once we have found one primitive root, we can find the rest of primitive root already
how?
let's look at the above calculation,
b is power 2, is gcd(2,10)= 1? no, so 4 is not primitive root
c is power 3, is gcd(3,10)= 1? yes, so 8 is not primitive root
d is power 4, is gcd(4,10)= 1? no, so 5 is not primitive root
e is power 5, is gcd(5,10)= 1? no, so 10 is not primitive root
f is power 6, is gcd(6,10)= 1? no, so 9 is not primitive root
g is power 7, is gcd(7,10)= 1? yes, so 7 is not primitive root
h is power 8, is gcd(8,10)= 1? no, so 3 is not primitive root
i is power 9, is gcd(9,10)= 1? yes, so 6 is not primitive root
so, we conclude that all primitive root for mod 11 are:-
2,8,7,6 ( total 4 as proved in part 1)
Friday, August 14, 2009
Tuesday, July 07, 2009
情迷祖龙任务攻略







情迷祖龙任务攻略(鼓励更多人加入到任务当中)■■■■■ 现在参加情迷祖龙任务的人越来越多啦,但好多人还是对任务不是很熟悉,因此编写了这个攻略,
希望有更多的人参加情迷祖龙任务 奖励好多啊......
一:一般规则
1、情迷祖龙任务过程中,男号和女号需组队四次(当然运气好只需要一次就可以啦,不过我最少都要组两次啦),当组队后,男女玩家需一同到特定NPC处接任务,然后一同跑路完成;
2、多数任务要求在接任务或者交任务的时候,男女玩家距离不能太远,当然最好是紧挨着。除接任务外,跑路过程中无需形影不离;
3、如果在接任务后交任务前(即身上没有任务物品的时候)队伍解散(比如掉线)或者其中一个玩家死亡,则任务失败。
二:任务过程
1、男玩家到祖龙城NPC侯方域(在祖南552 631,钱庄老板前牌坊的下边)领取任务,随机得到任务物品(一见钟情、比翼双飞、情比金坚、花好月圆、天荒地老)的任意一种。 女玩家在剑仙城NPC李香君(在剑仙434 886,剑仙长老前面)领取任务,随机得到任务物品(情有独钟,长相厮守,浓情蜜意,山盟海誓,海枯石烂)。
注意:每个任务物品有自己的名字,同时鼠标移动到物品上时,可看到物品说明,指明与持有那一种任务物品的男或女玩家可以组队继续任务。
2、得到对应配对物品的男女玩家可以组队到寻梦港NPC马伶(寻梦港673 362,夜哭入口前面)处领取任务。男性玩家必须为队长。男玩家接任务后(注意:女玩家只需要配合男玩家跑到马伶那里就可以了,无法接任务),任务会提示到特定地方(穿心湖、雪霏、夜郎、万劫、寻梦)找特定NPC。男女玩家结伴到该处找到NPC,男玩家接交任务即可。
3、男玩家到万化城NPC秦观(万化248 646,万化长老前面)处领取任务,随机得到任务物品(郎情妾意、心有灵犀、如胶似漆、情非得已)的任意一种。女玩家在积羽城NPC苏小妹(积羽城325 **,祭祀旁边)处领取任务,随机得到任务物品(眉目传情、魂牵梦萦、风情月意、意乱情迷)。得到对应配对物品的男女玩家可以组队去獠牙镇NPC苏东坡(獠牙镇447 340,獠牙镇祭祀旁边)处领取任务。男性玩家必须为队长。 注意:如果第一次任务组队双方获得的任务物品无法匹配,则需要解散队伍重新组队。以下同。
4、在苏东坡处领取任务后,男女玩家被传送到魔方房间内,在房间的四个角落有4个NPC,男玩家需依次找4个NPC对话完成任务。房间内漂浮各色小球,一些可以减慢玩家跑步速度,或者定身,红色小球每次可以打掉玩家超过1/3的血量。因此,一般我们都贴着墙壁跑,而且挨打了立刻吃药(别等着MM给你加,速度要紧,而且任务奖励的那么多药不吃干嘛)。
5、从房间出来后,男女玩家被传送到祖龙城南。男玩家到万流城NPC陆游(130 850,万流魔引使前面桥上)处领取任务,随机得到任务物品(恩恩爱爱、怡情悦性、含情脉脉)的任意一种。女玩家在天泪城NPC唐婉(468 570,天泪之城上)处领取任务,随机得到任务物品(莺莺燕燕、纸短情长、情意绵绵)。得到对应配对物品的玩家可以组队去桃源镇NPC陆宰(636 564,桃源镇内靠西边桥上)处领取任务。男性玩家必须为队长。
6、陆宰那里任务一个接一个,接好了后,会让男女玩家去找红豆,并且给你个坐标。男玩家将坐标告诉女玩家,然后两人一同到该坐标处转悠即可完成任务。之后男女玩家需结伴回到桃源镇陆宰那里交任务。
7、男玩家到祖龙城北NPC司马相如(521 684或534 686,城北大楼两旁)处领取任务,随机得到任务物品(伉俪情深、执子之手)的任意一种。女玩家在祖龙城南NPC卓文君(587 620,金花婆婆身后)处领取任务,随机得到任务物品(相濡以沫、与子谐老)。得到对应配对物品的玩家可以组队去万劫NPC卓王孙处领取任务。
8、男女玩家组队成功后,可以在万劫卓王孙(667 965,药师旁边)处领取同生共死任务,玩家领取任务后,会被传送到一个房间之内,男女玩家必须在里面成功生存100秒。则任务成功。如果有玩家中途退队或死亡,则任务失败。
9、从房间里出来后,男女玩家还要组队到万劫卓王孙那里交任务,然后一起传送到祖龙城北,顺着桥到城中间,那儿有个小个子的NPC桃花女,交任务接任务“彼岸花”
10、如果您和您的队友是当日的前10名,OK可以去城北传送旁边(桥边)NPC那里看看地上有没有彼岸花可以挖,有的话,男玩家去挖,两个人每人可以获得100点声望。
11、OK任务结束。三、任务奖励:
1、通关后,可以获得7个三生石,每5个三生石可以到城北彼岸花旁NPC那里换取约等于一次“疯狂的石头”任务所得的经验。每50个三生石可以换一双逐月无痕跑鞋(只有跑速1.2,没有其他任何属性,不可精炼,不可交易)。
2、在任务过程中,会得到一些“暮之露”(立刻回复1500点生命和1500点真气)。通关应该可以获得25个。不可交易。四:技巧和问题1、游戏时间:晚7点正点开始。不要太晚去做这个任务,否则队友很难找到。8点钟第一个NPC就无法接受任务了。9点钟任务结束。2、男号拿到任务物品后,最好主动到女号接任务的NPC那里去找女号 。四次组队分别到如下地点找:(1)剑仙长老;(2)积羽城传送或者祭祀那里;(3)镜湖居传送;(4)城南金花婆婆附近。 用普通频道喊找哪一种女号即可。
3、如果男号不主动,那女号只好主动去找男号了 。四次组队分别到:
(1)城南裁缝和织女中间;
(2)万化城传送或长老;
(3)万流城陆游(即魔引使前面)那里;
(4)城北(城西传送向北出了第一个大门对面的建筑上喊最好,两边都可以听到)。
4、男号在第三次组队时,如果获得的是“含情脉脉”,请找“情意绵绵”女号组队,而不是任务物品上所说的“相濡以沫”(这个是第四次组队的女号)。这是个BUG
5、男号在找司马相如是时,请参照上面攻略中位置,城北有两个司马相如,我看大家都去西边那个接任务了。如果一个接不了,找第二个接看看吧。
6、只有每次维护后才会在城北刷出10朵彼岸花,所以维护后的那次任务,请大家尽快吧,能传送就传送,力争前10名,可以获得100声望哦。
7、第一次组队任务找NPC,如果是到穿心湖、夜郎、寻梦,一般都能找到NPC,只是有时候需要耐心等等,如果是到雪霏和万劫 ,那就要碰运气了,找不到NPC是经常事儿,客 服说任务没问题,但是找不到就是找不到,所以既然找不到干脆就别找了,放弃任务该干嘛干嘛去吧。
8、找红豆技巧:男女玩家在指定坐标稍远处落地,然后一道跑到指定坐标处,比较容易得到红豆。
Wednesday, July 01, 2009
handle onkeypress enter in firefox
function doSubmit( e )
{
var keyCode = (window.Event) ? e.which : e.keyCode;
if( keyCode == 13 ) document.forms[0].submit();
}
{
var keyCode = (window.Event) ? e.which : e.keyCode;
if( keyCode == 13 ) document.forms[0].submit();
}
Saturday, June 27, 2009
Monday, June 22, 2009
alter multiple column sql
ALTER TABLE table_name
MODIFY (
column_1 column_type,
column_2 column_type,
...
column_n column_type );
MODIFY (
column_1 column_type,
column_2 column_type,
...
column_n column_type );
select duplicate record sql
select distinct userid from U_USER_GROUP
group by userid
having count(userid) > 1
order by userid
//// complex code to retrieve duplicate records ////
select userid, name
from U_USER_GROUP
where userid in
(select userid from U_USER_GROUP
group by userid
having count(userid)>1)
order by userid
////// delete duplicate records /////
delete FROM U_USER_GROUP e WHERE rowid>(SELECT MIN(ROWID) FROM U_USER_GROUP WHERE e.userid=userid)
go
group by userid
having count(userid) > 1
order by userid
//// complex code to retrieve duplicate records ////
select userid, name
from U_USER_GROUP
where userid in
(select userid from U_USER_GROUP
group by userid
having count(userid)>1)
order by userid
////// delete duplicate records /////
delete FROM U_USER_GROUP e WHERE rowid>(SELECT MIN(ROWID) FROM U_USER_GROUP WHERE e.userid=userid)
go
Tuesday, June 02, 2009
Creating MySQL database
Creating MySQL database on Linux system
- I assume that you are working from your account and not the root. Start a terminal session and become the superuser (Type su at the prompt and then enter the root password).
- Now we'll access the MySQL server. Type:The system prompts for the MySQL root password that you set up in Installing MySQL on Linux. (Note: This is not the Linux root password but the MySQL root password). Enter the password, which is not displayed for security reasons.
mysql -u root -p
Once you are successfully logged in, the system prints a welcome message and displays the mysql prompt ... something likeWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.22.32
Type 'help' for help.
mysql> - Now we are ready for creating the employees database. Issue the command:(Note: The command ends with a semi-colon)
create database employees; - An important point to note is that this database is created by the root and so will not be accessible to any other user unless permitted by the root. Thus, in order to use this database from my account (called manish), I have to set the permissions by issuing the following command:The above command grants my account (manish@localhost) all the permissions on employees database and sets my password to eagle. You should replace manish with your user name and choose an appropriate password.
GRANT ALL ON employees.* TO manish@localhost IDENTIFIED BY "eagle"
- Close the mysql session by typing quit at the prompt. Exit from superuser and come back to your account. (Type exit).
- To connect to MySQL from your account, type:Type in the password when prompted. (This password was set by the GRANTS ALL... command above) . The system displays the welcome message once you have successfully logged on to MySQL. Here is how your session should look like:
mysql -u user_name -p
[manish@localhost manish]$ mysql -u manish -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.22.32
Type 'help' for help.
mysql> - Typing the command SHOW DATABASES; will list all the databases available on the system. You should get a display similar to:
mysql> SHOW DATABASES;
+----------------+
| Database |
+----------------+
| employees |
| mysql |
| test |
+----------------+
3 rows in set (0.00 sec) - Enter quit at the mysql> prompt to come out of the mysql client program.
Subscribe to:
Posts (Atom)