Posts under ‘Programming’

calculate results VS. store result sets

Firstly, what’s the results in title? For example, the results may be learners who will be alive in coming two weeks, or the results may be study times of one learner, etc. Generally, results should be some data coming from analyzing other data. Here my question is, how can we get certain results much faster [...]

Learn from Renren API

Been working on Renren Connect application for a while, when talking about its API, I think every coin has two sides, so let’s see its sides: A(davantage) side : 1. Configure cross domain file to resolve JS cross-domain issue between application domain and renren domain. Not sure if a similar solution can solve our ajax [...]

JS tips

TIPS: * Select all checkbox. 123456789101112131415<script type="text/javascript">// <![CDATA[   function SetAllCheckBoxes(FormName, FieldName, CheckValue)   {     if(!document.forms[FormName])       return;     var objCheckBoxes = document.forms[FormName].elements[FieldName];     if(!objCheckBoxes)       return;     var countCheckBoxes = objCheckBoxes.length;     if(!countCheckBoxes)       objCheckBoxes.checked = CheckValue;     else     [...]

Ruby Design Patten — Command patten

Share a design patten: Command patten. Migration in Ruby On Rails is a good example of Command patten. Bellow is code about how to create a Command patten in Ruby. The code bellow defined CreateFile and CopyFile two classes, use Command patten and Composite patten log requests, and support undoable operations. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374class Command   attr_reader [...]