Skip to main content

Posts

Showing posts from May, 2017

MySQL ORDER, CONDITION in offset, limit

https://dba.stackexchange.com/questions/69537/limit-1000-25-vs-limit-25-offset-1000 up vote 5 down vote accepted In terms of operation SELECT id , name , description FROM tablename LIMIT 1000 , 25 SELECT id , name , description FROM tablename LIMIT 25 OFFSET 1000 there is absolutely no difference in the statements @siride's comment is exactly the point. LIMIT 1000,25  means  LIMIT 25 OFFSET 1000 From the same Documentation LIMIT row_count  is equivalent to  LIMIT 0, row_count YOUR ACTUAL QUESTIONS Does this actually do the same or is my understanding wrong? Is one slower/faster in larger tables Since both queries are the same, there is no difference Does the result of offset change when I do WHERE column=1 (say column has >100 different values) Does the result of offset change when I do ORDER BY column ASC (asuming it has random values) Using  LIMIT  does not change any result sets. They simply navigate within the result set. This

Sublime SFTP vs Sync code Host-Guest machine or rsync

{ "type": "sftp", "save_before_upload": true, "upload_on_save": false, "sync_down_on_open": true, "sync_skip_deletes": false, "confirm_downloads": false, "confirm_sync": true, "confirm_overwrite_newer": false, "host": "127.0.0.1", "user": "camzink", "password": "Dungnv", "port": "2233", "remote-path": "/home/camzink/Public/TXP_Chat_Server/", "ignore_regex": "(\\.sublime-project|\\.sublime-workspace|sftp-config(-alt\\d?)?\\.json|sftp-settings\\.json|\\.svn)", // "file_permissions": "665", // "dir_permissions": "775", "connect_timeout": 30, } https://wbond.net/sublime_packages/sftp/usage

How to support full Unicode in MySQL databases

https://mathiasbynens.be/notes/mysql-utf8mb4#character-sets https://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf-8-in-my-cnf Trên Ub 16 file config MySQL tách ra 2 Dir: !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mysql.conf.d/ => Config/backup 2 file trong 2 mục trên. Client/mysql: [client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 Server/mysqld: [mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci Bên CentOS chắc vẫn để 1 file my.cnf. MariaDB cũng dùng file cnf này thì fai. Restart Server, quit client mysql rồi login lại. Chạy: mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; Như này là tươi: +--------------------------+--------------------+ | Variable_name            | Value              | +-----------------

NodeJS Server hang on caused by limit MySQL connection.

MySQL server hang on. No error log shown. Check processes see that mysqld use about 30% (of 512MB RAM). CPU idle. Show full processlist in >mysql show about 11 connection ie: +----+------+-----------------+------+---------+------+----------+------ | Id | User | Host            | db   | Command | Time | State    | Info  +----+------+-----------------+------+---------+------+----------+------ | 87 | root | localhost       | txp1 | Query   |    0 | starting | show  | 88 | root | localhost:50190 | txp1 | Sleep   |    3 |          | NULL  | 89 | root | localhost:50192 | txp1 | Sleep   |    3 |          | NULL  +----+------+-----------------+------+---------+------+----------+------ ... I guest this is the caused by MySQL refuse to run query and/or some query hang on. Then I try connect half dozen of devices include iPhone, Android, Genymotion, PC ... to figure out how new DB connection made when new client access server. When a machine (device) connect to server, via

Martin Fowler – What Does Tech Excellence Look Like? | TW Live Australia 2016

Như trong bài Three Pillars nói về quan điểm của Martin Fowler về cty ThoughtWork mà ô tâm đắc. Đầu tiên là Sustainable Business, thứ 2 là Software (Technical) Excellence và cuối cùng là Social Justice. Như tên gọi của nó Software Excellence (hay Professional Excellence), SE nghĩa là làm ra những phần mềm tốt, thứ mà 1 cty phần mềm cần phải làm. "It's about doing what you do really well. For Ben & Jerry's this was about making really good ice-cream, in our case it's about being really good at delivering valuable software."     Bài này Martin Fowler (MF) nói về việc làm thế nào để rút ngắn thời gian từ lúc ý tưởng hình thành trong đầu khách hàng được triển khai vô hệ thống chạy thực. Việc này có rất nhiều lợi ích về mặt bussiness.    Để đạt được điều đó cần có nhiều thứ như CI (continuos delivery). Việc đưa được ý tưởng thành hiện thực sớm để có được feedback và có chiến lược thay đổi, đó là 1 quá trình learning. Thực tế khá tách biệt giữa dev team và k

Nodejs server run continuostly

http://stackoverflow.com/questions/7310521/node-js-best-practice-exception-handling http://stackoverflow.com/questions/5999373/how-do-i-prevent-node-js-from-crashing-try-catch-doesnt-work http://stackoverflow.com/questions/7310521/node-js-best-practice-exception-handling Ah, that's a tricky question. First of all, domains approach differs from forever in that it doesn't force you to restart the whole Node process. Say, for example, your Node application processes requests coming from several clients simultaneously. By carefully configuring your domains you (at least, in theory) will be able to prevent other requests from failing when one of the requests throws an error. However, in practice to get domains work some components of your application has to be domain-aware. That applies to third-party components, too. For example, a database connection module that uses a pool of connections internally, should not wrap them into it's own domain, but rather check if the call

Rocket.Chat DB schema

_raix_push_notifications avatars.chunks avatars.files instances meteor_accounts_loginServiceConfiguration meteor_oauth_pendingCredentials meteor_oauth_pendingRequestTokens migrations rocketchat__trash rocketchat_cron_history rocketchat_custom_emoji rocketchat_custom_sounds rocketchat_import rocketchat_integration_history rocketchat_integrations rocketchat_livechat_custom_field rocketchat_livechat_department rocketchat_livechat_department_agents rocketchat_livechat_external_message rocketchat_livechat_inquiry rocketchat_livechat_office_hour rocketchat_livechat_page_visited rocketchat_livechat_trigger rocketchat_message rocketchat_oauth_apps rocketchat_oembed_cache rocketchat_permissions rocketchat_raw_imports rocketchat_reports rocketchat_roles rocketchat_room rocketchat_settings rocketchat_smarsh_history rocketchat_statistics rocketchat_subscription rocketchat_uploads system.indexes users usersSessions https://rocket.chat/docs/developer-guides/sc

Training Web Development

"Training objectives were clearly explained and achieved" "The trainer used many ways in which to pass on his knowledge to us. "A very good mixture of theoretical and practical training." "The training course helped me in all areas that I was previously unclear about, especially legislation." 1. Know your subject The report, which looked at more than 200 pieces of research, found that there were six main elements to great teaching and one of the most important ones was subject knowledge. It may seem obvious, but the report found that the best teachers have a deep knowledge of their subject, and if that falls below a certain point it has a “significant impact” on students’ learning. Targeted help for teachers, giving them an understanding of particular areas where their knowledge is weak, could be effective. 2. Praise can do more harm than good 3. Instruction matters The quality of teaching has a big impact on the achievement of studen