DataTables to prevent xss attack
The solution is: use “render”: $.fn.dataTable.render.text() to escape html tags
The solution is: use “render”: $.fn.dataTable.render.text() to escape html tags
On web.xml bo-portal org.springframework.web.servlet.DispatcherServlet 1 bo-portal /boportal/* /boportal @RequestMapping(value = “/”) public String homepage(ModelMap model) { return “/some/page”; } @RequestMapping(value = “/boportal”) public String homepageWithoutSlash(ModelMap model) { return homepage(model); }
Don’t use "-", "_" and other punctuations in the title of system-generated emails. They can easily be taken as spam or in some cases, cause bugs of email vendors.
Your email must satisfy the following rules: 1. it’s a multi-part email 2. it has an "html" as one of its parts (content type must be set) 3. every image must have a header like "Content-ID: <some-id>", and of course, content type must be set 4. the <img> tags in your html must use "cid" …
Problem: 1. A task has a top-level variable, whose value is 1 at first 2. After run once by celery, the value is changed to 2 3. When running task with celery for the second time, you will see the value is still 1 ! That’s because the the worker running for the first …
Keep in mind that celery workers don’t share global states Read More »
So you don’t have to create an index manually on the foreign key columns.
There is requirement for a method to get things of a man. Where to put it? man.get_things() or (static) Thing.get_things_by_man() ? From OO’s perspective, the former sounds more natural. I was planning to adopt this approach until I found a problem: it may lead to duplicate db access code because not …
man.get_things() or Thing.get_things_by_man() when Active Records Pattern is used? Read More »
Celery worker’s –autoreload option seems not working for a lot of people, especially those who use OS X. I wrote a python script to start celery worker and monitor the changes in code to reload celery worker if there is any chagne. Check it out here.
You can check /var/log/messages, search "Kill" on that file
According to my test, they are stateful objects. Reusing a single instance will lead to wrong results. Every time you encrypt or decrypt anything, you should create a new cipher, such as cipher = DES3.new(some_key, DES3.MODE_CFB, iv)