Friday, March 04, 2011
Usage - django-mako - Django mako plugin usage. - Project Hosting on Google Code
Usage - django-mako - Django mako plugin usage. - Project Hosting on Google Code: "easy_install django-mako"
mediacore/templates/media/view.html at master from simplestation/mediacore - GitHub
mediacore/templates/media/view.html at master from simplestation/mediacore - GitHub: "${h.page_title(default=media.title, media=media)}"
Much better templating for Django with Genshi.
Much better templating for Django with Genshi.
Vivek Haldar : The Cognitive Style of Unix
Vivek Haldar : The Cognitive Style of Unix: "He frames the issue in terms of internalization vs externalization. Some software tries to be “easy-to-use” by externalizing rules and knowledge into the interface, so that the user does not have to think and can merely follow the cues. An example is inactivating parts of the interface that are not relevant or allowed in a particular context. Software that does not externalize such rules and knowledge relies instead on the user internalizing those, and mindfully coming up with plans to solve the problem at hand."
About South — South v0.7 documentation
About South — South v0.7 documentation: "South brings migrations to Django applications. Its main objectives are to provide a simple, stable and database-independent migration layer to prevent all the hassle schema changes over time bring to your Django applications.
We try to make South both as easy-to-use and intuitive as possible, by making it automate most of your schema-changing tasks, while at the same time providing a powerful set of tools for large or complex projects; you can easily write your own migrations by hand, or even use the database altering API directly.
While South started as a relative unknown in the Django database-schema-altering world, it has slowly risen in popularity and is now widely regarded as the most popular schema migration tool for Django."
We try to make South both as easy-to-use and intuitive as possible, by making it automate most of your schema-changing tasks, while at the same time providing a powerful set of tools for large or complex projects; you can easily write your own migrations by hand, or even use the database altering API directly.
While South started as a relative unknown in the Django database-schema-altering world, it has slowly risen in popularity and is now widely regarded as the most popular schema migration tool for Django."
Django | Custom template tags and filters | Django documentation
Django | Custom template tags and filters | Django documentation: "@register.filter(name='cut')
@stringfilter
def cut(value, arg):
return value.replace(arg, '')
@register.filter
@stringfilter
def lower(value):
return value.lower()"
@stringfilter
def cut(value, arg):
return value.replace(arg, '')
@register.filter
@stringfilter
def lower(value):
return value.lower()"
Thursday, March 03, 2011
Serving XHTML As XML
Serving XHTML As XML
This just bit me in the ass in Django. The trick was to add the correct mimetype to the render:
return render_to_response('recordings/show.html', {
'annotations' : annotations,
'recording_id' : recording_id,
'pitchcontour' : pitchcontour
}, {}, mimetype="application/xhtml+xml")
This just bit me in the ass in Django. The trick was to add the correct mimetype to the render:
return render_to_response('recordings/show.html', {
'annotations' : annotations,
'recording_id' : recording_id,
'pitchcontour' : pitchcontour
}, {}, mimetype="application/xhtml+xml")
javascript - auto-refreshing div with jquery - Stack Overflow
javascript - auto-refreshing div with jquery - Stack Overflow: "function update() {
$.get('response.php', function(data) {
$('#some_div').html(data);
window.setTimeout(update, 10000);
});
}"
$.get('response.php', function(data) {
$('#some_div').html(data);
window.setTimeout(update, 10000);
});
}"
Frodo, the LOTR - Browse Files at SourceForge.net
Frodo, the LOTR - Browse Files at SourceForge.net: "Frodo is a Line-Oriented Text Rewriter, a tool for scripting bulk
rewrites of line-oriented text data. It can be used for reformatting
data, or for other editing tasks more challenging than
global-search-and-replace.
The easiest way to explain is just to give some examples. Suppose
you have a data file that looks like this:
last='Ambrose' first='Alice' bdate='1885-04-22'
last='Baldwin' first='Bernard' bdate='1887-09-13'
last='Corbin' first='Charles' bdate='1879-11-03'
last='Dalton' first='Dennis' bdate='1881-01-07'
That's nice and all, but it would be more convenient if it were in
CSV format, with maybe a header that gave names to the column. This
is a perfect job for Frodo. Try this script on it.
insert 'LAST,FIRST,BDATE'
while (
replace /last='(.*)' first='(.*)' bdate='(.*)'/ |{1},{2},{3}|
next
)
You'll get something that looks like this.
LAST,FIRST,BDATE
Ambrose,Alice,1885-04-22
Baldwin,Bernard,1887-09-13
Corbin,Charles,1879-11-03
Dalton,Dennis,1881-01-07"
rewrites of line-oriented text data. It can be used for reformatting
data, or for other editing tasks more challenging than
global-search-and-replace.
The easiest way to explain is just to give some examples. Suppose
you have a data file that looks like this:
last='Ambrose' first='Alice' bdate='1885-04-22'
last='Baldwin' first='Bernard' bdate='1887-09-13'
last='Corbin' first='Charles' bdate='1879-11-03'
last='Dalton' first='Dennis' bdate='1881-01-07'
That's nice and all, but it would be more convenient if it were in
CSV format, with maybe a header that gave names to the column. This
is a perfect job for Frodo. Try this script on it.
insert 'LAST,FIRST,BDATE'
while (
replace /last='(.*)' first='(.*)' bdate='(.*)'/ |{1},{2},{3}|
next
)
You'll get something that looks like this.
LAST,FIRST,BDATE
Ambrose,Alice,1885-04-22
Baldwin,Bernard,1887-09-13
Corbin,Charles,1879-11-03
Dalton,Dennis,1881-01-07"
Subscribe to:
Posts (Atom)