|
For small portions of text we use django standart {% trans %} tag
What to do with big texts such as FAQ, terms and other static pages
Started by UserEcho on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Here....
{% i18ninclude "faq/question1.html" "en" %}
Would include faq/question1.en.html.
You could also write a simple templatetag yourself which includes anathor template based on the current language .
There is a {% blocktrans %} templatetag you can use .
|
|
I'm not sure if it's possible to give general advice on this topic, but please try. It's hard to explain my case because it's too complex to explain. And that's exactly the problem.
I seem to constantly stumble on a situation where I try to design some...
Started by Purple Tentacle on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Try thinking of ....
Actually, the whole object oriented approach is what it's all about .
When I find myself copying and pasting chunks of code with minimal adjustments I realize that's a "partition" and then create a class, method, function, or whatever .
|
|
I am implementing small url handler that will need to match the following (assuming each one would be a separate regex).
http://mysite.com/products/could/be/this/long.aspx http://mysite.com/search.aspx OR /search/keyword1+keyword2.aspx (only need to know...
Started by mickyjtwin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
As the first or second component in its file path portion?
string regex = @"http://mysite.com/(?:\w.
|
Ask your Facebook Friends
|
Hi folks,
I am wondering which is the best way, in terms of speed and efficiency, to draw a frame around an image on iPhone, especially when I have to draw lots of these images:
1) Drawing the image and then the frame around or 2) Drawing a rect, filling...
Started by Paolo.nl on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In your particular case, I think you need to test both options on an iPhone (ist... .
If performance is a problem, you should try to minimize the number of operations you perform on the graphics context, especially the ones that have no visible components .
|
|
I have a newsletter system I am trying to incorporate within a PHP site. The PHP site loads a content area and also loads scripts into the head of the page. This works fine for the code that is generated for the site but now I have the newsletter I am...
Started by Das123 on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Preg....
B: Use preg_match_all() instead of preg_match().
In fact some of the spidering solutions I worked with did exactly that .
A: I see no issues with using regular expressions to extract the bits you need from HTML pages which are not necessarily valid .
|
|
I have a large array in PHP.
It contains strings that are split into a kind of categories using underscores:
category1_property category1_category2_category3 category2_category3_category4_category5
I have a function named
array get_values($prefix)
that...
Started by Pekka on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
This works because strings with similar prefixes....
For time-efficient access, I think the simplest solution is sorting the array, and using a modified variant of the binary search algorithm to find the lower and higher array bounds that match your query .
|
|
Hi All-
I'm reading a file(a flash swf) from .Net 3.5 that has a header which states whether the body of the file/Stream is compressed or not. However, I'm having problems-after I rewrap the basic File stream in a GZipStream, I get an exception stating...
Started by Michael Kohout on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I have some notes about how to make the DeflateStream match the java.util... .
DeflateStream doesn't want the (120,-100) ZLIB header, nor will it consume the subsequent Adler32 .
Try using the DeflateStream instead, "ZLIB" does not automatically mean GZip .
|
|
I have certain panels on my page that are hidden under certain circumstances.
For instance I might have a 'billing address' and 'shipping address' and I dont want to validate 'shipping address' if a 'ShippingSameAsBilling' checkbox is checked.
I am trying...
Started by Simon on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
For the CheckoutModel I am using this approach (most fields hidden):
[ModelBinder(typeof(CheckoutModelBinder))] public class CheckoutModel : ShoppingCartModel { public Address BillingAddress { get; set; } public Address ShippingAddress { get; set; } public... .
|
|
Hello
I have found API functions to draw a star using VB6: what I need is to colour sections of each point of the star according to data-driven parameters: thus if the parameter passed is 1, I want to colour the part of the selected star point red up ...
Answer Snippets (Read the full thread at stackoverflow):
The....
Be aware that points() is an array, and even though it looks like you are only passing the first element, you are actually giving the API call access to the whole array .
I haven't tested this myself.
The excellent vbAccelerator gives some VB6 code.
|
|
I couldn't find a proper discussion thread on this topic, so I'm going to go ahead and ask here.
Problem: I have a select query that returns a result of size 100,000+. The user wants to view all this data, but obviously I can't give it to him all at once...
Started by Jose Chavez on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You can use a combination of rownumber and top (atleast in SQL server)
This depends on the database you are using, but in MySql you could try something like:
SELECT * FROM MyTable LIMIT <start>, 500
and replace <start> with the index you ... .
|