Skip to main content

Posts

Showing posts from July, 2021

MySQL table_exists and rename table execution time

https://stackoverflow.com/questions/9479056/table-exists-method-might-not-be-working-properly https://dba.stackexchange.com/questions/53836/how-long-will-it-take-to-rename-table INSERT with check exist (normally we often using UNIQUE key then INSERT IGNORE). https://stackoverflow.com/questions/3164505/mysql-insert-record-if-not-exists-in-table https://stackoverflow.com/questions/38601880/unable-to-rename-table-due-to-metadata-lock RENAME TABLE  will terminate the transaction. You can do both renames in a single, atomic, statement (no transaction): RENAME TABLE `main_territorypricing` TO `main_territorypricing2`, `main_territorypricing1` TO `main_territorypricing`; It will have to wait for any other connections that are busy with any of the tables; make sure you don't have some connection not letting go. https://tech.smartling.com/wrangling-gigantic-tables-in-mysql-universal-language-40274d89151b Copy data between databases. https://stackoverflow.com/questions/12242...

Optical Character Recognition OCR for Phone number and email address images to text

Sometime we want to crawling data from a website. First, crawling data is illegal (in most cases?). But I tried anyway, for technical study, apply first. It turned out that there are many good tools for this. So I start to use these tools for current project. It mostly consist of NodeJS Cheerio for read HTML (like jQuery with browser). OCR Tesseract for read some text from images. Install locally or use node package. And obviously Database, I am using MySQL. http://www.leptonica.org/ https://realpython.com/setting-up-a-simple-ocr-server/ https://nanonets.com/blog/ocr-with-tesseract/ Test (training ?) data. https://osdn.net/projects/sfnet_tesseract-ocr-alt/downloads/tesseract-ocr-3.02.eng.tar.gz/ OCR + OpenCV (a lot of example to use ) (English only ?) https://nanonets.com/blog/ocr-with-tesseract/ https://stackoverflow.com/questions/14800730/tesseract-running-error Some Android app I have tried work really well with Vietnamese (tried with printed Shopee invoice). Will try another app an...