Tuesday, May 20, 2008

Ally salutes

Ally salutes to those rescue dogs in 2008 Sichuan Earthquake!
Ally向四川大地震中的搜救犬敬礼!

Read more!

a nice label cloud for Blogger

Here is the link to How to add the label cloud to your Blogger and thanks for the wonderful work
Read more!

Wednesday, May 14, 2008

Use Fiddler with Firefox

Fiddler is a awesome tool for monitoring the net traffic and it is free for download. Yeah, I knew that there is a FireBug, which also can help you monitor the net traffic. Why bother?

The FireBug console is a plug-in to the Firefox browser, and it is window based, which I guess each tab will have a different FireBug instances for monitoring the HTTP traffic. So there is no central place for monitoring HTTP traffic from all opened browser windows. If something goes wrong in the window, which is then closed, the record for the HTTP traffic before the error occurs will be missing. By letting the Fiddler monitor the HTTP traffic in your Firfox browser will avoid this issue.

Fidder works very well with IE browser and no effort will be required to let Fiddler monitors the HTTP traffic in the IE browser. For Firefox, you need to

* Open options from the Tool menu item and click Advanced tab
* Go to Network | Connection Settings
* Use the Manual proxy configuration option
* Set Http proxy to 127.0.0.1 and Port 8888



Read more!

Tuesday, May 13, 2008

Increase File Upload Limit for Moodle

The uploaded file size limit in Moodle actually is determined by Apache and PHP, and the default value is 16MB, which may not be big enough for those Flash based courses with audio and video. To increased the file size limit

First find the file httpd.conf under the directory apache\conf and make the following changes
LimitRequestBody 52428800
#OR
#LimitRequestBody 50M

Then find the php.in under the directory apache\bin and make the following changes
upload_max_filesize 52428800
post_max_size 52428800


Now restart Apache and MySQL and log into Moodle with administrator user, you should find the available file size limit for the site has been increased from
Site Administration > Courses > Add/Edit courses > select Course category & edit each course > Maximum upload size
Site Administration > Security > Site Policies > Maximum uploaded file size


Read more!

Monday, May 12, 2008

Adding Google Prettifier to Blogger

First download the Google Prettify and upload it to somewhere and in this tutorial we use http://xxx.org as an example.

Goto dashboard, and click Editing HTML under the Layout tag, add the following two lines in the <head> tag
<link href="http://xxx.org/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://xxx.org/prettify.js"></script>


The next thing is to find the <body> tag and change it to
<body onload='prettyPrint()'>


Ok, you are done and you can create a post testing this feature. For example, creating a post with the following code
<pre class='prettyprint'>
class Voila {
public:
// Voila
static const string VOILA = "Voila";

// will not interfere with embedded tags.
}
</pre>

and here is the result
class Voila {
public:
// Voila
static const string VOILA = "Voila";

// will not interfere with embedded tags.
}


PS: Made some improvement to the prettify style and add overflow: auto; for pre.prettyprint

pre.prettyprint { padding: 2px; border: 1px solid #888; overflow: auto;}



Read more!

Thursday, May 8, 2008

Create summaries for the blog posts

Please refer to the How can I create expandable post summaries? in the Blogger help. Here is my experience with my template.

In blogger Dashboard, click layout and select 'Edit HTML' tab. The first thing you need to do is to download the full copy of the template in case you mess up something with the template. At least, you can recover it by uploading the full copy. The template should be a xml file. Please make a copy before any further action.

Now open the xml file in your favored editor, since I am using the layout template, I have to add the following style definition into <header>
   <b:if cond="data:blog.pageType == "item"">
span.fullpost {display:inline;}
<b:else>
span.fullpost {display:none;}
</b:else>


In my template, there is a big section for <b:skin> tag in the header, so I placed the code above just after it and before the end of <head>. This actually defines the style for class fullpost of span tag. If all blogs are on the same page, any texts of class fullpost will be hidden; otherwise, they will be displayed.

The next thing is to enable the summaries ("Read More" link at the end of the blog) when your blog posts are listed on the page.
</b:skin></b:if><div class="post-body entry-content">
<p>
<data:post.body>
<!--add for blog summary-->
<b:if cond="data:blog.pageType != "item"">

<a href="data:post.url">Read more!</a>
</b:if>
<!--end-->
</data:post.body></p>
<div style="clear: both;"> <!-- clear for photos floats -->
</div>

Finally, you need to specify which part of the blog will be hidden. You can use <span> tag (<div> tag doesn't work). Please refer to the help for more information or check this post itself.

Read more!

Wednesday, May 7, 2008

Perforce HOW -- remove a changelist

Here is the command for removing the changelist if you don't have the P4 window client

p4 [-c clientName] change -d changelist_number

Read more!