• This is Slide 1 Title

    This is slide 1 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

  • This is Slide 2 Title

    This is slide 2 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

  • This is Slide 3 Title

    This is slide 3 description. Go to Edit HTML and replace these sentences with your own words. This is a Blogger template by Lasantha - PremiumBloggerTemplates.com...

Thứ Năm, 15 tháng 10, 2020

Restorem database vào một database khác

 Mục dịch là save một Database cũ vào một Database mới , với tên khác, tên log và mdf khác luôn.1. Backup database muốn restore2. Vào Restore database với   - Option: Overwrite the existing database (WITH REPLACE)  - Files: Chỗ Restore As chọn tới file mdf và .ldf mới mà bạn...

Error when build IOS ionic - Upload IOS to Appstore by xcrun

I. Upload IOS to App Store by xcrun 1. Generate .ipa file with signed.     Product -> archive2. move to ipa folder3. check ipa filexcrun altool --validate-app --file "$IPA_PATH" --username "$APP_STORE_USERNAME" --password "sjjkh-asjdkh-asjkdh"password: get from appleid.apple.com/account/manageAPP-SPECIFIC...

Thứ Tư, 14 tháng 10, 2020

No version of NDK matched the requested version

Lỗi NDK : No version of NDK matched the requested version 21.0.6113669. Versions available locally: 21.3.6528147Cập nhật lại NDK version cho đúng: Trên adnroid studio: -> Tool -> SDK Manager -> Chuyển qua tab SDK tooks -> check vào NDK (Side by side) để update lên bản mới nhất.Nếu vẫn không được vào đây tải bản phù hợp: https://androidsdkoffline.blogspot.com/p/android-ndk.htmlsau đỏ bỏ...

Thứ Ba, 29 tháng 9, 2020

Validator Form In Angular

Have 2 ways validate form in angular.First Way: Use FormBuilderHTML file <form [formGroup]="angForm" novalidate> <div class="form-group"> <label class="center-block">Name: <input class="form-control" formControlName="name"> </label> </div> <div *ngIf="angForm.controls['name'].invalid && (angForm.controls['name'].dirty...

Thứ Năm, 16 tháng 7, 2020

Upload file in node js / Upload file bẳng nodejs

Các bước để tạo một API server bằng node js thì mình không làm nữa, chỉ bắt đầu bằng việc up ảnhBước 1: Tạo service upload ảnhconst multer = require('multer') // import libraryconst moment = require('moment')const q = require('q')const _ = require('underscore')var file = require('file-system');const fs = require('fs')const dir = './public'let sub = moment(moment.now()).format('YYYY-MM');/** Store file on local folder */let storage = multer.diskStorage({    destination: function (req, file, cb) {        cb(null, 'public/' + sub)    },    filename: function (req, file, cb) {        let date = moment(moment.now()).format('YYYYMMDDHHMMSS')        cb(null, date + '_' + file.originalname.replace(/-/g, '_').replace(/ /g, '_'))    }})/** Upload files  */let upload = multer({ storage: storage }).array('files')/** Exports fileUpload function */module.exports = {    fileUpload: function (req, res) {        let deferred = q.defer()        /** Create dir if not exist */        if (!fs.existsSync(dir + "/" +sub)) {            fs.mkdirSync(dir + "/" + sub)            console.log(`\n\n ${dir} dose not exist, hence created \n\n`)                    }        upload(req, res, function (err) {            if (req && (_.isEmpty(req.files))) {                deferred.resolve({ status: 200, message: 'File not attached', data: [] })            } else {                if (err) {                    deferred.reject({ status: 400, message: 'error', data: err })                } else {                    deferred.resolve({                        status: 200,                        message: 'File attached',                        filename: _.pluck(req.files,                            'filename'),                        data: req.files                    })                }            }        })        return deferred.promise    }}Bước...

Load css another page when you got a conflict / Load css cho admin

loadStyle() {    this.document.getElementsByTagName('head')[0].innerHTML+='<link rel="stylesheet"  href="../assets/admin/dist/css/adminlte.min.css">';  }ngOnInit() {    // if (localStorage.getItem('unserInfo') == null){    //   this.router.navigate(['login']);&nbs...

Thứ Ba, 4 tháng 2, 2020

Một số command line cần thiết khi sử dụng Angular CLI

- ng     - g : Tự động tạo    - c : component    - m : module    - s : service Các option --save : lưu vào package.json --flat : Không tạo thư mục --spec false: không tạo file spect.ts -it : Không tạo file html -is: Không tạo file c...

Các Lỗi khi build API Node JS

1. Lỗi không thể connect đến MSSQLSERVER: onnectionError: Failed to connect to localhost\MSSQLSERVER in 15000ms     at ConnectionError (D:\APINode\node_modules\tedious\lib\errors.js:13:12)     at Connection.connectTimeout (D:\APINode\node_modules\tedious\lib\connection.js:1190:54)     at Timeout._onTimeout (D:\APINode\node_modules\tedious\lib\connection.js:1152:12) =>...

Thứ Hai, 3 tháng 2, 2020

Cách xử lý khi bị đụng css, load css từ cho 1 compnent

- Khi bạn muôn apply một external css cho riêng 1 component , (load từ style.css sẽ bị đụng css), thì làm như sau: styleUrls: ['./index.component.css','../../assets/admin/dist/css/adminlte.min.css'], encapsulation: ViewEncapsulation.Non...

Thứ Hai, 20 tháng 1, 2020

Các gói npm cần thiết khi sử dụng NodeJS

Nodemon: tự động restart lại server nodejs  Tedious: Connect với mssql (Giống mssql-npm) Express: frameword cho nodeJS - Giống Hapi Sails: Fulltack FrameWord cho nodejs (cái này hay nè) Sequilize: ORM dùng để mapping CSDL  ejs: view template  date-format: định dạng ngày tháng năm (Chú ý nếu cần định dạng về UTC +7 thì cần cấu hình lại trong file config hoặc connect : timezone: '+07:00', dotenv:...

Sử dụng EJS làm view cho node JS

Các bước cấu hình 1. Cài đặt các gói cần thiết #npm install --save ejs #npm install --save bootstrap #npm install --save jquery #npm install --save popper 2. Tạo 1 thư mục views - Folder: include : chưa cái file được xử dụng lại như : header, footer. nav - 2 file: index.ejs, about.ejs index.ejs <!DOCTYPE html> <html lang="en">     <% include ('./include/head') %>     <body>         <% include ('./include/nav')  %>         <div class="container">             <div class="row">                 <h1>Home</h1>             </div>             <hr>             <div class="row">                 <p style="height:300px;">Content Here...</p>             </div>         </div>         <% include ('./include/scripts') %>         <% include ('./include/footer') %>              </body> </html> about.ejs <!DOCTYPE html> <html lang="en">     <% include ('./include/head') %>     <body>         <% include ('./include/nav') %>         <div class="container">             <div class="row">                 <h1>About</h1>             </div>             <hr>             <div class="row">                 <p style="height:300px;">Content Here...</p>             </div>         </div>         <% include ('./include/scripts')  %>         <% include ('./include/footer') %>     </body> </html> Cầu...