Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Webkit



  Writing Java codes conforming to coding standard

Recently, I was doing some cleanup to one of my current Java project. I find there are many codes which are not conforming to the Java coding standard. So I list them here and hope that people can improve your codes and write maintainable codes. Format source code and manage imports in Eclipse Eclipse provides functions of auto-formatting and imports management, you can use following shortcuts to use these functions. Ctrl+Shift+F --> Format source code Ctrl+Shift+O -- Manage imports an...

   Java, Code standard,Style     2012-09-18 12:50:28

  JavaScript cross domain request solution

1. What is cross domain? We may often using AJAX to request data from other domain, now we will have cross domain request issues. It's because JavaScript only allows to request data from the same domain because of security consideration. In short, same domain strategy means a piece of code can read data from the same source, the same source here means the combination of the same domain, protocol and port number. For example: URLDescriptionAllow communication? http://www.a.com/a.js http:/...

   AJAX,cross domain,security     2013-03-13 20:04:52

  Big file transfer in Linux

It's very common that we need to transfer files between two different hosts such as backups. It is also an very simple task, we can use scp or rsync to complete the task well. But what if the file is very big, it may take some time to transfer it. How can we transfer a big file with high speed? Here we propose one solution. Copy file If we copy one uncompressed file, then we should follow below steps: Compress data Send it to another host Uncompress the data Verify the data integrity This will...

   Linux, SCP,ZIP     2013-01-10 05:55:50

  10gen provides free training courses for MongoDB

MongoDB is an open source document oriented database, developed with C++, it is to solve some real problems existing among development communities. In October 2007, MongoDB development began at 10gen, in 2009, MongoDB was open sourced as a standalone product. 10gen provides technical support, training and consultancy service. According to 10gen education, 10gen will provide some training courses for MongoDB starting from 22 October, 2012. Now it's available for registration. There are two cours...

   MongoDB,10gen,training,course,free     2012-09-20 22:51:43

  How to find which process a file is being written by in Linux?

Some people ask a file is being written by one process and they want to check this process, but they cannot find the process even with sof. This question is very common and there are many solutions, here we introduce a straightforward method. In Linux, each file will be stored on one device and of course there will be a relative inode, then we can use vfs.write to know who is writing the inode on one specified device continuously. Luckily there is inodewatch.stp in the installation package of s...

   Linux,process,file write     2013-03-16 21:44:35

  Integer overflow

You may be familiar with integer overflow, but what you may not be familiar with is how gcc handles signed integer overflow. First let's look at the standard, for unsigned integer, the standard says : A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type. In other words, unsigned integer ov...

   Integer overflow,gcc,Linux     2012-10-20 13:33:10

  Using Fabric to deploy web app

Many people may use FTP and rsync to synchronize codes to server, this way is fine but it may be troublesome when you need to deploy many times a day, actually there is a simple way if you can spend time on finding the fast way. We introduce Fabric today for deploying web app to remote server. Fabric is a deployment tool written with Python, the biggest feature if it is you no need to login to remote server, you can execute remote commands locally. Here is s simple deployment script written with...

   Fabric, Web deployment,SSH,Python     2012-12-08 03:16:00

  Good to Great Python reads

A col­lec­tion of python “must reads”:The Python yield key­word explainedPython’s super() con­sid­ered super!Under­stand­ing Python DecoratorsWhat is a meta­class in Python?Meta­classes DemystifiedTry/Catch for val­i­da­tion or speed?Python (and Python C API): __new__ ver­sus __init__Python “self” keywordPython and the Prin­ci­ple of Least AstonishmentA Curi­ous Course on Corou­tines and Concurr...

   Python,Reference,eBook,Reading Material     2011-11-15 11:46:12

  How small should a function be?

"The well-designed functions are often relatively small, large function design is often a mess or there is a lot of room for optimization."Maybe you think there is no need to discuss the size of functions, because the nature of the function design is cohesive, its size is only its manifestations. But it is necessary to discuss about the size of function because the statement above .First let's understand the concept of minimum code processing unit : a basic operation (assignment, comparison, etc...

   Function size,Optimization     2012-12-18 13:58:07

  Php Class to Retrieve Alexa Rank

Alexa is a service acquired by Amazon which offers a web traffic report for websites. They retrieve the data from toolbar that can be installed in different browsers, centralize the data and display reports to anyone. The most important indicator is the Alexa Rank. It represents the rank of a webpage in a list of all the websites. It’s not the 100% accurate but it gives a good indication.Alexa does not offer any free API to obtain Alexa Rank. However there is a simple method to obtain it ...

   PHP,Alexa,Alexa rank,API,Retrieve Alexa rank     2011-10-25 11:28:55