ref: http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
11/28/2013
11/23/2013
PyQt4 solution for 한글 path name unicode problems
tmp = QFileDialog.getOpen...(....)
Here, QString "tmp" contains 한글 characters. Therefore..
print tmp -> make error
print unicode(tmp) -> OK
and if one want to print out to a textbox ..
ui.textbox.setText(tmp) -> error
ui.textbox.setText(unicode(tmp)) -> OK
some other ...
os.chdir(tmp) -> error
os.chdir(unicode(tmp)) -> OK
10/14/2013
HOWTO use malgun.ttf font in dokuwiki dw2pdf plugins
1. Copy malgun.ttf and malgunbd.ttf to dokuwiki/lib/plugins/dw2pdf/mpdf/ttfonts/
2. Ensure the dokuwiki/lib/plugins/dw2pdf/mpdf/config.php file contains :
$this->useAdobeCJK = false;
** If the value is true, it forces using AdobeCJK font even if a user modify the css file and config-fonts.php file.
3. Add the following lines to dokuwiki/lib/plugins/dw2pdf/conf/style.local.css file:
body {
font-family: malgun;
}
4. Open dokuwiki/lib/plugins/dw2pdf/mpdf/config-fonts.php, find "$this->fontdata = array(", and add the followings :
"malgun" => array(
'R' => "malgun.ttf",
'B' => "malgunbd.ttf",
'I' => "malgun.ttf",
'BI' => "malgunbd.ttf",
),
...
9/10/2013
python datetime timedelta
import datetime
tmp1 = date1 + date2
tmp2_bool = date1 > date2 # return True
today = datetime.date.today()
five_days_after = today + datetime.timedelta(days=5)
seven_days_before = today - datetime.timedelta(days=7)
seven_days_five_hours_before = today - datetime.timedelta(days=7, hours=5)
date1 = datetime.timedelta(hours=5) # 5 hours later from now
date2 = datetime.timedelta(days=-5) # 5 days earlyer from today
.
9/09/2013
correction of mem leak of django + apache
The code below consume large memory and don't return.
Apache process memory will keep increasing with the code below.
aaa = data.objects.all().order_by('-id')
count_of_aaa = len(aaa)
The problem is "len(aaa)". (dunno why)
It should be replace by ...
count_of_aaa = aaa.count()
Then no mem leak occur.
피드 구독하기:
글 (Atom)