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
| (\d+)\s+(Connected|Disconnected)\s+(Active|Idle|Connecting)\s+(Yes|No)\s+(Equal|Master|Slave) |
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
| (\d+)\s+(?:Connected|Disconnected)\s+(?:Active|Idle|Connecting)\s+(?:Yes|No)\s+(?:Equal|Master|Slave) | |
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
| """ | |
| Employee class represents the employee data | |
| """ | |
| def __init__(self, emp_id, name, addr, salary): | |
| self.id = emp_id | |
| self.name = name | |
| self.addr = addr | |
| self.salary = salary | |
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 .tables import TabledisplayTable | |
| class IndexView(tables.DataTableView): | |
| table_class = TabledisplayTable | |
| template_name = 'project/tabledisplay/index.html' | |
| def get_data(self): | |
| strobj = '[{"id": 111, "name": "emp1", "salary": 1000, "addr": "kolkata"}, {"id": 222, "name": "emp2", "salary": 5000, "addr": "bangalore"}]' | |
| instances = json.loads(strobj) |
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")) |
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
| 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
| 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
| 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
| # 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() | |
OlderNewer