phpBB4 vs cloud?

It is still at its brainstorming stage, but I do expect a lot from phpBB4 and so I decided to spend time with it. Here is the link to the discussion board
http://area51.phpbb.com/phpBB/viewforum.php?f=75

I think most softwares today are in concrete form and I am a fan of abstraction. I like to make software cloud-based. The Internet is a cloud, a globally interconnected network. I can literally predict that this is the only way software will be written in the future.

Look at Google Wave, an amazing application which embeds all the top Internet features into one: E-mail, IM, game, community, wiki and ect. The only obstacle is hardware. Most American users are probably still using DSL, or those cheap Cable services. They are not fast enough to support cloud computing like Chrome OS and definitely not ready for Google Wave either.

My suggestion is to make phpBB4 an extension or an application based on Google Wave. Use the existing resources to enrich phpBB4. However, I think the developers hate this idea and they definitely do not want to re-invent forum's paradigm.

I can hardly accept their bigot minds and I cannot see the future of any forum software at the moment. I told them forum is an obsolete and they probably thought I was referring to social network. No, not exactly. In fact, social network was not a new thing at all. We had a fixed definition of forum - this killed forum.

In my mind, we need to make every user an object, a cloud. This is the new definition of a forum - everything is a cloud. This is very abstract and indeed I like to make things abstract so that I can get the best innovations out of the box.
(more...)

WP Cache Solution: SuperCache vs 1Blogcacher vs Hyper-cache

I will do a more complicated all-round analyst later when I get the time. But as far as what I did in the past, I can tell you right away, 1blogcacher blow up the other two.

WP-Super Cache (0.9.6.1): http://wordpress.org/extend/plugins/wp-super-cache/
Hyper-Cache (2.4.2): http://wordpress.org/extend/plugins/hyper-cache/
1Blogcacher (2.0.4): http://1-blog-cacher.javier-garcia.com/#requirements

I first ran Super Cache, and I found the blog accessibility was getting difficult. The amount of time to finish loading was getting longer each time. I thought it was just a host problem but when I disabled the super-cache, the time got shorten.

Super Cache only cache two or three pages according to what I see. I enabled eveything: gzip, Super Cache and WP-Cache and did all sorts of optimizations. I gave up on Super Cache.

Then I decided to give a try to Hyper-Cache. It has a very good feature for mobile cache. But according to my testing, and the statistic it provides, 90% of the caching failures.

I finally gave my last try to 1blogcacher. The loading time is better than Super Cache and Hyper-Cache.

Here are a few reasons.

Query time [ look at footer]

  • SuperCache: 0.25 - 0.40 seconds
  • Hyper-Cache: 0.90 seconds - 1.20seconds
  • 1blogcacher: 0.40 seconds - 0.60seconds

(more...)

好久沒寫blog了

主要原因嘛...是忙, 也是病了一場, 也是累了...
說說上星期發生了什麼事吧....
星期一和星期二都沒上課, 還是太累, 病了...

星期三上課了...下午Arista rehersal之後就坐Q17, 想找工作...
找了一個小時才知道原因我找的168 bakery不在超市對面, 是真的是在圖書館對面...
我走了一個小時的路...到了, 他們關閉...唉
那天坐Q17, 有跟她在坐同一輛Q17...

星期四是Arista Installation....
5點多穿好筆直的西裝 (藍色配黃色的 tie), 覺得很帥...
走到QC的路上...感覺很怪...到了巴士站更是坐立不安... 就像以前早上等她來Q88一樣...那種不安的感覺...
時間早, 又想等她來, 所以跟Sherman說我會等他來到巴士站
等了大概40分鍾左右他終於到了...
不過Wendy沒有來....我想是她坐她爸的去學校了

在巴士上那幾個 chinese junior都說「男生都穿得好帥喔」, 感覺上是的, 我像是個 在Wall Street打工的CEO呢,,,哈哈

到了那裡還是沒看到...那裡悶死了
後來看到她, 穿的沒有我預計中的那樣, 就簡單的黑色衣服配一條黑色的緊身牛仔褲和一雙白鞋, 不過穿得很好...
她那麼好看....

整個典禮沒什麼特別, 上台拿我的certificate的時候, 校長特別給我一個特別的 hand shake和跟我聊了好幾秒鍾
這大概是整個晚上最好的部份, 雖然沒有人家那樣, 樓下的同學都給你尖叫, 給你拍手掌, 最少有這麼特別的一刻, 在台上跟校長聊一會, 算是光榮了吧?

我也當然跟 arista的 president kenny有握手, 他也當然很熱情給我講congrulation...畢竟我以前是他的對手啊, 想當這個president的嘛...

她上台的時候我有看...
這應該是我最後一次在以這個學校的學生身份穿上西裝, 我不太可能去畢業典禮了...
我也只能以這個經驗去體會她下年再來這個典禮和畢業典禮的情況了...

還有81天, 4月6日至6月26日...就81天而已.....
星期五沒什麼, 回家就睡覺...睡到星期六....
晚上終於跟Jen聊起來... 約了星期三下午下課後在Junction見個面, 打算給她一些SAT的東西....

using fetch method to get rank title in phpBB

I was coding my phpbb mod and I had troubled with getting the rank title from the database. I went to Star TrekGuide for help, and it turned out to be a great idea.
get rank title

According to what Erik suggested, the way it works is to fetch it out once we get the correct and value from the table.
The problem I had was didn't get any value in return, so my codes failed to get either the correct row, or didn't get anything out from the table.

The correct way is to do something like as the following

1
2
3
$sql = 'SELECT *
   FROM '
. RANKS_TABLE . '
   WHERE rank_id = '
. $user->data['user_rank'];

So I got the concept and went ahead coded the rest on my code.
The resulting code is this:

1
2
3
4
5
6
7
8
$sql = 'SELECT rank_title
   FROM '
. RANKS_TABLE . '
   WHERE rank_id = '
. $user->data['user_rank'];
$result = $db->sql_query($sql);
$rank_title = $db->sql_fetchfield('rank_title');
$db->sql_freeresult($result);

'RANK_TITLE'  =>  $rank_title;

Another fact I learned is the problem with free the sql result, or close down the query.
I was tricked by the fact that, in phpBB, the developers do not immediately close down the request all the time. Sometime $db->sql_freeresult($result); is used right after the $sql selection request, but in most cases, in the page footer, one single $db->sql_freeresult($result); will be enough to close all the requests.

Of course, it will still be good to close it right after each $sql. But for a larger application like phpBB as a whole, it is very reasonable to close them down all at once (not always all, most of the time, yes).

Reference from Erik

The $db->sql_freeresult($result); is used always. I think that you are tricked by the fact that it isn't always called right after the query, sometimes this isn't possible as you might want to re-use the result later on or just don't want to worry about it.
Due to the way phpBB is setup you can (but shouldn't) leave the call out at all as long you call the garbage_collection() function somewhere (this is done in page_footer()) as this function calls the $db->sql_close() method. This method will run $db->sql_freeresult($result) on all open queries before it closes the database connection.
Good coding practices however makes you to call it yourself.

Working on phpBB mod again

Yes, I am working on some phpBB mod again. I haven't update any of my small mod for really a long time: just a year :)
Well, I did like 20% of the work today, re-coding my avatar mod into a real welcome panel modification which I planned a year ago.

This is not just a new feature but to enhance the forum system in a way.
The design was still very ugly, I'd rather to have jquery accordion to do the job, but I withdrew the plan because I just couldn't find a dream one: speed, light-weight, and feature-useful.

Many of the jquery acordion I found are very heavy and slow. If I have to include php, loading data, it will cause a big trouble on the users.

Here is the screenshot on what I did today, very messy, very bad, if you look at all those php and html files I opened, you probably will get a heart attack because they were so messy... new codes were all over the place...

#

祝英台

到底是祝英台, 還是祝英愛?

她喜歡的人不是我, 我知道的

從她的blog, 看了, 眼睛痛起來, 那種感覺, 很久沒有了....
我想知佢係邊個, 我估唔到個名.... 佢特登咁樣隱藏...我睇要花一段時間先知係邊個....
我其實想睇下, 佢係點樣的一個人, 點解會吸引佢?

Discuz6.0 - remove one of the hide option

So I came across with this problem before I went to bed. I took 20 minute trying to help this member help.
Eventually the modification worked out.
Here is the thread
能否去掉 隱藏按鍵 積分文字去除問題

Hmm. so initially I went to include/javascript/editor.js and removed this line

Find

1
                str += cmd == 'hide' ? '<input type="radio" name="' + ctrlid + '_radio" id="' + ctrlid + '_radio_1" checked="checked"/>只有當瀏覽者回復本帖時才顯示<br /><input type="radio" name="' + ctrlid + '_radio" id="' + ctrlid + '_radio_2"/>只有當瀏覽者積分高於 <input type="text" size="3" id="' + ctrlid + '_param_2"/> 時才顯示' : '';

Replaced with

1
                str += cmd == 'hide' ? '<input type="radio" name="' + ctrlid + '_radio" id="' + ctrlid + '_radio_1" checked="checked"/>只有當瀏覽者回復本帖時才顯示' : '';

It didn't work out at all. The member reported it and said he couldn't insert the hide tag anymore. I checked the source and thought I was missing something there.
The first attempt was to not to remove the 2nd input value. Just leave it there. So only the button remained, but it looked ugly.

I wanted to remove the 2nd input completely from this js source code. I thought this would be a robust modification. Now, I checked the source carefully. I realized this hide tag, has two sections:
[1] the first section is what I modify. It is the input make-up, has little to do with the actual insertion.
[2] the code below it is a function. It controls how the tag will be insert.

So i am on the right path......

(more...)

Advanced Points System for phpBB3 (clean up for v0.8.2) - Part 1

Since I am working on a mod-packed phpBB, so I came across with this modification developed by Adrian.
The modification homepage is here:
http://phpbbgods.org/index.php

I am not the author of this mod. Adrian is the author.

So, this is a great mod but there are so many things that the author needs to clean up before moving to the next version.
There are three major problems:

[1] The subsilver2 template, many minor changes, or outdated advanced points system add-on.
[2] The language files which will also link to the issue with the outdated subsilver2
[3] The transfer system in version 0.8.2 should upgrade

Let me get this started.
The major problem with the subsilver2 template is that, adrian, probably too busy with fixing the php content of the code (the core), didn't remember to re-code the subsilver2.

Some of the add-on template conde in subsilver2 are outdated. For example:

Open Points\root\styles\subsilver2\template\points_bank.html

1
 Options

(more...)

Remove the stupid wordpress html filter

Yeah, if you are really upset about the html filter by wordpress, this is what you want, then you are reading the right entry.

So i searched around and finally I got some other articles complaining about this.
There are two reasons why i need to stop the filter

1) it filters my < and > tags, so they won't appear in my highlight code tag
instead, you will see #include , not #include
2) it's annoying, i don't like dealing with it

so here is the solution

[ 1]open up wp-include/kses.php
Find

1
2
3
4
    // Post filtering
    add_filter('content_save_pre', 'wp_filter_post_kses');
    add_filter('excerpt_save_pre', 'wp_filter_post_kses');
    add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

Replace with

1
2
3
4
5
6
7
8
9
10
    // Post filtering
    // add_filter('content_save_pre', 'wp_filter_post_kses');
     add_filter('excerpt_save_pre', 'wp_filter_post_kses');
    // add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}

function disable_kses_content() {
remove_filter('content_save_pre', 'wp_filter_post_kses');
}
add_action('init','disable_kses_content',20);

[2] finally, you need to download this plugin
Quotmarks Replacer

http://sparanoid.com/archive/wordpress/quotmarks-replacer/

You will need it, trust me, to disable those annoying special character filters.

another fun c++ program

It's just for fun, i will integrate a similar one into my hello world program :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Let me trying to run another calculation program
// no more salary now
// let gets this people vs bandwidth

#include <iostream>
using namespace std;

// let us do a gloabl variables

   int visitorNumber, visitBotNumber, bandwidth, dataSize, transferTime;
   signed int dataBWR = 4;

// let us begin the main body of this program

int main()
    {
          // asks some questions
          int x;
          cout << "How many visitors so far?\n"<< endl;
          cin >> x;
          cin.get();

          int y;
          cout << "How many bot visitors?\n"<< endl;
          cin >> y;
          cin.get();

          int z;
          cout << "What is the total amount of data size being uploaded?\n"<< endl;
          cin >> z;
          if (z >10000)
             bandwidth = (x + y) + (dataBWR * z);
          else
              bandwidth = (x + y) * (dataBWR);
          cin.get();
          cout << bandwidth;
          cin.get();
          return 0;
    }
Page 1 of 512345»