This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cherrypy | |
| class HelloWorld: | |
| """ Sample request handler class. """ | |
| def index(self, **params): | |
| # CherryPy will call this method for the root URI ("/") and send | |
| # its return value to the client. | |
| for key in params: | |
| print key, '=', params[key] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $( "#login_div" ).dialog({ | |
| autoOpen: false, | |
| height: 'auto', | |
| width: 400, | |
| modal: true, | |
| buttons: { | |
| "Submit": function() { | |
| // form submission code goes here | |
| }, | |
| "close": function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="login_div" title="Login" style="display:none;"> | |
| <form id="login_form" name="login_form" action="LoginServlet?action=login" method="post"> | |
| <table> | |
| <tbody> | |
| <tr> | |
| <td>Username: </td> | |
| <td><input type="text" name="username" id="username" size="20"></td> | |
| </tr> | |
| <tr> | |
| <td >Password:</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _reset(self): | |
| """Internal method; reopen the internal file handle (probably | |
| because the log file got rotated/truncated).""" | |
| self.f.close() | |
| # modified by sarbajit | |
| localtime1 = localtime(time()) | |
| year = str(localtime1[0]) | |
| if localtime1[1] < 9: | |
| month = "0"+str(localtime1[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # maybe the log got rotated out from under us? | |
| if stat(self.path)[ST_SIZE] <= self.pos: # modified by sarbajit | |
| # file got truncated and/or re-created | |
| self._reset() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELIMITER @@ | |
| CREATE TRIGGER Test_Trigger | |
| AFTER INSERT ON MyTable | |
| FOR EACH ROW | |
| BEGIN | |
| DECLARE cmd CHAR(255); | |
| DECLARE result int(10); | |
| SET cmd=CONCAT('sudo /home/sarbac/hello_world ','Sarbajit'); | |
| SET result = sys_exec(cmd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import calendar, datetime | |
| current_utc_time_in_sec = calendar.timegm(datetime.datetime.utcnow().utctimetuple()) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| epoch_time_in_local_timezone = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends 'base.html' %} | |
| {% load i18n %} | |
| {% block title %}{% trans "Table Display" %}{% endblock %} | |
| {% block page_header %} | |
| {% include "horizon/common/_page_header.html" with title=_("Employee Table Display") %} | |
| {% endblock page_header %} | |
| {% block main %} | |
| {{ table.render }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from horizon import tables | |
| from django.utils.translation import ugettext_lazy as _ | |
| class TabledisplayTable(tables.DataTable): | |
| name = tables.Column("name", | |
| verbose_name=_("Employee Name")) | |
| salary = tables.Column("salary", verbose_name=_("Salary in Rs")) | |
| addr = tables.Column("addr", | |
| verbose_name=_("Address")) |