today's offers - xanax use in pregnancy xanax xr be abused soma internet pharmacies fedex soma without priscription fed ex phentermine parkinson drugs phentermine baclofen tramadol together ordering tramadol cod viagra find search 76k cialis pages cialis buy on line viagra for sale without a prescription buy onlinecom phentermine viagra ambien and klonopin drug interaction buy ambien overnight cheap online pharmacies valium saturday delivery valium online with no prescription or membership fioricet overnight no rx cheap fioricet without a prescription order meridia cod fedex meridia cheap fed ex delivery xanax bradycardia what does xanax look like american soma how to buy soma online without prescriptin phentermine overnight echeck c o d 375 mg phentermine rss feed cheap no prescription tramadol stop the tramadol generic prices online cialis generic cialis fedex chinese herbal viagra taking partial pill of viagra ambien and pregnancy smoking ambien cod online valium buy cheap valium without prescription no prescription fioricet with fedex fioricet without prescription in Brasilia order meridia meridia information

Posts Tagged 程式

找出Table 中 資料相同的Record

因為有遇到這個問題
所以特別寫出來備忘
SELECT *
FROM bb_downloads a
WHERE
(SELECT count( * )
FROM bb_downloads b
WHERE b.post_id = a.post_id
AND b.url = a.url
) >1
ORDER BY `post_id`,`download_times` DESC

reference

UPDATE: 2007/10/14
找出不相同的資料
非常的easy
select r.user_id from rtable r WHERE r.user_id not in (select a.user_id from atable a)
刪除不相同的資料
delete from rtable WHERE user_id not in (select a.user_id from atable a)

,

No Comments

待解決….

1.slow query
2.search engine -> mod_rewrite
3.imagick -> fetch -> resize .
他媽的我寫這什麼爛code ………….
::(:

No Comments

gettext command 備忘

xgettext – extract gettext strings from source

xgettext *.php

msgfmt – compile message catalog to binary format

msgfmt -cv message.po

怕自已忘記…又要找很討厭….

,

No Comments

smarty rawurldecode plugin …..

因為我在smarty 上不能直接用php的rawurldecode ,所以自已寫了一個smarty 的function 傳回rawurldecode 過的值給smarty 就這樣而已…..

<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_rawurldecode ($params, &$smarty) {

if (empty($params['lastpage_url'])){
$smarty->_trigger_fatal_error(“[rawurldecode] param lastpage_url cannot be empty”);
return;
}
if (isset($params['lastpage_url'])){
$return = $params['lastpage_url'];
$return = rawurldecode($return);
}
return $return;
}

?>

reference…
How to write a custom Smarty function in php

:( h):

No Comments

Gallery 2.2 windows 上傳問題!!

這個問題老實說困擾我好久了….
我google 了一下~~一直沒找到有營養的文章
誰知道今天找msn 的plugin 意外的看到了
Tommy先生的blog
隨手翻了幾頁,看到了這個
很感謝Tommy先生解決了這個困擾我許久的問題….
看到錯的地方~~實在是覺得他媽的suck!!!

No Comments

程式的功力差別!!!!

今天在寫apollo的ad 部份
有一個部份是在實做百面骰的部份
用百面骰的概念來實做百分比的呈現
例如我有5個值
a 的 比例是20,
b 的 比例是30,
c 的 比例是50,
d 的 比例是80,
f 的 比例是160
然後依比例來讓他們呈現應有的次數
最直接想的是
直接塞個20+30+50+80+160 的array
不過覺得這樣做實在是挺白痴的
覺得應該有更好的方法
經過”貓哥”的小小提示”區間”
我想到的是
$rand = rand(1,$ad_total);
用for 來做
if (0 <= $rand<= a){
return a;
} elseif ( a < $rand <=b ){
return b;
}
一直下去。
不過貓哥寫的是這樣
$rand = rand(1,$ad_total);
for ($i=0; $i $rand = $rand – $rand_row[$i]['percentage'];
if ($rand < 0) {
break;
}
}
一看就覺得我自已像笨蛋一樣…………………..
有很深的体會,程式寫的好的和不好的差別,真的是一眼就看出來了。 ::S:

No Comments