Pages

Friday, January 4, 2013

CSS Rounded Corners



.roundedtags {
width:400px;
height:25px;
background-color:#CCEBD6;
border: 1px solid #FF8855;
padding: 5px;
    -moz-border-radius: 12px;
    -webkit-border-radius: 12px;
    border-radius: 12px;
}



http://viralpatel.net/blogs/rounded-corner-css-without-images/

Thursday, January 3, 2013

r before a python String

One more important detail we’ve introduced here is that r character in front of the regular expression string. This tells Python that the string is a “raw string” – its contents should not interpret backslashes. In normal Python strings, backslashes are used for escaping special characters – such as in the string '\n', which is a one-character string containing a newline. When you add the r to make it a raw string, Python does not apply its backslash escaping – so, r'\n' is a two-character string containing a literal backslash and a lowercase “n”. There’s a natural collision between Python’s usage of backslashes and the backslashes that are found in regular expressions, so it’s strongly suggested that you use raw strings any time you’re defining a regular expression in Python. From now on, all of the URLpatterns in this book will be raw strings.

Wednesday, January 2, 2013

Django Slashes

If you’re the type of person who likes all URLs to end with slashes (which is the preference of Django’s developers), all you’ll need to do is add a trailing slash to each URLpattern and leave APPEND_SLASH set to True. If you prefer your URLs not to have trailing slashes, or if you want to decide it on a per-URL basis, set APPEND_SLASH to False and put trailing slashes in your URLpatterns as you see fit.

Monday, December 31, 2012

Increase the number of results in elasticsearch


 curl -XGET '172.xx.xxx.xx:9200/document/post/_search?pretty=true' -d '{
"from" : 0, "size" : 30,
    "query" : { "query_string" : { "query": "assistance in voting" }},
    "highlight" : {
        "fields" : {
            "text" : {}
        }
    }
}'

http://www.elasticsearch.org/guide/reference/api/search/from-size.html

Thursday, December 27, 2012

Start, stop Apache server on ubuntu


Task: Start Apache 2 Server

# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start

Task: Restart Apache 2 Server

# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart

Task: Stop Apache 2 Server

# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop