Category: LẬP TRÌNH

  • Kinh nghiệm SEO từ khóa khó

    Kinh nghiệm SEO từ khóa khó

    SEO những từ khoá khó với KD > 50 chưa bao giờ là dễ dàng với hầu hết ace seo-er. Đối với những từ khoá khó, việc ‘lao đầu’ vào seo url chính có vẻ là sự lựa chọn ‘ai cũng làm’. Tuy nhiên, sẽ tiêu tốn khá nhiều nhân lực và tài lực cho việc này mà hiệu quả sẽ khá lâu và có khi ‘tiền mất tật mang’.
    Bằng kinh nghiệm thực chiến những Key khó trong nước và nước ngoài mình xin chia sẽ 1 số kinh nghiệm để ACE có hướng đi tốt xíu cho công việc của mình để đỡ bị bồi thường hợp đồng như mình :))))
    Chú ý, mình ko chuyên đi lên giáo trình dạy chuyên nghiệp cho rõ đầu đuôi nên mình có thể đưa checklist dựa trên kinh nghiệm xíu từ mình mà thôi ace nhé. Và nó có thể đúng sai với từng case và từng người.
    Đối với những từ khó, đương nhiên là nhiều người cùng làm seo / ads thì sẽ khó. Và ACE phải đầu tư nhiều trường phái seo vào để top key khó đó đương nhiên là 1 mình bạn phải đánh với rất nhiều người. Trong trường hợp này bạn gọi là URL SEO.

    Kinh nghiệm SEO từ khóa khó

    1. Mấu chốt của vấn đề ở đây là ACE cần biết là nên tuân thủ quy tắc và cuộc chơi của Google, đừng nên cheat Gồ nhé. Mà Gồ thì rất thích Content mang lại giá trị cho người dùng. Cho nên ACE nên tập trung làm Content mang lại giá trị cho người dùng. ACE làm content ra sao cũng được, miễn mình đọc đừng thấy mắc nghẹn là được.
    2. Bạn nên đọc qua những Videos nói khá chi tiết của bạn Việt – GTVSEO về Topic Cluster + Sematic Content + Semantic Content + Entity Content + Phantom Keyword. Nên xem kỹ tới và lui.
    3. Điểm chính của bài chia sẻ này là:
      • #1. Nếu mình không đủ lực để đánh URL SEO với những đối thủ nặng ký nhất, thì mình nên làm SEO với những Phantom Keyword nhẹ ký nhưng có lưu lượng cao. Đương nhiên nếu nghiên cứu kỹ thì Phantom Key chỉ đẹp khi Key đó dễ + lượng tìm cao. Chứ tìm Key mà ko ai tìm thì nên vứt 🙂.
      • #2. Cứ như thế như thế, bạn sẽ liên tục bổ sung những bài viết có lượng Keyword lưu lượng cao. Nếu cao tay hơn, bạn nên gom các Key cùng chủ đề lại vào 1 bài mà thôi. Mỗi bài như vậy bạn sẽ có nhiều Key lên top. Chú ý: Các Key này có cùng cụm từ với từ khoá chính ( url seo ) thì càng tốt nhé. Nên áp dụng Entity content ở bước này càng tốt. Tối ưu onpage kỹ thì bước này thì ít lâu bài viết của bạn cũng đã top rồi.
      • #3. Cứ liên tục tìm kiếm như #1 và làm #2. Bạn sẽ liên tục có những bài chất lượng, và nên nhớ, những bài này bạn phải có chèn Internal Link của Anchor siêu khó về URL SEO.
      • Áp dụng 3 bước trên. Bạn sẽ dần xân ra cho mình 1 Topic Cluster chất lượng. Keyword những bài ở mục #3_2 top đúng nhu cầu người dùng, thì Keyword khó cũng dần được lên theo.
    4. Đương nhiên, trước tiên bạn phải Onpage thật kỹ, Entity thật tốt trước cái đã.
    5. Thematic content + Semantic content + Entity content sẽ là cứu cánh cho bạn. Đương nhiên là nghe khái niệm cũng mệt rồi. Nhưng cố mà học 🙂
    6. Song song đó, trong quá trình triển khai, Content is king, nhưng thiếu sự giới thiệu ( backlink ) chất lượng thì cũng chán lắm. Nên mình làm thì cũng luôn luôn cần link ( nhiều ACE trường phái seo entity ko cần link cũng hay và mình muốn học, nhưng chưa có ai chỉ dạy :0 )
    7. Đương nhiên, bạn nên có tính kiên nhẫn và chịu thương chịu khó.
    8. SEO là 1 câu chuỵên không nên kể cho người thiếu bình tĩnh nha ACE 🙂
    9. Nên nhớ, làm SEO thì lên top rồi thì phải ra đơn. KH họ muốn Key đó nhưng SEO lên top rồi mà ko ra đơn thì họ sẽ quay lại phàn nàn mà thôi. Vì vậy, nhiệm vụ của SEO-er là nên tư vấn Key cho đúng ace nha!

    Mình không phải chuyên đi dạy nên cách truyền tải có thể lủng cũng nha ACE ! Cảm ơn ACE đã đọc. Thân ái !

  • Named and positional parameters in Dart

    Named and positional parameters in Dart

    Named and positional parameters in Dart

    In Dart, we have two types of optional parameters: named and positional.

    • Dart’s optional parameters are optional in that the caller isn’t required to specify a value for the parameter when calling the function.
    • Optional parameters can only be declared after any required parameters.
    • Optional parameters can have a default value, which is used when a caller does not specify a value.

    Optional parameters are parameters which don’t have to be specified when calling given function. Optional parameters must be declared after required parameters. Additionally, optional parameters can have a default value, which is used once the function invocation doesn’t specify it.

    👉Dart Cheat Sheet and Quick Reference

    Positional Parameters in Dart

    Square brackets [] are used to specify optional, positional parameters in Dart.

    void hamViDu(int a, [int b = 0, int c = 0]) {
      if (b != 0 && c != 0) {
        print('a:$a - b:$b - c:$c');
      } else if (b != 0) {
        print('a:$a - b:$b');
      } else {
        print('a:$a');
      }
    }
    
    void main() {
      hamViDu(5, 10, 15);
    
      print('----------------------');
      hamViDu(5);
    
      print('----------------------');
      hamViDu(5, 10);
    }

    For such declaration a is always required while b and c are optional. Also, b, c will default to 0 if not specified.

    hamViDu(5, 10, 15); //print a:5 - b:10 - c:15
    
    hamViDu(5); //print a:5
    
    hamViDu(5, 10);//print a:5 - b:10

    Additionally, the parameter names are specified and visible only at the level of the function declaration. The function caller must know which position corresponds to which parameter. This leads to a slightly less readable code.

    Named parameters in Dart

    Curly brackets {} are used to specify optional, named parameters in Dart.

    readFile(String name, {String mode, String charset = 'utf-8'}) { 
    //......
    }

    Named parameters are referenced by name, which means that they can be used during the function invocation in an order different from the function declaration.

    void hamViDu({int a = 0, int b = 0, int c = 0}) {
      print('a:$a - b:$b - c:$c');
    }
    
    void main() {
      hamViDu();
    
      print('----------------------');
      hamViDu(a: 5, c: 15, b: 10);
    
      print('----------------------');
      hamViDu(c: 5);
      
      print('----------------------');
      hamViDu(b: 5, c: 10);
    }

    Checking if optional parameter was provided

    Unfortunately, you cannot distinguish between the cases “an optional parameter was not provided” and “an optional parameter was provided with the default value”.

    Note: You may use positional optional parameters or named optional parameters, but not both in the same function or method. The following is not allowed.

    thisFunctionWontWork(String foo, [String positonal], {String named}) {
     // will not work! 
    }
  • Các loại backlink hỗ trợ SEO

    Các loại backlink hỗ trợ SEO

    Các loại backlink hỗ trợ SEO

    Như hiện tại mình thấy mọi người khi nhắc đến backlink thường có các loại backlink hỗ trợ SEO sau đây:

    PBN (Private Blog Network) là mạng lưới các website vệ tinh được liên kết với nhau dưới sự kiểm soát của bạn với mục đích thao túng backlink để vượt qua PageRank, là một chiến thuật mà SEO mũ xám hoặc mũ đen thường dùng.

    Mời bạn xem thêm Guest Post là gì?
    Nhưng thực thế như mình nghiên cứu thì có thể lấy được rất nhiều thể loại link + tín hiệu hỗ trợ SEO.

    I. CÓ BAO NHIÊU CÁCH KHAI THÁC ĐƯỢC CÁC LOẠI BACKLINK 𝐅𝐑𝐄𝐄?

    Thực tế khi soi kỹ vào link entity, mình phát hiện ra là đã bỏ qua những loại backlink này.

    1. Sàn TMĐT

    • Bạn đã thử đăng sản phẩm của mình lên các sàn thương mại điện tử chưa? Bạn đã thử đăng bán coupon cho 1 số sản phẩm của công ty chưa?
    • Không lấy được link thì cũng có tác dụng hỗ trợ cải thiện entity.
    • Các sàn TMĐT phổ biến như shopee, tiki, lazada, sendo…

    2. Công bố sự kiện

    • Công ty bạn, website của bạn ra mắt 1 sản phẩm nào đó mới, bạn có đăng lên các trang sự kiện không?
    • Mình đã thử lên các trang này để lấy backlink và thấy khá OK.
    • Web tham khảo: https://ticketbox.vn

    3. Mã giảm giá

    • Các trang tổng hợp mã giảm giá của nhiều đơn vị. Bạn liên hệ các đơn vị này hoặc tìm các trang cho post coupon lên nhé.
    • Link demo: https://www.couponbirds.com/submit-coupon

    4. Danh bạ

    • Danh bạ website này khá cũ rồi, có lẽ giờ không ai còn sử dụng nữa.
    • Các website trangvang…

    5. Check website trust – scam (nhớ làm cả review)

    • Đã bao giờ bạn submit trang web của bạn lên các trang check legit scam chưa?
    • Nếu website bạn uy tín thì tại sao ko tự tin submit lên khoe.
    • Link demo: https://trusted.website/

    6. Check giá trị website, check seo website

    • Check cái này cũng vui phết, lấy được cả link để ép index luôn.
    • Link demo: https://dinhgiaweb.net/www/google.com và https://www.seoptimer.com/shopee.vn

    7. Share các loại file như docx, pdf,…

    • Có file nào share file đó hết, bao nhiều link luôn.
    • Các site chiase tài liệu như tailieu.vn, slideshare, isuu,… hoặc thậm chí là GoogleDrive

    8. Tuyển dụng, thông tin công ty

    • Đăng ảo 1 vài tin tuyển dụng ko lấy được link cũng lấy được sự quan tâm của mọi người.
    • Thậm chí là làm 1 loạt CV cá nhân (có ghi đã từng làm ở công ty AB) rồi up lên các trang xin việc.

    9. Forum nước ngoài chỉ số cao

    • Có rất nhiều forum nước ngoài mạnh còn sống. Bạn có thể vào đây đăng ký tài khoản, post 1 bài thật liên quan trong 1 mục có nhiều bài viết.
    • Chờ dăm bữa nửa tháng cho trôi bài đi, vào edit lấy backlink.
    • Comment forum làm vậy cũng dc.
    Cái này lần đầu mình biết là do a Nguyễn Duy Anh chia sẻ.

    10. Các trang Up nhạc, video, ảnh, audio

    • Chuẩn bị các file video và nhạc, ảnh sau đó up lên các trang phù hợp.
    • Bao gồm luôn cả đăng lên cho tải free hoặc đăng bán.
    • Link demo: https://www.youtube.com/

    11. Các trang bán ebook

    • Up các ebook lên trang bán sách cũng ngon mà.
    • Link demo: google play sách mình cũng từng lấy rồi nhé. Không lấy được link cũng lấy được tín hiệu.

    12. Các trang lấy RSS tự động

    • Submit link RSS mình lên các trang khác cho tự get bài của trang mình.
    • RSS feed bình thường mấy bài viết thì nhiều chỗ cho lấy rồi.
    • RSS feed podcast > Cái này do bác Thiện Vũ Thế chia sẻ nên mới biết.

    13. App mobile, Extension trên các trình duyệt.

    • Link Chplay, Amazon, Extension Chrome gần đây mọi người chắc thấy nhiều rồi.

    14. Comment youtube hoặc facebook

    • Giờ này nhiều người làm web auto, cào tự động youtube hay facebook về thành bài viết, cào cả comment luôn.
    • Mình không lấy link thì kéo comment cả brand của mình vào lấy tín hiệu.
    • Cái này cũng là a Nguyễn Duy Anh chia sẻ nên mới biết.

    15.Lấy link tự động từ youtube, vimeo, dailymonition, twitter

    • Có rất nhiều web lớn được các trang nhỏ clone lại hoặc get tự động thông tin từ đó. Mình tận dụng điểm này để khai thác link tự động.
    • Link demo: https://twisave.com/

    Mình tin rằng vẫn còn rất nhiều chỗ khác có thể tận dụng hỗ trợ SEO.

    II. KHAI THÁC BACKLINK SAO CHO HIỆU QUẢ?

    Mình có 1 vài lưu ý khi khai thác như sau:

    1. Trong những cái này, ko nhất thiết cứ phải có link mới lấy. Chỉ cần tên brand hoặc cái gì định danh của mình trên đó là được.
    2. Chỉ làm những cái có thể lấy được link để ép index
    3. Nhớ loại bỏ noindex và bị chặn index
    4. Tự lên quy trình để tận dụng triệt để tài nguyên, ví dụ 1 ảnh đẹp có thể vừa đăng bán, vừa đăng lên các trang share ảnh free, vừa đăng lên các mxh tương tác,…….

    (Bài viết của bạn Quang Hải trong nhóm SEOMxh)

  • Pumped-up performance Python with Pyston

    Pumped-up performance Python with Pyston

    Pumped-up performance Python with Pyston

    Python developers can look forward to faster implementations with the release of Pyston v2.2, while Facebook is developing its own internal implementation called Cinder from which it aims to upstream improvements to CPython.

    👉Hướng dẫn lập trình Python – Python Guide

    Pyston is one such project, and the just released version 2.2 is claimed to be 30 percent faster than standard Python in the Pyston team’s own web server benchmarks. Pyston is a fork of CPython, and the foundational technology powering Pyston v2.2 is the same as that found in earlier versions, but the project team says it has tuned and optimised more areas and found additional ways to boost performance, particularly in the JIT and attribute cache mechanisms.

    One of the ways the team found to squeeze out a bit of extra performance is by removing many of the rarely-used debugging features that Python supports, because they are expensive (i.e. time consuming) when not needed. Doing just this has resulted in a two percent speedup. Developers who want debugging features can apparently still use the “debug build” of stock Python, because of the compatibility between the two.

    Pumped-up performance Python with Pyston

    The Pyston project has had a shaky start, with development hitting a hiatus after Dropbox pulled its sponsorship back in 2017. Now the feedback from potential customers has convinced the project team that Pyston can thrive on an open-source business model, and so the code for Pyston v2.2 is available on GitHub.

    Python with Pyston v2.2: faster and open source

    pyston logo

    Pyston’s developers are proud to announce Pyston v2.2, the latest version of our faster implementation of the Python programming language. This version is significantly faster than previous ones, and importantly is now open source.

    They also merged in many changes from CPython and are now based on CPython 3.8.8.

    Pyston v2.2: Performance

    Pyston v2.2 is 30% faster than stock Python on our web server benchmarks. This is a significant improvement over our previous performance, and if we were feeling cheeky, we would advertise it as “50% more speedup.”

    The foundational technology powering Pyston v2.2 is the same as that found in earlier versions, but we have tuned and optimized more areas and found additional speedups, particularly in our JIT and attribute cache mechanisms.

    One noteworthy change is that we decided to remove many of the rarely-used debugging features that Python supports because they are expensive even when not needed. Doing so collectively resulted in a 2% speedup, which was remarkable to us: of all the computers in the world running Python, 2% of them are executing debugging checks. We’ve disabled those checks and are positioning ourselves as an “optimized build” similar to binaries without debugging information. Those who still want debugging features can use the “debug build” of stock Python because they are interchangeable. For a full list of the features we removed in Pyston v2.2, please see our wiki.

    Pyston v2.2: Open source

    As we’ve continued talking to potential customers we now feel convinced that Pyston can thrive on an open-source business model, primarily by starting with support services. This means that we’ve open sourced Pyston v2.2, which you can find at our GitHub here.

    We’ve archived our old repository to reduce confusion, but you can still find that here.

    We are looking into which of our newest changes can be upstreamed to CPython. Throughout this process, we welcome your contributions. Help with getting Pyston packaged for additional platforms would be especially useful.

    Pyston v2.2: Moving forward

    We continue to try and make Pyston as compelling and easy to use as possible. Working Pyston into your projects should be as easy as replacing “python” with “pyston.” If that’s not the case, we’d love to hear about it on our GitHub issues tracker or on our Discord channel. We hope you’ll give Pyston a try and see that it really is the easiest way to speed up your Python code.

  • Sublime Text 4 is now released and available

    Sublime Text 4 is now released and available

    Sublime Text 4 is now released and available

    The first stable release of Sublime Text 4 is now released and available. It now works with Apple Silicon and Linux ARM64, and includes a lot of great new features: Tab Multi-Select, Refreshed UI, Context-Aware Auto Complete, TypeScript, JSX and TSX Support, Superpowered Syntax Definitions

    The first stable release of Sublime Text 4 has finally arrived! We’ve worked hard on providing improvements without losing focus on what makes Sublime Text great. There are some new major features that we hope will significantly improve your workflow and a countless number of minor improvements across the board.
    A huge thanks goes out to all the beta testers on discord and all the contributors to our packages.

    👉Download Sublime Text 4

    👉Cài đặt Flutter với Visual Studio Code

    #Sublime Text 4: License Changes

    Sublime Text license keys are no longer tied to a single major version, instead they are now valid for all updates within 3 years of purchase. After that, you will still have full access to every version of Sublime Text released within the 3 year window, but newer builds will required a license upgrade. These are the same license terms we use for Sublime Merge, and they allow us to deliver more frequent and exciting updates as soon as they’re ready, without having to roll them into a new major version.

    #Sublime Text 4: Tab Multi-Select

    File tabs have been enhanced to make split views effortless, with support throughout the interface and built-in commands. The side bar, tab bar, Goto Anything, Goto Definition, auto complete and more have all been tweaked to make code navigation easier and more intuitive than ever.

    Sublime Text 4 is now released and available 1

    #Sublime Text 4: Apple Silicon and Linux ARM64

    Sublime Text for Mac now includes native support for Apple Silicon processors. Linux ARM64 builds are also available for devices like the Raspberry Pi.

    #Sublime Text 4: Refreshed UI

    The Default and Adaptive themes have been refreshed with new tab styles and inactive pane dimming. Themes and Color Schemes support auto dark-mode switching. The Adaptive theme on Windows and Linux now features custom title bars.

    #Sublime Text 4: Context-Aware Auto Complete

    The auto complete engine has been rewritten to provide smart completions based on existing code in a project. Suggestions are also augmented with info about their kind, and provide links to definitions.

    Sublime Text 4 is now released and available 2

    #Sublime Text 4: TypeScript, JSX and TSX Support

    Support for one of the most popular new programming languages is now shipped by default. Utilize all of the smart syntax-based features of Sublime Text within the modern JavaScript ecosystem.

    #Sublime Text 4: Superpowered Syntax Definitions

    The syntax highlighting engine has been significantly improved, with new features like handling non-deterministic grammars, multi-line constructs, lazy embeds and syntax inheritance. Memory usage has been reduced, and load times are faster than ever.

    #Sublime Text 4: GPU Rendering

    Sublime Text can now utilize your GPU on Linux, Mac and Windows when rendering the interface. This results in a fluid UI all the way up to 8K resolutions, all while using less power than before.

    A single frame being rendered. See our blogpost on OpenGL rendering.

    Updated Python API

    The Sublime Text API has been updated to Python 3.8, while keeping backwards compatibility with packages built for Sublime Text 3. The API has been significantly expanded, adding features that allow plugins like LSP to work better than ever. Read the revamped documentation here.

    Compatibility

    Sublime Text 4 is fully compatible with version 3. It will pickup your session and configuration automatically. If you’d prefer however, it is possible to keep things separate.

  • List of Regular Expressions

    List of Regular Expressions

    Term

    Representation/Use

    Any character

    The given character, unless it is a regular expression meta character. The list of meta characters follows in this table.

    .

    Any single character except a line break or a paragraph break. For example, the search term “sh.rt” matches both “shirt” and “short”.

    ^

    The beginning of a paragraph or cell. Special objects such as empty fields or character-anchored frames, at the beginning of a paragraph are ignored. Example: “^Peter” matches the word “Peter” only when it is the first word of a paragraph.

    $

    The end of a paragraph or cell. Special objects such as empty fields or character-anchored frames at the end of a paragraph are ignored. Example: “Peter$” matches only when the word “Peter” is the last word of a paragraph, note “Peter” cannot be followed by a period.

    $ on its own matches the end of a paragraph. This way it is possible to search and replace paragraph breaks.

    *

    Zero or more of the regular expression term immediately preceding it. For example, “Ab*c” matches “Ac”, “Abc”, “Abbc”, “Abbbc”, and so on.

    +

    One or more of the regular expression term immediately preceding it. For example, “AX.+4” finds “AXx4”, but not “AX4”.

    The longest possible string that matches this regular expression in a paragraph is always matched. If the paragraph contains the string “AX 4 AX4”, the entire passage is highlighted.

    ?

    Zero or one of the regular expression term immediately preceding it. For example, “Texts?” matches “Text” and “Texts” and “x(ab|c)?y” finds “xy”, “xaby”, or “xcy”.

    The special character that follows it is interpreted as a normal character and not as a regular expression meta character (except for the combinations “n”, “t”, “b”, “>” and “<“). For example, “tree.” matches “tree.”, not “treed” or “trees”.

    n

    A line break that was inserted with the Shift+Enter key combination when in the Find text box.

    A paragraph break that can be entered with the Enter or Return key when in the Replace text box in Writer. Has no special meaning in Calc, and is treated literally there.

    To change line breaks into paragraph breaks, enter n in both the Find and Replace boxes, and then perform a search and replace.

    t

    A tab character. Can also be used in the Replace box.

    b

    A word boundary. For example, “bbook” matches “bookmark” and “book” but not “checkbook” whereas “bookb” matches “checkbook” and “book” but not “bookmark”.

    Note, this form replaces the obsolete (although they still work for now) forms “>” (match end of word) and “<” (match start of word).

    ^$

    Finds an empty paragraph.

    ^.

    Finds the first character of a paragraph.

    & or $0

    Adds the string that was found by the search criteria in the Find box to the term in the Replace box when you make a replacement.

    For example, if you enter “window” in the Find box and “&frame” in the Replace box, the word “window” is replaced with “windowframe”.

    You can also enter an “&” in the Replace box to modify the Attributes or the Format of the string found by the search criteria.

    […]

    Any single occurrence of any one of the characters that are between the brackets. For example: “[abc123]” matches the characters ‘a’, ‘b’, ’c’, ‘1’, ‘2’ and ‘3’. “[a-e]” matches single occurrences of the characters a through e, inclusive (the range must be specified with the character having the smallest Unicode code number first). “[a-eh-x]” matches any single occurrence of the characters that are in the ranges ‘a’ through ‘e’ and ‘h’ through ‘x’.

    [^…]

    Any single occurrence of a character, including Tab, Space and Line Break characters, that is not in the list of characters specified inclusive ranges are permitted. For example “[^a-syz]” matches all characters not in the inclusive range ‘a’ through ‘s’ or the characters ‘y’ and ‘z’.

    uXXXX

    UXXXXXXXX

    The character represented by the four-digit hexadecimal Unicode code (XXXX).

    The character represented by the eight-digit hexadecimal Unicode code (XXXXXXXX).

    For certain symbol fonts the symbol (glyph) that you see on screen may look related to a different Unicode code than that is actually used for it in the font. The Unicode codes can be viewed by choosing Insert – Special Character, or using Unicode conversion shortcut.

    |

    The infix operator delimiting alternatives. Matches the term preceding the “|” or the term following the “|”. For example, “this|that” matches occurrences of both “this” and “that”.

    {N}

    The post-fix repetition operator that specifies an exact number of occurrences (“N”) of the regular expression term immediately preceding it must be present for a match to occur. For example, “tre{2}” matches “tree”.

    {N,M}

    The post-fix repetition operator that specifies a range (minimum of “N” to a maximum of “M”) of occurrences of the regular expression term immediately preceding it that can be present for a match to occur. For example, “tre{1,2}” matches “tre” and “tree”.

    {N,}

    The post-fix repetition operator that specifies a range (minimum “N” to an unspecified maximum) of occurrences of the regular expression term immediately preceding it that can be present for a match to occur. (The maximum number of occurrences is limited only by the size of the document). For example, “tre{2,}” matches “tree”, “treee”, and “treeeee”.

    (…)

    The grouping construct that serves three purposes.

    1. To enclose a set of ‘|’ alternatives. For example, the regular expression “b(oo|ac)k” matches both “book” and “back”.

    2. To group terms in a complex expression to be operated on by the post-fix operators: “*”, “+” and “?” along with the post-fix repetition operators. For example, the regular expression “a(bc)?d” matches both “ad” and “abcd” in a search.; the regular expression “M(iss){2}ippi” matches “Mississippi”.

    3. To record the matched sub string inside the parentheses as a reference for later use in the Find box using the “n” construct or in the Replace box using the “$n” construct. The reference to the first match is represented by “1” in the Find box and by “$1” in the Replace box. The reference to the second matched sub string by “2” and “$2” respectively, and so on.

    For example, the regular expression “(890)711” matches “8907890890”.

    With the regular expression “b(fruit|truth)b” in the Find box and the regular expression “$1ful” in the Replace box occurrences of the words “fruit” and “truth” can be replaced with the words “fruitful” and “truthful” respectively without affecting the words “fruitfully” and “truthfully”

    [:alpha:]

    Represents an alphabetic character. Use [:alpha:]+ to find one of them.

    [:digit:]

    Represents a decimal digit. Use [:digit:]+ to find one of them.

    [:alnum:]

    Represents an alphanumeric character ([:alpha:] and [:digit:]).

    [:space:]

    Represents a space character (but not other whitespace characters).

    [:print:]

    Represents a printable character.

    [:cntrl:]

    Represents a nonprinting character.

    [:lower:]

    Represents a lowercase character if Match case is selected in Options.

    [:upper:]

    Represents an uppercase character if Match case is selected in Options.

     

    For a full list of supported metacharacters and syntax, see ICU Regular Expressions documentation

    Note that currently all named character class terms, [:alpha:] through [:upper:], must be enclosed in parentheses when used in a regular expression, see the examples that follow.

    Regular expression terms can be combined to form complex and sophisticated regular expressions for searches as show in the following examples.

    Examples

    Expression

    Meaning

    ^$

    An empty paragraph.

    ^ specifies that the match must be at the start of a paragraph,

    $ specifies that a paragraph mark or the end of a cell must follow the matched string.

    ^.

    The first character of a paragraph.

    ^ specifies that the match must be at the start of a paragraph,

    . specifies any single character.

    e([:digit:])?

    Matches “e” by itself or an “e” followed by one digit.

    e specifies the character “e”,

    [:digit:] specifies any decimal digit,

    ? specifies zero or one occurrences of [:digit:].

    ^([:digit:])$

    Matches a paragraph or cells containing exactly one digit.

    ^ specifies that the match must be at the start of a paragraph,

    [:digit:] specifies any decimal digit,

    $ specifies that a paragraph mark or the end of a cell must follow the matched string.

    ^[:digit:]{3}$

    Matches a paragraph or cell containing only three digit numbers

    ^ specifies that the match must be at the start of a paragraph,

    [:digit:] specifies any decimal digit,

    {3} specifies that [:digit:] must occur three times,

    $ specifies that a paragraph mark or the end of a cell must follow the matched string.

    bconst(itu|ruc)tionb

    Matches the words “constitution” and “construction” but not the word “constitutional.”

    b specifies that the match must begin at a word boundary,

    const specifies the characters “const”,

    ( starts the group,

    itu specifies the characters “itu”,

    | specifies the alternative,

    ruc specifies the characters “ruc”,

    ) ends the group,

    tion specifies the characters “tion”,

    b specifies that the match must end at a word boundary.

    Regular Expression Operators

    Operator Description
    | Alternation. A|B matches either A or B.
    * Match 0 or more times. Match as many times as possible.
    + Match 1 or more times. Match as many times as possible.
    ? Match zero or one times. Prefer one.
    {n} Match exactly n times
    {n,} Match at least n times. Match as many times as possible.
    {n,m} Match between n and m times. Match as many times as possible, but not more than m.
    *? Match 0 or more times. Match as few times as possible.
    +? Match 1 or more times. Match as few times as possible.
    ?? Match zero or one times. Prefer zero.
    {n}? Match exactly n times.
    {n,}? Match at least n times, but no more than required for an overall pattern match.
    {n,m}? Match between n and m times. Match as few times as possible, but not less than n.
    *+ Match 0 or more times. Match as many times as possible when first encountered, do not retry with fewer even if overall match fails (Possessive Match).
    ++ Match 1 or more times. Possessive match.
    ?+ Match zero or one times. Possessive match.
    {n}+ Match exactly n times.
    {n,}+ Match at least n times. Possessive Match.
    {n,m}+ Match between n and m times. Possessive Match.
    ( ...) Capturing parentheses. Range of input that matched the parenthesized subexpression is available after the match.
    (?: ...) Non-capturing parentheses. Groups the included pattern, but does not provide capturing of matching text. Somewhat more efficient than capturing parentheses.
    (?> ...) Atomic-match parentheses. First match of the parenthesized subexpression is the only one tried; if it does not lead to an overall pattern match, back up the search for a match to a position before the “(?>”.
    (?# ...) Free-format comment (?# comment ).
    (?= ...) Look-ahead assertion. True if the parenthesized pattern matches at the current input position, but does not advance the input position.
    (?! ...) Negative look-ahead assertion. True if the parenthesized pattern does not match at the current input position. Does not advance the input position.
    (?<= ...) Look-behind assertion. True if the parenthesized pattern matches text preceding the current input position, with the last character of the match being the input character just before the current position. Does not alter the input position. The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators.)
    (?<! ...) Negative Look-behind assertion. True if the parenthesized pattern does not match text preceding the current input position, with the last character of the match being the input character just before the current position. Does not alter the input position. The length of possible strings matched by the look-behind pattern must not be unbounded (no * or + operators.)
    (?<name>...) Named capture group. The are literal – they appear in the pattern.
    (?ismwx-ismwx:...) Flag settings. Evaluate the parenthesized expression with the specified flags enabled or -disabled.
    (?ismwx-ismwx) Flag settings. Change the flag settings. Changes apply to the portion of the pattern following the setting. For example, (?i) changes to a case insensitive match.

    Set Expressions (Character Classes)

    Example Description
    [abc] Match any of the characters a, b or c.
    [^abc] Negation – match any character except a, b or c.
    [A-M] Range – match any character from A to M. The characters to include are determined by Unicode code point ordering.
    [u0000-U0010ffff] Range – match all characters.
    [p{L}] [p{Letter}] [p{General_Category=Letter}] Characters with Unicode Category = Letter. All forms shown are equivalent.
    [P{Letter}] Negated property. (Upper case P) Match everything except Letters.
    [p{numeric_value=9}] Match all numbers with a numeric value of 9. Any Unicode Property may be used in set expressions.
    [p{Letter}&&p{script=cyrillic}] Logical AND or intersection. Match the set of all Cyrillic letters.
    [p{Letter}--p{script=latin}] Subtraction. Match all non-Latin letters.
    [[a-z][A-Z][0-9]] [a-zA-Z0-9] Implicit Logical OR or Union of Sets. The examples match ASCII letters and digits. The two forms are equivalent.
    [:script=Greek:] Alternate POSIX-like syntax for properties. Equivalent to p{script=Greek}.

    Case Insensitive Matching

    Case insensitive matching is specified by the UREGEX_CASE_INSENSITIVE flag during pattern compilation, or by the (?i) flag within a pattern itself. Unicode case insensitive matching is complicated by the fact that changing the case of a string may change its length. See http://www.unicode.org/faq/casemap_charprop.html for more information on Unicode casing operations.

    Full case-insensitive matching handles situations where the number of characters in equal string may differ. “fußball” compares equal “FUSSBALL”, for example.

    Simple case insensitive matching operates one character at a time on the strings being compared. “fußball” does not compare equal to “FUSSBALL”

    For ICU regular expression matching,

    • Anything from a regular expression pattern that looks like a literal string (even of one character) will be matched against the text using full case folding. The pattern string and the matched text may be of different lengths.
    • Any sequence that is composed by the matching engine from originally separate parts of the pattern will not match with the composition boundary within a case folding expansion of the text being matched.
    • Matching of [set expressions] uses simple matching. A [set] will match exactly one code point from the text.

    Examples:

    • pattern “fussball” will match “fußball or “fussball”.
    • pattern “fu(s)(s)ball” or “fus{2}ball” will match “fussball” or “FUSSBALL” but not “fußball.
    • pattern “ß” will find occurrences of “ss” or “ß”.
    • pattern “s+” will not find “ß”.

    With these rules, a match or capturing sub-match can never begin or end in the interior of an input text character that expanded when case folded.

  • Delete all comment lines in Sublime Text 3

    Delete all comment lines in Sublime Text 3

    To delete all specific <tag> element including contents inside it:

    • Ctrl + H (on PC)
    • Enable (Regular Expression): .* icon or Alt + R
    • Find What:

      RE syntax to work with a particular tag,

      (?s)<start tag>.*?<end tag>

      Such as, for CSS comment tags,

      (?s)/*.*?*/

      For HTML comment tags,

      (?s)<!--.*?-->

    • Replace With: Leave the field blank
    • Replace All
  • How to force https in htaccess

    How to force https in htaccess

    After installing an SSL certificate, your website is available over HTTP and HTTPS. However, it’s better to use only the latter because it encrypts and secures your website’s data. While Hostinger allows users to configure this setting in just one click, you can also use the .htaccess file to force HTTPS connection. This tutorial will show you how.

    How to force https on All Traffic

    One of the many functions you can perform via .htaccess is the 301 redirects, which permanently redirects an old URL to a new one. You can activate the feature to force HTTPS on all incoming traffic by following these steps:

    1. Go to File Manager in your hosting panel and open .htaccess inside the public_html folder. If you can’t locate it, make sure to create or unhide it.
      In my hosting, I use Cpanel, I do these following steps:
      Howto force https How to force https in htaccess 3
    2. Scroll down to find RewriteEngine On and insert the following lines of code below it:
      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    3. Save the changes.

    IMPORTANT: Make sure that the line RewriteEngine On is not repeated twice. In case the line already exists, simply copy the rest of the code without it.

    How to force https on a Specific Domain

    Let’s say that you have two domains: http://yourdomain1.com and http://yourdomain2.com. Both domains access the same website, but you only want the first one to be redirected to the HTTPS version. In this case, you need to use the following code:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain1.com [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    Make sure to replace yourdomain1 with the actual domain you’re trying to force HTTPS on.

    Forcing HTTPS on a Specific Folder

    The .htaccess file can also be used to force HTTPS on specific folders. However, the file should be placed in the folder that will have the HTTPS connection.

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(folder1|folder2|folder3) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    Make sure to change the folder references to the actual directory names.

    After making the changes, clear your browser’s cache and try to connect to your site via HTTP. If everything was added correctly, the browser will redirect you to the HTTPS version.

    Conclusion

    Congratulations! you have successfully edited your .htaccess file and redirected all HTTP traffic to HTTPS, the safe version of your website. Depending on the platform where you developed your website, there could be alternative methods to enable this feature. For example, you can configure your WordPress site to work with HTTPS using plugins.

  • Cách kiểm tra website viết bằng ngôn ngữ gì?

    Cách kiểm tra website viết bằng ngôn ngữ gì?

    Cách kiểm tra website viết bằng ngôn ngữ gì?

    Để kiểm tra website viết bằng ngôn ngữ gì, bạn có thể thực hiện các bước sau:

    Hướng dẫn Cách kiểm tra website viết bằng ngôn ngữ gì

    • 2️⃣Nhập url (tên miền) của website cần kiểm tra vào ô “Enter a website addres…” và bấm vào Lookup

    Bạn có thể nhập vào một từ khóa hoặc công nghệ nào đó để tìm kiếm, ví dụ có thể nhập ‘wordpress’ hoặc ‘php’ hoặc ‘ecommerce’….

    • 3️⃣Website sẽ hiển thị các thông tin chi tiết, ví dụ với website o2.edu.vn, thì BuiltWith sẽ hiển thị:
      • Website sử dụng nền tảng (framework) là PHP, sử dụng mã nguồn WordPress
      • Các plugin mà website sử dụng như RankMath, Lazy Load…
      • Các thư viện Javascript như MathJax…

    Ngoài BuitlWith, bạn có thể sử dụng các dịch vụ khác như wappalyzer.com, w3techs.com/sites hoặc sử dụng các extensiton cho Chrome.