DALLASCAO.COM

Site of Cao Shouguang, English to Chinese translator

Excel VBA: move matching rows to another sheet

Excel VBA: move matching rows to another sheet
This VBA moves my paid jobs in my job list sheet (sheet1) to the sheet named “history” (sheet4). If the value of sixth column (Column F) of a row in sheet1 is “closed”, that row is then moved to the end of sheet4. Sub Button_Remove_Closed_Click() With Sheet1 ' For Each rw In .UsedRange.Rows ' ' […]Read More

Word VBA: randomize paragraphs

Word VBA: randomize paragraphs
Sub ran_para() n = ActiveDocument.Paragraphs.Count ReDim a(1 To 2, 1 To n) Randomize For i = 1 To n a(1, i) = Rnd a(2, i) = i Next For i = 1 To n - 1 For j = i + 1 To n If a(1, j) > a(1, i) Then t = a(2, i) […]Read More

SSL certificate chain order

SSL certificate chain order
Contrary to what you may find on the Internet, the trust chain of ssl certificate is actually from BIG to small. It may not be matter to some browsers but matters to others. I installed the chain in reverse order but chrome and IE don’t complain. Firefox is more picky. The merge command line goes […]Read More

jquery post

jquery post
Use html5 to validate email before submit. Forget your username/password? Simply type your email address below and click Submit and you will receive them in an email.Read More

php mysqli store_result

php mysqli store_result
When using prepare to prepare a statement to retrieve LOBs the method order matters. Also, method ‘store_result()’ must be called and be called in correct order. Failure to observe this causes PHP/MySQLi to crash or return an erroneous value. The proper procedure order is: prepare -> execute -> store_result -> bind -> fetchRead More