分頁: (3) 1 [2] 3  ( 前往第一篇未讀文章 ) Reply to this topicStart new topicStart Poll

> 活躍度設定
耒戈氏
發表於: Aug 20 2015, 22:52  
Quote Post


反潮流才是王道!!
************

發表數: 6,255
所屬群組: 太守
註冊日期: 7-15-2007

活躍:23
聲望:1540


I just omitted any normalization tongue.gif
PM
Top
徐元直
發表於: Aug 21 2015, 08:57  評價+1
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


QUOTE (耒戈氏 @ Aug 20 2015, 07:33 )
那樣其實用留言+評價也可以的,不一定要用登入時間

---

又想到一件事,如果如實地只計90天內的帖子的話,應該有很多人的活躍度會變成零了 tongue.gif 也許可以加一個總帖數/總天數x0.1作打底 grin2.gif

正在測試用最近留言數來決定活躍度。僅僅統計每人最近7天的發帖數(爲頁面中每一個發帖者只跑一次SELECT COUNT的query),Script Execution time就從0.03秒飆升一個數量級到0.3秒左右,增長了十倍。 damn.gif

本篇文章已被 徐元直 於 Aug 21 2015, 10:25 編輯過


--------------------
......
PMEmail Poster
Top
耒戈氏
發表於: Aug 21 2015, 11:21  評價+1
Quote Post


反潮流才是王道!!
************

發表數: 6,255
所屬群組: 太守
註冊日期: 7-15-2007

活躍:23
聲望:1540


blink.gif

可否每天用cron job計算一次然後儲在一欄裡?
PM
Top
neveryield
發表於: Aug 21 2015, 15:44  
Quote Post


一品官
************

發表數: 2,057
所屬群組: 一般
註冊日期: 9-30-2010

活躍:12
聲望:529


不是有 "今日發表前十" ,"最近七天發表前十" 一類統計嗎?


--------------------
世間之事,惟鬥爭已。

既便你達成了那最高尚的目的,亦無法彌補因为你採用了最卑劣的手段所帶来的恶劣影響。

一碗醇酒拈手來,坐看洪流不復來
經年不見花已殘,舊日芳人何處尋
開醰陳酒香四溢,醉臥山河愁不還
倒酒為河,夾肉為林,有此佳肴,何以為憂?
眾人皆醒,唯我猶夢中,不知年日,問長城依舊?

一竹獨行,十木皆枯,百里無塵,千秋不還。
日月更年,星晨生息,西海東來,南松北往。
還看舊地,天移地去,綠葉無蹤,礫石為孤。
蒼蒼茫茫,滴水沉泥,青草既出,逝會歸回?

大雪連綿千幾里,孤房門角一窗櫺,
老湖中間一條狗,獨坐冰樹望烏雲。

杯中良酒回回香,甘甜酒辣酸辛苦,
佳陳何止千百變,喜愁哀樂豈無嚐?
PMEmail PosterUsers Website
Top
徐元直
發表於: Aug 21 2015, 17:19  
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


QUOTE (neveryield @ Aug 21 2015, 08:44 )
不是有 "今日發表前十" ,"最近七天發表前十" 一類統計嗎?

有,但該頁也是顯示才統計,執行時間在1.5秒左右。


--------------------
......
PMEmail Poster
Top
Pearltea
發表於: Aug 21 2015, 17:30  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:5
聲望:614


QUOTE (耒戈氏 @ Aug 21 2015, 19:21 )
blink.gif

可否每天用cron job計算一次然後儲在一欄裡?

元直, is it time consuming to run what 耒戈氏 proposed - daily update?

I would assume that even with daily posts/votes, the activity level wouldn't change so much to the point that requires recalculations every time a post is loaded.

本篇文章已被 Pearltea 於 Aug 21 2015, 19:43 編輯過
PMEmail Poster
Top
徐元直
發表於: Aug 21 2015, 18:39  評價+4
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


QUOTE (Pearltea @ Aug 21 2015, 10:30 )
QUOTE (耒戈氏 @ Aug 21 2015, 19:21 )
blink.gif

可否每天用cron job計算一次然後儲在一欄裡?

元直, is it time consuming to run what 耒戈氏 proposed - daily update?

I would assume that with even daily posts/votes, the activity level wouldn't change so much to the point that requires recalculations every time a post is loaded.

Cron job should be feasible, I'm testing the code now.

Edit: Just tested the code, takes less than 10 seconds to count last-7-and-30-day post numbers for each of the ~4300 members. This should work. I'm going to add reputation vote counter as well.

本篇文章已被 徐元直 於 Aug 21 2015, 18:50 編輯過


--------------------
......
PMEmail Poster
Top
Pearltea
發表於: Aug 21 2015, 19:48  評價+2
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:5
聲望:614


QUOTE (徐元直 @ Aug 22 2015, 02:39 )
QUOTE (Pearltea @ Aug 21 2015, 10:30 )
QUOTE (耒戈氏 @ Aug 21 2015, 19:21 )
blink.gif

可否每天用cron job計算一次然後儲在一欄裡?

元直, is it time consuming to run what 耒戈氏 proposed - daily update?

I would assume that with even daily posts/votes, the activity level wouldn't change so much to the point that requires recalculations every time a post is loaded.

Cron job should be feasible, I'm testing the code now.

Edit: Just tested the code, takes less than 10 seconds to count last-7-and-30-day post numbers for each of the ~4300 members. This should work. I'm going to add reputation vote counter as well.

Hooray!

Thanks for making the change.

I couldn't care less if the bar moves in either direction, but I guess no one will pick on my miserably low number anymore grin2.gif
PMEmail Poster
Top
Pearltea
發表於: Aug 21 2015, 19:52  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:5
聲望:614


QUOTE (徐元直 @ Aug 22 2015, 02:39 )
QUOTE (Pearltea @ Aug 21 2015, 10:30 )
QUOTE (耒戈氏 @ Aug 21 2015, 19:21 )
blink.gif

可否每天用cron job計算一次然後儲在一欄裡?

元直, is it time consuming to run what 耒戈氏 proposed - daily update?

I would assume that with even daily posts/votes, the activity level wouldn't change so much to the point that requires recalculations every time a post is loaded.

Cron job should be feasible, I'm testing the code now.

Edit: Just tested the code, takes less than 10 seconds to count last-7-and-30-day post numbers for each of the ~4300 members. This should work. I'm going to add reputation vote counter as well.

wacko.gif Hold on...10 seconds for each of the 4300 members? Even with only 9 seconds you're looking at 38,700 secs for the calculation, which translates to 645 mins or 10 hrs 45 mins, no?

本篇文章已被 Pearltea 於 Aug 21 2015, 19:54 編輯過
PMEmail Poster
Top
Pearltea
發表於: Aug 21 2015, 20:39  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:5
聲望:614


活躍度: 120
發表數: 728
所屬群組: 一般
註冊日期: 9-22-2003

聲望:158

I just noticed the change...Shouldn't 活躍度 be capped at 100?
PMEmail Poster
Top
徐元直
發表於: Aug 21 2015, 20:43  評價+1
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


QUOTE (Pearltea @ Aug 21 2015, 12:52 )
QUOTE (徐元直 @ Aug 22 2015, 02:39 )
QUOTE (Pearltea @ Aug 21 2015, 10:30 )
QUOTE (耒戈氏 @ Aug 21 2015, 19:21 )
blink.gif

可否每天用cron job計算一次然後儲在一欄裡?

元直, is it time consuming to run what 耒戈氏 proposed - daily update?

I would assume that with even daily posts/votes, the activity level wouldn't change so much to the point that requires recalculations every time a post is loaded.

Cron job should be feasible, I'm testing the code now.

Edit: Just tested the code, takes less than 10 seconds to count last-7-and-30-day post numbers for each of the ~4300 members. This should work. I'm going to add reputation vote counter as well.

wacko.gif Hold on...10 seconds for each of the 4300 members? Even with only 9 seconds you're looking at 38,700 secs for the calculation, which translates to 645 mins or 10 hrs 45 mins, no?

No, I mean less than 10 seconds total to "count last-7-and-30-day post numbers for each of the ~4300 members".

Now I have optimized the code, it will only scan members who has ever made a post or made a vote, and was active within the last 30 days. This shortened the loop to process only ~50 members, and takes less than 3 seconds to complete.

Now I have the data, I'm working on the formula, you may see the number change rapidly as I adjust the calculation.


--------------------
......
PMEmail Poster
Top
徐元直
發表於: Aug 21 2015, 20:56  
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


QUOTE (Pearltea @ Aug 21 2015, 13:39 )
活躍度: 120
發表數: 728
所屬群組: 一般
註冊日期: 9-22-2003

聲望:158

I just noticed the change...Shouldn't 活躍度 be capped at 100?

I will cap it at 100 eventually, but now I want to see the actual number to adjust the formula.


--------------------
......
PMEmail Poster
Top
徐元直
發表於: Aug 21 2015, 23:45  評價+1
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


調整出一個方案,大家給點意見?

活躍度計算方法如下:

(A)有登入的總日數 / 註冊至今總日數
(B)最近訪問是在多少天之前 (如超過30則當作30)
(C)最近7天發帖數 + 最近30天發帖數/3 + 最近7天評價他人次數/3 + 最近30天評價他人次數/9 (C項非即時更新,暫定每小時自動更新一次)

活躍度= A*30 +(30 - B)+ C*1.5

超過100只顯示100。

本篇文章已被 徐元直 於 Aug 21 2015, 23:53 編輯過


--------------------
......
PMEmail Poster
Top
耒戈氏
發表於: Aug 22 2015, 01:41  
Quote Post


反潮流才是王道!!
************

發表數: 6,255
所屬群組: 太守
註冊日期: 7-15-2007

活躍:23
聲望:1540


QUOTE (徐元直 @ Aug 22 2015, 07:45 )
調整出一個方案,大家給點意見?

活躍度計算方法如下:

(A)有登入的總日數 / 註冊至今總日數
(B)最近訪問是在多少天之前 (如超過30則當作30)
(C)最近7天發帖數 + 最近30天發帖數/3 + 最近7天評價他人次數/3 + 最近30天評價他人次數/9 (C項非即時更新,暫定每小時自動更新一次)

活躍度= A*30 +(30 - B)+ C*1.5

超過100只顯示100。

看上去還合理

剛新進的會員只須7天也登入而且發20帖(或60個評價)就100活躍度了,不過以今天HKSAN的情況其實還可以

PM
Top
徐元直
發表於: Aug 22 2015, 02:03  評價+1
Quote Post


攤抖首領
************

發表數: 7,909
所屬群組: 君主
註冊日期: 9-18-2003

活躍:62
聲望:4175


順帶一提,今天還順手搞了些其他的更新。

http://hksan.net/forum/index.php?showtopic...ndpost&p=223950


--------------------
......
PMEmail Poster
Top
Pearltea
發表於: Aug 22 2015, 05:55  
Quote Post


四品官
*********

發表數: 1,289
所屬群組: 太守
註冊日期: 9-22-2003

活躍:5
聲望:614


QUOTE (徐元直 @ Aug 22 2015, 07:45 )
調整出一個方案,大家給點意見?

活躍度計算方法如下:

(A)有登入的總日數 / 註冊至今總日數
(B)最近訪問是在多少天之前 (如超過30則當作30)
(C)最近7天發帖數 + 最近30天發帖數/3 + 最近7天評價他人次數/3 + 最近30天評價他人次數/9 (C項非即時更新,暫定每小時自動更新一次)

活躍度= A*30 +(30 - B)+ C*1.5

超過100只顯示100。

I like it. It weighs evenly with the 3 main activity attributes and applies a heavier weight or 'bonus' (1.5) to participations. Then the count of comments is a more decisive factor than the count of votes, so it seems pretty reasonable to me.
PMEmail Poster
Top
Caesar
發表於: Aug 22 2015, 08:01  
Quote Post


Loop
************

發表數: 7,489
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:24
聲望:2218


Sooooooooo
Whats the tick next to 100?

本篇文章已被 Caesar 於 Aug 22 2015, 08:01 編輯過


--------------------
Get busy living, or get busy dying.

.
PM
Top
Caesar
發表於: Aug 22 2015, 08:15  
Quote Post


Loop
************

發表數: 7,489
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:24
聲望:2218


QUOTE (徐元直 @ Aug 22 2015, 07:45 )
調整出一個方案,大家給點意見?

活躍度計算方法如下:

(A)有登入的總日數 / 註冊至今總日數
(B)最近訪問是在多少天之前 (如超過30則當作30)
(C)最近7天發帖數 + 最近30天發帖數/3 + 最近7天評價他人次數/3 + 最近30天評價他人次數/9 (C項非即時更新,暫定每小時自動更新一次)

活躍度= A*30 +(30 - B)+ C*1.5

超過100只顯示100。

看見我那個93,這實在太傷心了

我在最近七天及三十天發表數、重訪次數也是名列前茅的。
既然我能上來看了,B部也該是滿分的。

可我的帳號是十年前註冊的,而且有經歷兩三次為時一年以上的深潛。
這部分追不回來呀。(除非重現昔日大小滿灌的神話)

可否私心提議,在C部加一項,總發表數/1000 這樣 twisted.gif (你喜歡 /500 or /250 也可以 )

即使抽離自身利益關係,我認為這也是合理的。
哪天要是蛇魔外遊消失一個月,他的活躍度只剩二十多。
可要說咱家HKSAN,有誰比他更活躍的?

有個總發表數當補底,活躍度下降也慢一點,在計算上也不太構成負擔,
而且為論壇貢獻1000貼才補底一點,也不為過呀?

本篇文章已被 Caesar 於 Aug 22 2015, 08:29 編輯過


--------------------
Get busy living, or get busy dying.

.
PM
Top
耒戈氏
發表於: Aug 22 2015, 11:33  評價+2
Quote Post


反潮流才是王道!!
************

發表數: 6,255
所屬群組: 太守
註冊日期: 7-15-2007

活躍:23
聲望:1540


名列前茅即是多少啊?(要知道今天活躍於HKSAN的少於十個) twisted.gif

如果外遊沒上的話,其實在系統看來就真是不活躍了,當然要降低一下。如果太狠的話,不如把一星期內的帖改成兩星期內的帖,一個月的帖改成兩個月的帖?
PM
Top
Caesar
發表於: Aug 22 2015, 13:20  
Quote Post


Loop
************

發表數: 7,489
所屬群組: 軍團長
註冊日期: 12-18-2004

活躍:24
聲望:2218


QUOTE (耒戈氏 @ Aug 22 2015, 19:33 )
名列前茅即是多少啊?(要知道今天活躍於HKSAN的少於十個) twisted.gif

如果外遊沒上的話,其實在系統看來就真是不活躍了,當然要降低一下。如果太狠的話,不如把一星期內的帖改成兩星期內的帖,一個月的帖改成兩個月的帖?

所以你忘了示意,你對這提議的態度是positive 還是negative呀


--------------------
Get busy living, or get busy dying.

.
PM
Top
0 位使用者正在閱讀本主題 (0 位訪客及 0 位匿名使用者)
0 位會員:

Topic Options分頁: (3) 1 [2] 3  Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0125 ]   [ 13 queries used ]   [ GZIP 啟用 ]