Wednesday, 15 June 2011

python - rendering html in django template? -


I know that this question has been asked before, but none of them is working in my case. My HTML string is being provided as much as it is. I am storing a successful message like this:

  msg = 'You & lt; A href = "some_url" & gt; Getting started with MDN & lt; / A & gt; Messages.success (request, message)  

and the notification is stored in the [] variable:

  {% Message%} Notifications: [ Message in% message {} {% message.tags or waffle.flag ('redirect_messages')%} {Message: {% autoescape off%} "{{message}}" {% endautoescape%}, no 'wiki_redirect' in tag Is: "{{Message.tags}}", Level: "{{message | level_tag}}"} {% if not loop.last%}, {% endif%} {% endif%} {% endfor%}] , {% Else%} Notification: [], {% endif%}  

Is there a syntax error? If I render it directly, then this method works. However, notification: [message: Using "{{message | safe}}" or autoescape, the message does not seem to be stored securely both.


php - Understanding and tracing Apache error: Wordpress database -


I have a hard time understanding what this recurring entry is saying in my Apache error log. It is at irregular intervals for at least 1 / hour in 1 minute for a couple.

  select wp_em_events include wp_em_events.post_id where wp_em_locations.location_id = wp_em_events.location_id Left wp_em_locations ( `recurrence` are! = 1 or` recurrence` zero) and (event_start_date & gt; = Cast (in as 03/16/2015 "date) or (event_end_date & gt ;! = cast (" as 03/16/2015 "date) and event_end_date = '0000-00-00' and event_end_date zero) ) and (array) and ( `event_status` = 1) and (` event_private` = 0) by event_start_date ASC is not required 50 OFFSET 0 gROUP bY wp_em_events.post_id order LIMIT ( 'WP- blog header. Php '), WP, WP- & gt; Main, WP- & gt; Query_posts, WP_Query-> Query, WP_Query-> Get_posts, wp_Query-> parse_query, do_action_ref_array, call_user_func_array, em_ical_item, em_locate_template, include ( '/ plugins / get events manager / templates / templates / ical.php'), EM_Events ::  

The value < / P>

I have N. OT faced any front faces in front of this error. Although I believe this is affecting MySQL performance, where should I start?

After

I can not say that I have come across SQL queries that are being produced in Apache. Log files like before, but I will first disable the plug-in to see if the error output stops and if the display increases.

Then I'll start to see the Events Manager Forum articles that no one else had a similar problem I had a quick look but could not see anything, the link may also post on forums, Because there you can get some better support.

If the plug-in does not help digging in code and should increase the part of the search for that specific SQL query, the error of that code is entering the log and since then you will get the error To debug and to understand why this is happening, I am afraid without seeing that code and can not help much.


sql - Check for the existence of multiple columns -


I need to create a SQL change script which checks the existence of two columns in the table if these columns are present, The script will run the optical table to connect them. Below is an example of how we check for 1 column.

  does not exist  <(INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'table' and column = 'selection from ColumnC' *) / pre> 

Then I will call ColumnC and ColumnD This script needs to be checked.

After

You would like to run the query once for each column, unless there is no way There may be one in the table in the table, but not the other. Because if you check to be both columns at once, and only one of them exists, then you will raise the column ALTER table an exception to try to add both, after one of the columns already exists . Either be with you and once for every column or performance is important, write 3 statements ... one for both columns at once and then one for each column. The pseudocode will look something like this:

  No column alter table is present ... the other two columns if Columna is present and does not change in the ColumnB table ... ColumnB add else if ColumnB is present and Adding Columna does not change the table ... Adding Columna  

Something like this is the table that both columns ...

  are missing selection Will come back * from INFORMATION_SCHEMA.TABLES Where TABLE_TYPE = 'base table' and does not exist (select * from INFO Where is RMATION_SCHEMA.COLUMNS C.TABLE_CATALOG = T.TABLE_CATALOG and C.TABLE_SCHEMA = T.TABLE_SCHEMA and C.TABLE_NAME = T.TABLE_NAME and C.COLUMN_NAME ('Column 1', 'Column2'));  

Be sure to refer to the tables so that you do not accidentally try to change any view.


how to show SSAS value side by side in Excel 2010 Pivot Table -


I think this question is more than one related to Excel, but what I am doing here, I have an SSAS cube Is Using Excel 2010

If rows have the same dimension for a selected period, then I want to look at the values ​​/ measures. I have tired all the pivotal choices which I know but it has no use, please help me I have attached an example below. Thanks.

Example: Enter image details here i like this Want to see data from: Enter image details here

Click on the "Design" tab for your pivot table device and change the report layout. You can choose a consistent form, outline form or compact form. Repeat All Items Label is the option that you want to choose.

I will probably select "Repeat All Items Label" and then I will change it to a table form.


php - Getting 500 internal error by using recursive function -


I get an internal error while calling under the recursive function.
Function Reference ID (A type of parent ID) In ​​the matrix table, if reference ID is available then the performance in the matrix table should be returned to that ID, but if the ID is not found in the matrix table, then that reference reference id (Enroller_id) from the members table of that old reference ID (stored in $ Ref_id) and call that function again and continues to call it until it Elegant ID is not available is not available or in the matrix and in the end that did not get it the default ID ($ default_ref_id) return.

But I do not know why I am getting an internal server error, I have tried even max_execution_time by maximizing 30 to 50 or 100 but it can not be fixed.

Please be good if you can get help from me that I have been stuck with this issue since the last 3 to 4 hours.

Here is the function I created in:

  function findR EferralMember ($ ref_id) {$ default_ref_id = 1; $ Count_ref_member = GetSingleValue ("Matrix", "Calculation (*)", "Member_ID = '" $ Ref_id. "'"); If ($ count_ref_member> gt; 0) {Return $ ref_id; } And {$ ref_id = GetSingleValue ("members", "enroller_id", "member_id = '" $ Ref_id. "'"); FindReferralMember ($ REF_ID); } Return $ Default_ref_id; }  

Your code is in the endless loop. $ count_ref_member is calling find referral message again again for each call find referralmail for the

The variable is never greater than zero. This endless loop is never returning, and eventually exits the stack on the server, returning this 500 error message.

Trace through your code and see why this infinite loop is happening. Fix endless loop and 500 error will end.


java - c3p0 do not timeout when are impossible to reach the host -


The first time when my program is open, try to connect to the database, if c3p0 closes it And freeze any error message.

The strange thing is that I got java.net.UnknownHostException with MySQL , but with SqlServer something Not even this, it keeps trying forever.

I want to catch error and do something. I tried to set this property but there was no luck.

  & lt; Property Name = "hibernate.c3p0.timeout" value = "60" /> & Lt; Property Name = "hibernate.c3p0.unreturnedConnectionTimeout" value = "60" />  

My persistence.xml

  & lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt; Persistence version = "2.1" xmlns = "http://xmlns.jcp.org/xml/ns/produstence" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" XSI: Schema Locations = "Http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> & Lt; Persistence Unit Name = "Default" Transaction Type = "RESOURCE_LOCAL" & gt; & Lt; Provider & gt; Org.hibernate.jpa.HibernatePersistenceProvider & lt; / Provider & gt; & Lt; Classes & gt; Com.lala.Something & lt; / Square & gt; & Lt; Share-cache-mode & gt; Nobody & lt; / Share-cache-mode & gt; & Lt; Properties & gt; & Lt ;! - Connection - & gt; & Lt; Property Name = "javax.persistence.jdbc.url" value = "jdbc: sqlserver: // localhost \\\\ SQLEXPRESS: 1433; database name = string" /> & Lt; Property Name = "javax.persistence.jdbc.driver" value = "com.microsoft.sqlserver.jdbc.SQLServerDriver" /> & Lt; Property Name = "javax.persistence.jdbc.user" value = "teste" /> & Lt; Property Name = "javax.persistence.jdbc.password" value = "teste" /> & Lt ;! - Hibernate - & gt; & Lt; Property Name = "hibernate.format_sql" value = "false" /> & Lt; Property Name = "hibernate.show_sql" value = "false" /> & Lt; Property Name = "hibernate.use_sql_comments" value = "false" /> & Lt ;! - c3p0 - & gt; & Lt; Property Name = "hibernate.connection.provider_class" value = "org.hibernate.connection.C3P0ConnectionProvider" /> & Lt; Property Name = "hibernate.c3p0.min_size" value = "1" /> & Lt; / Properties & gt; & Lt; / Persistence unit & gt; & Lt; / Persistence> If c3p0 tries to get a connection from a database, and attempts to "hang" those acquisition attempts, then  

notification draconock and will be reconstructed automatically.

Two qualities that you have attempted to set up, neither two of them are relevant to the trouble. If you want to work around these braces, then c3p0 will look for the configuration properties.


How to serve specific static files with nginx? -


itemprop = "text">

/ api / lang? There are queries like Lang = en , which I want to serve with nginx as /server/i18n-angular/en.json . How can I do this?

I have the following directory structure:

  / public / /server/i18n-angular/en.json  

I have The following is the configuration, but NGNX states that it is wrong to use Index Directive at that time.

  server {root / public ... location / API / lang {if ($ Args ~ * "\? Lang = (. +)") {Set $ ​​language $ 1; Index ../server/i18n-angular/$language.json; }}}}  

Which direction should I use instead of index ?

"index" specifies the index file to display a folder, so you do not need it is.

You need to "rewrite" instead:

  space / API / lang {aka / server / IILN-angle; If ($ Argge ~ * "\? Lang = (. +)") {Set $ ​​language $ 1; Rewrite ^ / (. *) $ / $ Language.json; }}