Blog

  • fastapi_healthcheck

    fastapi_healthcheck

    Easy to use health check for your FastAPI. This is the root module that will let you add implement and expand your usage of health checks, with FastAPI.

    This module does not contain any service checkers, but you can easily add them. The other modules are not in this root module due to different dependencies required for each one. This is made so you only bring in the packages that you need to not add extra packages.

    Install

    pip install fastapi-healthcheck or poetry add fastapi-healthcheck

    Adding Health Checks

    Here is what you need to get started.

    from fastapi import FastAPI
    from fastapi_healthcheck import HealthCheckFactory, healthCheckRoute
    from fastapi_healthcheck_sqlalchemy import HealthCheckSQLAlchemy
    
    app = FastAPI()
    
    # Add Health Checks
    _healthChecks = HealthCheckFactory()
    
    # SQLAlchemy comes from fastapi-healthcheck-sqlalchemy
    _healthChecks.add(HealthCheckSQLAlchemy(alias='postgres db', connectionUri=cs.value, table=SmtpContactsSqlModel, tags=('postgres', 'db', 'sql01')))
    
    # This will check external URI and validate the response that is returned.
    # fastapi-healthcheck-uri
    _healthChecks.add(HealthCheckUri(alias='reddit', connectionUri="https://www.reddit.com/r/aww.json", tags=('external', 'reddit', 'aww')))
    app.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))

    Returned Data

    When you request your health check, it will go and check all the entries that have been submitted and run a basic query against them. If they come back as expected, then a status code is 200. But if it runs into an error, it will return a 500 error.

    {
        "status":"Healthy",
        "totalTimeTaken":"0:00:00.671642",
        "entities":[
            {
                "alias":"postgres db",
                "status":"Healthy",
                "timeTaken":"0:00:00.009619",
                "tags":["postgres","db","sql01"]
            },
            {
                "alias":"reddit",
                "status":"Unhealthy",
                "timeTaken":"0:00:00.661716",
                "tags":["external","reddit","aww"]
            }
        ]
    }

    Available Modules

    If you have made a public service module and want to see it on this list, please open a new issue so we can add it to the list.

    Writing a custom module

    You can easily expand on this core module to add other health checks for other services. Generate a new service that pulls in HealthCheckInterface and HealthCheckBase. With those, you can build the respective class around the interface.

    Once you have your service ready to go, add it to the HealthCheckFactory, and let the testing start.

    If you would like to see an example of a custom service see fastapi_healthcheck_sqlalchemy. This will give you a better example of what you need to do to create your own module to interface with healthcheck.

    Visit original content creator repository

  • Forms

    Grafite Forms

    Forms – An amazing Forms component for Laravel.

    Build Status Maintainability Packagist license

    The Forms package lets you generate forms as well as fields with standard make commands. Inside your forms for models you can specify the fields that need to be generated and then simply pass the form to the view. No more writing html forms, error handling etc. It can handle Eloquent relationships and easily work with ajax requests for more dynamic form submissions.

    Author(s):

    Requirements

    1. PHP 8.2+
    2. OpenSSL

    Compatibility and Support

    Laravel Version Package Tag Supported
    ^11.x – ^12.x 7.x yes
    ^7.x – 11.x 6.x no
    ^7.x – ^8.x 5.x no
    ^7.x – ^8.x 4.x no
    ^7.x 3.x no
    ^5.8.x – 7.x 2.x no
    5.4.x – 5.8.x 1.3.x no
    5.4.x 1.1.x no
    5.3.x 1.0.x no

    Installation

    Start a new Laravel project:

    composer create-project laravel/laravel your-project-name

    Then run the following to add Forms

    composer require "grafite/forms"

    Time to publish those assets!

    php artisan vendor:publish --provider="Grafite\Forms\FormsProvider"

    Documentation

    https://docs.grafite.ca/utilities/forms

    Upgrading from 3.x to 4.x (Renaming)

    The package was renamed in version 3 to 4. This means that the following would need to be changed on your code base:

    form-maker.php -> forms.php

    Grafite\FormMaker -> Grafite\Forms

    @formMaker -> @forms

    <x-fm></x-fm> -> <x-f></x-f>

    <x-fm-action></x-fm-action> -> <x-f-action></x-f-action>

    <x-fm-delete></x-fm-delete> -> <x-f-delete></x-f-delete>

    <x-fm-search></x-fm-search> -> <x-f-search></x-f-search>

    Asset Sources for CSP

    js.hcaptcha.com cdn.jsdelivr.net

    License

    Forms is open-sourced software licensed under the MIT license

    Bug Reporting and Feature Requests

    Please add as many details as possible regarding submission of issues and feature requests

    Disclaimer

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Visit original content creator repository
  • Exchange-Rates-UK

    Exchange-Rates-UK

    The theme is based on Bootstrap3. And it is built with HTML5, CSS and jQuery with proper use of google rich-snippets markup.

    Layout

    • Boxed
    • Full Width

    Changes

    • Colours better, but we need the nav link text not to be orange -just white, hover pale blue
    • Can we the links be made up of a smaller dark blue box inside the nav (like the reference site)
    • The mini logo isn’t working as it’s tiny. It should be text (eg Choose a currency…) until you scroll down, and when nav becomes sticky we replace that text with the mini logo (but much bigger than you have it right now.
    • The posted by text at the top of the article wants to be viewed by user as continuous text eg. “Posted by John Cameron on February 17, 2017 in AUD, GBP, GBP to AUD.” but in code each will be inside schema.
    • Can you make the related posts at bottom exactly the same format at the ones on the side column?
    • The rates scroller at bottom needs to be width of container not full-width. Also it doesn’t scroll anymore?

    #Final Changes

    #Final Changes 1

    • the related posts at bottom, there will be no image as the text is taking up too much space. Any ideas?
    • can we lose the icon/bottom border under the side bar headings (eg Exchange Rate Calc) and can the margins be so that the headings start further to the left so the text lines up with the text underneath?

    Resources

    Simple Line Icons [http://simplelineicons.com/].

    Bootstrap 3 [http://getbootstrap.com/]

    Owl Carousel 2 [https://owlcarousel2.github.io/OwlCarousel2/]

    Sticky JS [http://stickyjs.com/]

    License

    You’re can not use this theme in your personal and private projects. Only ExchangeRatesUK.org.uk hold the copyright for this project.

    Visit original content creator repository

  • RSSBud

    RSSBud

    中文文档

    RSSBud can help you quickly discover and subscribe to RSS feeds from websites or apps, especially those provided by RSSHub. It supports the parameters feature of RSSHub which facilitates extra functionalities such as filtering by feed content and full text fetching.

    Telegram Group

    Demo.mp4

    Download

    Download on the App Store

    Features

    • Detects RSS feeds in web pages
    • Detects RSSHub feeds applicable for web pages (supports almost all rules of RSSHub Radar)
    • Detects other RSS feeds applicable for web pages (powered by RSSBud Rules)
    • Optimized for mobile environment (automatically expands URLs and adapts to common mobile sub-domains)
    • Share sheet extension
    • Quick subscription to Reeder, Fiery Feeds, Ego Reader, and system default RSS reader
    • Quick subscription to Tiny Tiny RSS, Miniflux, Fresh RSS, Feedly, Inoreader, Feedbin, The Old Reader, Feeds Pub
    • Parameter editor for RSSHub feeds
    • Rules kept up-to-date automatically
    • Customizable remote rules files
    • Simultaneously matches against multiple rules files
    • RSSHub access control (automatically generates MD5 access code)
    • Supports x-callback-url; can be used in “Shortcuts” app to facilitate a variety of powerful functions (see Shortcut Workshop and Scheme)

    Shortcut Workshop

    If RSSBud doesn’t support your RSS reader/service, or you want to integrate RSSBud into your workflow, you can write shortcuts utilizing RSSBud’s support for x-callback-url to fulfill your needs. Let’s start with the following ones!

    RSSBud Starter Shortcut by cayZ | A template for RSSBud related shortcuts that sets up the variables and supports share sheets.

    Analyze with RSSBud and Send with Telegram by cayZ | Send RSSBud analysis results to Telegram with customizable message template and recipient.

    Analyze with RSSBud and Subscribe with Pocket Casts by cayZ | Send RSSBud analysis results to Pocket Casts (podcast RSS only).

    Scan QR and Analyze with RSSBud by cayZ | Get URL from scanned QR code and analyze with RSSBud.

    If you think you’ve got an idea of a shortcut that can benefit a larger audience, you’re welcomed to submit an issue!

    X-callback-url Scheme

    RSSBud has implemented the x-callback-url protocol, which provides a standardized means for iOS developers to expose and document the methods they make available to other apps via custom URL schemes.

    You can open the following URL to let RSSBud analyze the provided URL and return the RSS feed chosen by the user:

    rssbud://x-callback-url/analyze?url[&x-callback-parameters...]
    

    Parameters

    • url The URL you want RSSBud to analyze

    x-success

    • feed_title The name of the RSS feed chosen by the user
    • feed_url The URL of the RSS feed chosen by the user

    PopClip Extension

    If you happen use both RSSBud and PopClip on macOS, here’s a handy extension that can be used to analyze selected URLs with RSSBud. Simply select everything in the code block below and you will see an option to install the extension in PopClip.

    #popclip
    name: RSSBud
    icon: iconify:ph:rss-bold
    url: rssbud:///analyze?url=***

    Notes for Building from Source

    The core functionality of RSSBud comes from RSSBud Core, a sub-project written in JavaScript. The code is mainly referenced from RSSHub Radar.

    Make sure you have Node.js installed before you build with Xcode.

    If you wish to use the action extension, please set up your own App Group in both the iOS and Action Extension targets and modify RSSBud.appGroupIdentifier accordingly.

    Rules

    RSSBud’s functionality is largely powered by rules from two open-source projects. Please consider contributing to the appropriate rules if a particular feed can’t be discovered by RSSBud.

    • RSSHub Radar Rules are created and maintained by the RSSHub community. They are used to discover RSSHub feeds.

      Submit new RSSHub Radar rules

    • RSSBud Rules are a superset of RSSHub Radar rules. The extended schema allows non-RSSHub feeds (e.g. official RSS feeds that are not discoverable by parsing HTML) to be discovered. Please consider contributing to RSSHub Radar rules first if the feed is an RSSHub feed.

      Submit new RSSBud rules

    Similar projects

    Author

    RSSBud is made by cayZ and is open-source under the MIT License.

    Visit original content creator repository
  • leetcode

    💡 LeetCode Solutions

    This repository contains my personal solutions to LeetCode problems, written in Java, JavaScript, SQL, and pandas.

    All solution files are kept directly in the root of the repository. Each file is named after the problem it solves, often including the problem number and a descriptive title.


    📦 What’s Inside

    • ✅ Solutions to a wide range of LeetCode problems
    • Java (.java), JavaScript (.js), SQL (.sql), and pandas (.py) code
    • ✅ Clear, readable implementations
    • ✅ Covers various topics such as arrays, strings, trees, dynamic programming, recursion, SQL queries, and data manipulation with pandas

    🗂️ Repository Structure

    • All solution files are in the root directory.
    • File naming: {problem-number}-{problem-title}.{js|java|sql|py} (e.g., 1-two-sum.java, 2-add-two-numbers.js, 175-combine-two-tables.sql, 1876-substrings-of-size-three-with-distinct-characters.py)
    • No subfolders for topics or languages.

    🚀 How to Run

    • Java:
      Compile and run using:

      javac ProblemFileName.java
      java ProblemFileName
    • JavaScript:
      Run using Node.js:

      node ProblemFileName.js
    • SQL:
      Run in your preferred SQL environment (e.g., MySQL, PostgreSQL, LeetCode’s online editor).
    • pandas (Python):
      Run using Python 3:

      python ProblemFileName.py

    🧠 Purpose

    This repository serves as a personal reference for:

    • Practicing coding problems
    • Reviewing core data structures and algorithms
    • Preparing for coding interviews

    Java

    Problem Difficulty LeetCode Link
    1. Two Sum Easy Link
    3. Longest Substring Without Repeating Characters Medium Link
    4. Median Of two sorted arrays Hard Link
    5. Longest Palindromic Substring Medium Link
    7. Reverse Integer Medium Link
    9. Palindrome Number Easy Link
    13. Roman to Integer Easy Link
    15. 3Sum Medium Link
    16. 3Sum Closest Medium Link
    19. Remove Nth Node From End of List Medium Link
    21. Merge Two Sorted Lists Easy Link
    26. Remove Duplicates from Sorted Array Easy Link
    27. Remove Element Easy Link
    28. Find the Index of the First Occurrence in a String Easy Link
    29. Divide Two Integers Medium Link
    33. Search in Rotated Sorted Array Medium Link
    35. Search Insert Position Easy Link
    38. Count and Say Medium Link
    41. First Missing Positive Hard Link
    42. Trapping Rain Water Hard Link
    43. Multiply Strings Medium Link
    48. Rotate Image Medium Link
    50. Pow(x, n) Medium Link
    53. Maximum Subarray Medium Link
    54. Spiral Matrix Medium Link
    55. Jump Game Medium Link
    58. Length of Last Word Easy Link
    66. Plus One Easy Link
    69. Sqrt(x) Easy Link
    70. Climbing Stairs Easy Link
    73. Set Matrix Zeroes Medium Link
    74. Search a 2D Matrix Medium Link
    75. Sort Colors Medium Link
    80. Remove Duplicates from Sorted Array II Medium Link
    88. Merge Sorted Array Easy Link
    94. Binary Tree Inorder Traversal Easy Link
    118. Pascal’s Triangle Easy Link
    121. Best Time to Buy and Sell Stock Easy Link
    122. Best Time to Buy and Sell Stock II Medium Link
    125. Valid Palindrome Easy Link
    128. Longest Consecutive Sequence Medium Link
    136. Single Number Easy Link
    137. Single Number II Medium Link
    141. Linked List Cycle Easy Link
    144. Binary Tree Preorder Traversal Easy Link
    145. Binary Tree Postorder Traversal Easy Link
    151. Reverse Words in a String Medium Link
    152. Maximum Product Subarray Medium Link
    160. Intersection of Two Linked Lists Easy Link
    162. Find Peak Element Medium Link
    164. Maximum Gap Hard Link
    169. Majority Element Easy Link
    171. Excel Sheet Column Number Easy Link
    189. Rotate Array Medium Link
    191. Number of 1 Bits Easy Link
    198. House Robber Medium Link
    202. Happy Number Easy Link
    204. Count Primes Medium Link
    205. Isomorphic Strings Easy Link
    206. Reverse Linked List Easy Link
    213. House Robber II Medium Link
    215. Kth Largest Element in an Array Medium Link
    217. Contains Duplicate Easy Link
    219. Contains Duplicate II Easy Link
    229. Majority Element II Medium Link
    231. Power of Two Easy Link
    237. Delete Node in a Linked List Medium Link
    238. Product of Array Except Self Medium Link
    240. Search a 2D Matrix II Medium Link
    242. Valid Anagram Easy Link
    258. Add Digits Easy Link
    260. Single Number III Medium Link
    263. Ugly Number Easy Link
    268. Missing Number Easy Link
    283. Move Zeroes Easy Link
    290. Word Pattern Easy Link
    292. Nim Game Easy Link
    303. Range Sum Query – Immutable Easy Link
    326. Power of Three Easy Link
    342. Power of Four Easy Link
    344. Reverse String Easy Link
    345. Reverse Vowels of a String Easy Link
    347. Top K Frequent Elements Medium Link
    367. Valid Perfect Square Easy Link
    374. Guess Number Higher or Lower Easy Link
    383. Ransom Note Easy Link
    387. First Unique Character in a String Easy Link
    389. Find the Difference Easy Link
    412. Fizz Buzz Easy Link
    414. Third Maximum Number Easy Link
    442. Find All Duplicates in an Array Medium Link
    448. Find All Numbers Disappeared in an Array Easy Link
    453. Minimum Moves to Equal Array Elements Easy Link
    455. Assign Cookies Easy Link
    485. Max Consecutive Ones Easy Link
    507. Perfect Number Easy Link
    509. Fibonacci Number Easy Link
    594. Longest Harmonious Subsequence Easy Link
    622. Design Circular Queue Medium Link
    628. Maximum Product of Three Numbers Easy Link
    693. Binary Number with Alternating Bits Easy Link
    704. Binary Search Easy Link
    771. Jewels and Stones Easy Link
    781. Rabbits in Forest Medium Link
    790. Domino and Tromino Tiling Medium Link
    860. Lemonade Change Easy Link
    876. Middle of the Linked List Easy Link
    899. Orderly Queue Hard Link
    905. Sort Array By Parity Easy Link
    912. Sort an Array Medium Link
    917. Reverse Only Letters Easy Link
    941. Valid Mountain Array Easy Link
    977. Squares of a Sorted Array Easy Link
    1003. Check If Word Is Valid After Substitutions Medium Link
    1051. Height Checker Easy Link
    1089. Duplicate Zeros Easy Link
    1108. Defanging an IP Address Easy Link
    1128. Number of Equivalent Domino Pairs Easy Link
    1200. Minimum Absolute Difference Easy Link
    1267. Count Servers that Communicate Medium Link
    1290. Convert Binary Number in a Linked List to Integer Easy Link
    1295. Find Numbers with Even Number of Digits Easy Link
    1299. Replace Elements with Greatest Element on Right Side Easy Link
    1317. Convert Integer to the Sum of Two No-Zero Integers Easy Link
    1323. Maximum 69 Number Easy Link
    1324. Print Words Vertically Medium Link
    1342. Number of Steps to Reduce a Number to Zero Easy Link
    1346. Check If N and Its Double Exist Easy Link
    1358. Number of Substrings Containing All Three Characters Medium Link
    1394. Find Lucky Integer in an Array Easy Link
    1399. Count Largest Group Easy Link
    1431. Kids With the Greatest Number of Candies Easy Link
    1460. Make Two Arrays Equal by Reversing Subarrays Easy Link
    1464. Maximum Product of Two Elements in an Array Easy Link
    1470. Shuffle the Array Easy Link
    1480. Running Sum of 1d Array Easy Link
    1491. Average Salary Excluding the Minimum and Maximum Salary Easy Link
    1492. The kth Factor of n Medium Link
    1512. Number of Good Pairs Easy Link
    1518. Water Bottles Easy Link
    1523. Count Odd Numbers in an Interval Range Easy Link
    1524. Number of Sub-arrays With Odd Sum Medium Link
    1534. Count Good Triplets Easy Link
    1550. Three Consecutive Odds Easy Link
    1567. Maximum Length of Subarray With Positive Product Medium Link
    1572. Matrix Diagonal Sum Easy Link
    1641. Count Sorted Vowel Strings Medium Link
    1684. Count the Number of Consistent Strings Easy Link
    1685. Sum of Absolute Differences in a Sorted Array Medium Link
    1689. Partitioning Into Minimum Number Of Deci-Binary Numbers Medium Link
    1694. Reformat Phone Number Easy Link
    1748. Sum of Unique Elements Easy Link
    1749. Maximum Absolute Sum of Any Subarray Medium Link
    1752. Check if Array Is Sorted and Rotated Easy Link
    1768. Merge Strings Alternately Easy Link
    1780. Check if Number is a Sum of Powers of Three Medium Link
    1796. Second Largest Digit in a String Easy Link
    1800. Maximum Ascending Subarray Sum Easy Link
    1807. Evaluate the Bracket Pairs of a String Medium Link
    1816. Truncate Sentence Easy Link
    1832. Check if the Sentence Is Pangram Easy Link
    1833. Maximum Ice Cream Bars Medium Link
    1859. Sorting the Sentence Easy Link
    1863. Sum of All Subset XOR Totals Easy Link
    1920. Build Array from Permutation Easy Link
    1922. Count Good Numbers Medium Link
    1929. Concatenation of Array Easy Link
    1935. Maximum Number of Words You Can Type Easy Link
    1941. Check if All Characters Have Equal Number of Occurrences Easy Link
    1945. Sum of Digits of String After Convert Easy Link
    1957. Delete Characters to Make Fancy String Easy Link
    1976. Number of Ways to Arrive at Destination Medium Link
    2000. Reverse Prefix of Word Easy Link
    2011. Final Value of Variable After Performing Operations Easy Link
    2016. Maximum Difference Between Increasing Elements Easy Link
    2023. Number of Pairs of Strings With Concatenation Equal to Target Medium Link
    2033. Minimum Operations to Make a Uni-Value Grid Medium Link
    2079. Watering Plants Medium Link
    2085. Count Common Words With One Occurrence Easy Link
    2094. Finding 3-Digit Even Numbers Medium Link
    2108. Find First Palindromic String in the Array Easy Link
    2109. Adding Spaces to a String Medium Link
    2115. Find All Possible Recipes from Given Supplies Medium Link
    2149. Rearrange Array Elements by Sign Medium Link
    2150. Find All Lonely Numbers in the Array Medium Link
    2154. Keep Multiplying Found Values by Two Easy Link
    2161. Partition Array According to Given Pivot Medium Link
    2169. Count Operations to Obtain Zero Easy Link
    2176. Count Equal and Divisible Pairs in an Array Easy Link
    2185. Counting Words With a Given Prefix Easy Link
    2206. Divide Array Into Equal Pairs Easy Link
    2225. Find Players With Zero or One Losses Medium Link
    2226. Maximum Candies Allocated to K Children Medium Link
    2235. Add Two Integers Easy Link
    2264. Largest 3-Same-Digit Number in String Easy Link
    2348. Number of Zero-Filled Subarrays Medium Link
    2351. First Letter to Appear Twice Easy Link
    2357. Make Array Zero by Subtracting Equal Amounts Easy Link
    2379. Minimum Recolors to Get K Consecutive Black Blocks Easy Link
    2390. Removing Stars From a String Medium Link
    2396. Strictly Palindromic Number Medium Link
    2401. Longest Nice Subarray Medium Link
    2410. Maximum Matching of Players With Trainers Medium Link
    2413. Smallest Even Multiple Easy Link
    2428. Maximum Sum of an Hourglass Medium Link
    2433. Find The Original Array of Prefix Xor Medium Link
    2460. Apply Operations to an Array Easy Link
    2465. Number of Distinct Averages Easy Link
    2469. Convert the Temperature Easy Link
    2503. Maximum Number of Points From Grid Queries Hard Link
    2520. Count the Digits That Divide a Number Easy Link
    2521. Distinct Prime Factors of Product of Array Medium Link
    2523. Closest Prime Numbers in Range Medium Link
    2529. Maximum Count of Positive Integer and Negative Integer Easy Link
    2535. Difference Between Element Sum and Digit Sum of an Array Easy Link
    2537. Count the Number of Good Subarrays Medium Link
    2551. Put Marbles in Bags Hard Link
    2560. House Robber IV Medium Link
    2562. Find the Array Concatenation Value Easy Link
    2566. Maximum Difference by Remapping a Digit Easy Link
    2570. Merge Two 2D Arrays by Summing Values Easy Link
    2579. Count Total Number of Colored Cells Medium Link
    2586. Count the Number of Vowel Strings in Range Easy Link
    2594. Minimum Time to Repair Cars Hard Link
    2610. Convert an Array Into a 2D Array With Conditions Medium Link
    2656. Maximum Sum With Exactly K Elements Easy Link
    2683. Neighboring Bitwise XOR Easy Link
    2685. Count the Number of Complete Components Medium Link
    2706. Buy Two Chocolates Easy Link
    2716. Minimize String Length Easy Link
    2733. Neither Minimum nor Maximum Easy Link
    2761. Prime Pairs With Target Sum Medium Link
    2769. Find the Maximum Achievable Number Easy Link
    2778. Sum of Squares of Special Elements Easy Link
    2780. Minimum Index of a Valid Split Medium Link
    2798. Number of Employees Who Met the Target Easy Link
    2818. Apply Operations to Maximize Score Hard Link
    2828. Check if a String Is an Acronym of Words Easy Link
    2843. Count Symmetric Integers Easy Link
    2873. Maximum Value of an Ordered Triplet I Easy Link
    2874. Maximum Value of an Ordered Triplet II Medium Link
    2894. Divisible and Non-divisible Sums Difference Easy Link
    2900. Longest Unequal Adjacent Groups Subsequence I Medium Link
    2942. Find Words Containing Character Easy Link
    2965. Find Missing and Repeated Values Easy Link
    3005. Count Elements With Maximum Frequency Easy Link
    3024. Type of Triangle Easy Link
    3028. Ant on the Boundary Easy Link
    3065. Minimum Operations to Exceed Threshold Value I Easy Link
    3066. Minimum Operations to Exceed Threshold Value II Medium Link
    3079. Find the Sum of Encrypted Integers Easy Link
    3099. Harshad Number Easy Link
    3105. Longest Strictly Increasing or Strictly Decreasing Subarray Easy Link
    3108. Minimum Cost Walk in Weighted Graph Hard Link
    3110. Score of a String Easy Link
    3136. Valid Word Easy Link
    3151. Special Array I Easy Link
    3169. Count Days Without Meetings Medium Link
    3190. Find Minimum Operations to Make All Elements Divisible by Three Easy Link
    3191. Minimum Operations to Make Binary Array Elements Equal to One I Medium Link
    3206. Alternating Groups I Easy Link
    3208. Alternating Groups II Medium Link
    3211. Generate Binary Strings Without Adjacent Zeros Medium Link
    3232. Find if Digit Game Can Be Won Easy Link
    3280. Convert Date to Binary Easy Link
    3289. The Two Sneaky Numbers of Digitville Medium Link
    3304. Find the K-th Character in String Game I Easy Link
    3305. Count of Substrings Containing Every Vowel and K Consonants I Medium Link
    3306. Count of Substrings Containing Every Vowel and K Consonants II Hard Link
    3330. Find the Original Typed String I Medium Link
    3356. Zero Array Transformation II Hard Link
    3375. Minimum Operations to Make Array Values Equal to K Hard Link
    3394. Check if Grid can be Cut into Sections Medium Link
    3396. Minimum Number of Operations to Make Elements in Array Distinct Medium Link
    3423. Maximum Difference Between Adjacent Elements in a Circular Array Easy Link
    3442. Maximum Difference Between Even and Odd Frequency I Easy Link
    3452. Sum of Good Numbers Easy Link
    3467. Transform Array by Parity Easy Link
    3477. Fruits Into Baskets II Medium Link
    3487. Maximum Unique Subarray Sum After Deletion Easy Link
    3492. Maximum Containers on a Ship Easy Link
    3498. Reverse Degree of a String Easy Link
    3502. Minimum Cost to Reach Every Position Medium Link
    3522. Calculate Score After Performing Instructions Easy Link
    3523. Make Array Non-decreasing Medium Link
    3541. Find Most Frequent Vowel and Consonant Easy Link
    3550. Smallest Index With Digit Sum Equal to Index Easy Link
    3582. Generate Tag for Video Caption Easy Link
    3622. Check Divisibility by Digit Sum and Product Easy Link


    JavaScript

    Problem Difficulty LeetCode Link
    1. Two Sum Easy Link
    4. Median of Two Sorted Arrays Hard Link
    9. Palindrome Number Easy Link
    13. Roman to Integer Easy Link
    21. Merge Two Sorted Lists Easy Link
    26. Remove Duplicates from Sorted Array Easy Link
    27. Remove Element Easy Link
    33. Search in Rotated Sorted Array Medium Link
    35. Search Insert Position Easy Link
    55. Jump Game Medium Link
    58. Length of Last Word Easy Link
    70. Climbing Stairs Easy Link
    80. Remove Duplicates from Sorted Array II Medium Link
    136. Single Number Easy Link
    141. Linked List Cycle Easy Link
    145. Binary Tree Postorder Traversal Easy Link
    152. Maximum Product Subarray Medium Link
    171. Excel Sheet Column Number Easy Link
    191. Number of 1 Bits Easy Link
    198. House Robber Medium Link
    342. Power of Four Easy Link
    386. Lexicographical Numbers Medium Link
    509. Fibonacci Number Easy Link
    790. Domino and Tromino Tiling Medium Link
    1399. Count Largest Group Easy Link
    1518. Water Bottles Easy Link
    1534. Count Good Triplets Easy Link
    1920. Build Array from Permutation Easy Link
    2079. Watering Plants Medium Link
    2176. Count Equal and Divisible Pairs in an Array Easy Link
    2348. Number of Zero-Filled Subarrays Medium Link
    2460. Apply Operations to an Array Easy Link
    2469. Convert the Temperature Easy Link
    2619. Array Prototype Last Easy Link
    2620. Counter Easy Link
    2621. Sleep Easy Link
    2626. Array Reduce Transformation Easy Link
    2629. Function Composition Easy Link
    2634. Filter Elements from Array Easy Link
    2635. Apply Transform Over Each Element in Array Easy Link
    2665. Counter II Easy Link
    2666. Allow One Function Call Easy Link
    2667. Create Hello World Function Easy Link
    2677. Chunk Array Easy Link
    2683. Neighboring Bitwise XOR Easy Link
    2703. Return Length of Arguments Passed Easy Link
    2704. To Be Or Not To Be Easy Link
    2723. Add Two Promises Easy Link
    2798. Number of Employees Who Met the Target Easy Link
    2843. Count Symmetric Integers Easy Link
    3000. Maximum Area of Longest Diagonal Rectangle Easy Link
    3005. Count Elements With Maximum Frequency Easy Link
    3024. Type of Triangle Easy Link
    3151. Special Array I Easy Link
    3423. Maximum Difference Between Adjacent Elements in a Circular Array Easy Link
    3467. Transform Array by Parity Easy Link
    3582. Generate Tag for Video Caption Easy Link


    SQL

    Problem Difficulty LeetCode Link
    182. Duplicate Emails Easy Link
    183. Customers Who Never Order Easy Link
    577. Employee Bonus Easy Link
    584. Find Customer Referee Easy Link
    595. Big Countries Easy Link
    619. Biggest Single Number Easy Link
    741. Find Total Time Spent by Each Employee Easy Link
    1148. Article Views I Easy Link
    1378. Replace Employee ID With The Unique Identifier Easy Link
    1527. Patients With a Condition Easy Link
    1581. Customer Who Visited but Did Not Make Any Transactions Easy Link
    1683. Invalid Tweets Easy Link
    1693. Daily Leads and Partners Easy Link
    1757. Recyclable and Low Fat Products Easy Link
    1978. Employees Whose Manager Left the Company Easy Link
    2356. Number of Unique Subjects Taught by Each Teacher Easy Link


    Python (pandas)

    Problem Difficulty LeetCode Link
    2879. Display the First Three Rows Easy Link
    2881. Create a New Column Easy Link
    2882. Drop Duplicate Rows Easy Link
    2884. Modify Columns Easy Link
    2886. Change Data Type Easy Link
    2888. Reshape Data: Concatenate Easy Link


    🤝 Contributing

    Contributions are welcome!
    If you’d like to add a new solution or improve an existing one:

    • Fork the repository
    • Add your solution in the root directory
    • Use the existing naming convention
    • Open a pull request

    🔗 LeetCode Profile

    Check out my LeetCode submissions and progress:
    👉 https://leetcode.com/Sanjay3005v


    🙋‍♂️ Author

    Sanjay V
    📧 sanjay3005v@gmail.com
    🔗 GitHub | LinkedIn


    ⭐️ If You Like This Repo

    Feel free to star ⭐ the repository if you find it useful!

    Visit original content creator repository

  • macSKK

    macSKK test

    macSKKはmacOS用のSKK方式の日本語入力システム (インプットメソッド) です。

    macOS用のSKK方式の日本語入力システムにはすでにAquaSKKがありますが、いくつか独自の機能を作りたいと思い新たに開発しています。

    macSKKを使用するには macOS 13.3 (Ventura) 以降が必要です。
    Universal Binary (Apple Silicon & Intel Mac) でビルドしていますが、動作確認はApple Silicon環境でのみ行っています。

    特徴

    • 日本語入力システムはパスワードなどの機密情報を処理する可能性があるため安全性が求められるプログラムです。そのためmacSKKはmacOSのSandbox機構を使いネットワーク通信やファイルの読み書きに制限をかけることでセキュリティホールを攻撃されたときの被害を減らすように心掛けます。
    • 不正なコードが含まれるリスクを避けるため、サードパーティによる外部ライブラリは使用していません。
    • すべてをSwiftだけでコーディングしており、イベント処理にCombineを、UI部分にはSwiftUIを使用しています。
    • 単語登録モードや送り仮名入力中などキー入力による状態変化管理が複雑なのでユニットテストを書いてエンバグのリスクを減らす努力をしています。

    実装予定

    しばらくはAquaSKKにはあるけどmacSKKにない機能を実装しつつ、徐々に独自機能を実装していこうと考えています。

    実装予定の独自機能

    • 自動更新確認
      • Network Outgoingが可能なXPCプロセスを作成し、GitHub Releasesから情報を定期的に取得して新しいバージョンが見つかったらNotification Centerに表示する
    • 辞書のJSON形式への対応
    • xterm.jsを利用するアプリケーションでaiueoでひらがなが入力できない問題のワークアラウンド対応 (VSCode Terminal, Hyperなど)
    • iCloudにマイ辞書を保存して他環境と共有できるようにする
    • マイ辞書の暗号化
      • 編集したい場合は生データでのエクスポート & インポートできるようにする

    インストール

    2023年現在、Mac App Storeでは日本語入力システムを配布することができないため、Appleのソフトウェア公証を受けたアプリケーションバイナリをGitHub Releasesで配布しています。dmgファイルをダウンロードしマウントした中にあるpkgファイルからインストールしてください。

    もしHomebrew Caskでインストールしたい場合は、 brew install --cask macskk でインストールできます。詳しくは https://formulae.brew.sh/cask/macskk を参照してください。

    また独自Cask定義 brew install --cask mtgto/macskk/macskk でもインストールできます。Homebrew公式との違いとしてはこちらはGitHub Actionsで作業を自動化しているのでリリース直後にすぐ反映されます。詳しくは https://github.com/mtgto/homebrew-macSKK を参照してください。

    macSKKのインストール後に、システム設定→キーボード→入力ソースから「ひらがな」(アイコンは▼あ)と「ABC」(アイコンは▼A)を追加してください。カタカナ、全角英数、半角カナは追加しても追加しなくても問題ありません。
    もしインストール直後に表示されなかったり、バージョンアップしても反映されない場合はログアウト & ログインを試してみてください。

    SKK辞書は ~/Library/Containers/net.mtgto.inputmethod.macSKK/Data/Documents/Dictionaries に配置してください。まずは https://github.com/skk-dev/dictSKK-JISYO.L から使ってみるとよいでしょう。
    その後、macOSメニューバーの入力メニュー→環境設定を開き、辞書設定で使用する辞書を有効に切り替えてください。EUC-JPでないエンコーディングの場合はiボタンからエンコーディングを切り替えてください。現在はEUC-JP (EUC-JIS-2004を含む) とUTF-8に対応しています。辞書ファイルの形式はYAML形式、JSON形式なども提案されていますが現在はJSON形式のみ対応しておりYAML形式には未対応です。

    辞書の削除は上記フォルダから辞書ファイルをゴミ箱に移動するかファイルを削除してください。macSKKが自動で無効化します。

    ユーザー辞書は ~/Library/Containers/net.mtgto.inputmethod.macSKK/Data/Documents/Dictionaries/skk-jisyo.utf8 にUTF-8形式で保存されます。
    ユーザー辞書はテキストエディタで更新可能です。別プロセスでユーザー辞書が更新された場合はmacSKKが自動で再読み込みを行います。

    設定

    macSKKが入力メソッドとして選択されているときに入力メニューから「設定…」でGUIの設定画面を開くことができます。またプライベートモードのように入力メニューから直接有効・無効を切り替えるものがあります。

    設定は Plist 形式で ~/Library/Containers/net.mtgto.inputmethod.macSKK/Data/Library/Preferences/net.mtgto.inputmethod.macSKK.plist に保存されます。

    キー 値の型 設定の意味
    dictionaries Array 辞書設定
    directModeBundleIdentifiers Array 直接入力モードにしているアプリケーションのBundle Identifierの配列
    selectedInputSource String キー配列 (KeyLayout) のID
    showAnnotation Boolean 注釈を変換候補のそばに表示するか
    inlineCandidateCount Number インラインで表示する変換候補の数
    workarounds Array 互換性設定がされているアプリケーション
    candidatesFontSize Number 変換候補のフォントサイズ (デフォルト13)
    annotationFontSize Number 注釈のフォントサイズ (デフォルト13)
    skkserv Dictionary skkservサーバーへの接続設定
    selectCandidateKeys String 変換候補から確定するキー配列
    findCompletionFromAllDicts Boolean ユーザー辞書だけでなくすべての辞書から補完を探すか
    showCompletion Boolean 補完候補を表示するか
    selectedKeyBindingSetId String 選択しているキーバインドのセットのID
    keyBindingSets Array キーバインドのセットの配列
    enterNewLine Boolean Enterキーで変換候補の確定 + 改行も行う
    systemDict String 注釈に使用するシステム辞書
    selectingBackspace Number 変換候補選択時のバックスペースの挙動
    punctuation Number カンマとピリオド押下時の句読点設定
    privateMode Boolean プライベートモード
    ignoreUserDictInPrivateMode Boolean プライベートモードでユーザー辞書を無視するか
    showInputModePanel Boolean 入力モードをモーダル表示するか
    candidateListDirection Number 変換候補リストの表示方向
    dateConversions Dictionary 日付変換の読みと変換候補
    showCandidateForCompletion Boolean 変換候補の補完を表示するか
    fixedCompletionByPeriod Boolean ピリオドで最初の補完候補で確定するか

    機能

    単語登録

    有効な辞書で有効な読みが見つからない場合、単語登録モードに移行します。

    例として “あああ” で変換しようとしても辞書になかった場合 [登録:あああ] のようなテキストが表示されます。

    この状態でテキストを入力しEnterすることでユーザー辞書にその読みで登録されます。漢字変換も可能ですが単語登録モードで変換候補がない変換が行われた場合は入力されなかったと扱い、入れ子で単語登録モードには入れなくなっています。

    単語登録モードでのみ C-y でクリップボードからペーストできます (AquaSKKと同様です)。通常のペーストコマンド Cmd-v はアクティブなアプリケーションに取られて利用できないため、特殊なキーバインドにしています。

    単語登録をしない場合はEscキーや C-g でキャンセルしてください。

    ユーザー辞書から単語の削除

    変換候補が選択されている状態で Shift-x を入力すると (よみ) /(変換結果)/ を削除します(yes/no) という表示に切り替わります。この状態でyesと入力してenterするとユーザー辞書から選択していた変換候補を削除します。noを選んだり Escキーや C-g でキャンセルした場合には何も行いません。

    現状は選択されている変換候補がユーザー辞書にない場合は 削除します(yes/no) という表示を行いますが、実際には何も行いません(ユーザー辞書以外を書き換えたくないため)。将来は他辞書からの削除ができるような対応をするかもしれませんが現在は未定です。

    読みの補完

    入力中、ユーザー辞書にある送りなし変換エントリから先頭が一致する変換履歴がある場合、入力テキストの下部に候補を表示します。タブキーを押すことで表示されているところまで入力が補完されます。

    現在、補完の対象となるのはユーザー辞書の送りなしエントリだけです。

    数値変換

    辞書に “だい# /第#0/第#1/” のように、読みに”#”、変換候補に “#(数字)” を含むエントリは数値変換エントリです。

    macSKKではタイプ0, 1, 2, 3, 8, 9に対応しています。
    数値として使えるのは0以上2^63-1 (Int64.max) までです。

    ユーザー辞書に追加される変換結果は “だい# /第#0/” のように実際の入力に使用した数値は含まない形式で追加されます。

    キー配列の変更

    デフォルトではQWERTY配列になっていますが、設定画面からキー配列を変更できます。

    システムで有効なキー配列のうち、英語用のキー配列のみを選択リストに表示しています。

    キーバインドの変更

    qやlやCtrl-jなど、SKKで使用されるキーバインドを変更できます。
    変更するには、設定画面のキーバインドからデフォルトのキーバインドのセットを複製してから修正してください。

    もしおかしな挙動だったり、設定にはないような特殊なキーバインドを希望したい場合はIssueでお知らせください。

    ローマ字変換ルールの変更

    どのキーを入力したときにどのような文字に変換するかをカスタマイズすることができます。
    例えばローマ字入力表のカスタマイズもできますが、それ以外でも句読点としてカンマやピリオドを入力するように設定したり、全角で入力したい記号を設定することができます。

    ~/Library/Containers/net.mtgto.inputmethod.macSKK/Data/Documents/Settings/kana-rule.conf にファイルを置くことで、ローマ字テーブルの変更や記号入力をカスタマイズすることができます。

    上記のパスにファイルがない場合、もしくは正常に読み込めなかった場合は ~/Library/Input Methods/macSKK.app/Contents/Resources/kana-rule.conf がデフォルトで使用されます。
    カスタマイズしたい際はmacSKK.app内にある kana-rule.conf ファイルもしくは https://github.com/mtgto/macSKK/blob/main/macSKK/kana-rule.conf を元にカスタマイズするのがよいでしょう。
    設定ファイルの変更を監視しているため更新されたら即座に反映されます。

    ローマ字変換ルール設定ファイルはUTF-8 + LF (BOMなし) で作成してください。
    簡単な使い方はデフォルトファイルにもあるので参照してみてください。

    ファイルを配置したのに反映されない場合はConsole.appでエラーが出てないか確認してみてください。
    ローマ字変換定義ファイルの XX 行目の記述が壊れているため読み込みできません のようなログが出ているかもしれません。
    正常に読み込めている場合は 独自のローマ字かな変換ルールを適用しました というログが出力されます。

    現在制限として、カタカナや半角カナモードでの文字をひらがなモードでの文字と異なる文字を使用する場合、未確定入力中はカタカナでも半角カナでもひらがなのルールが使用されてします。

    例えば a,あ,か,サ という設定がある状態で a を入力した場合はこうなります。

    モード 頭に▽がある 結果 問題ある?
    ひらがな YES ▽あ なし
    ひらがな NO なし
    カタカナ YES ▽ア あり
    カタカナ NO なし
    半角カナ YES ▽ア あり
    半角カナ NO なし

    プライベートモード

    プライベートモードが有効なときは変換結果がユーザー辞書に反映されません。ユーザー辞書以外の辞書やプライベートモードを有効にする前のユーザー辞書の変換候補は参照されます。

    プライベートモードの有効・無効は入力メニュー→プライベートモードから切り替えできます。

    直接入力

    直接入力を有効にしたアプリケーションでは、日本語変換処理を行いません。独自でIME機能を持つEmacs.appなどで使用することを想定しています。

    直接入力の有効・無効の切り替えは、切り替えたいアプリケーションが最前面のときに入力メニュー→”(アプリ名)で直接入力”から行えます。
    また有効になっているアプリケーションのリストは設定→直接入力から確認できます。

    直接入力を有効にしたアプリケーションはBundle Identifier単位で記録しているため、アプリケーションを移動させても設定は無効になりません。また特殊なGUIアプリケーションはBundle Identifierをもたないため直接入力を設定できません (Android StudioのAndroidエミュレータとか)。

    ユーザー辞書の自動保存

    ユーザー辞書が更新された場合、一定期間おきにファイル書き出しが行われます。またシステム再起動時やバージョンアップのインストール実行後などmacSKKプロセスが正常終了する際にファイル書き出しが終わっていない更新がある場合はファイル書き出しを行ってから終了します。
    もし即座にファイル書き出ししたい場合は入力メニューから”ユーザー辞書を今すぐ保存”を選んでください。

    Command + Option + Escからの強制終了時やシグナルを送っての終了時は保存されないので注意してください。

    バージョンの自動チェック

    macSKKは現在開発中のアプリケーションです。そのため安定していない可能性が高いです。
    なるべく不具合が修正された最新バージョンを使っていただきたいため、定期的に新しいバージョンがないかをチェックして見つかった場合は通知センターで通知します。

    新規バージョンの確認はGitHubのReleasesページのAtom情報を取得して行います。
    バージョンチェックは12時間おきにバックグラウンドで実行されます。

    macSKKアプリ自体はApp Sandboxでインターネット通信ができないように設定しているため、GitHubのReleaseページの取得はmacSKKからXPCを介して外部プロセスで行います。

    SKKServを辞書として使う

    skkservサーバーをSKK辞書として使用することができます (macSKKがskkservサーバーとして機能するわけではないです)。
    まだ作り込みが甘いのでベータ機能だと思ってください。

    設定の辞書メニューからSKKServを有効にすることで使用できます。

    • アドレスはIPv4, IPv6, ホスト名のいずれかを指定してください。
    • ポート番号は通常は1178が使われるようです
    • 応答エンコーディングは通常はEUC-JPが使われることが多いようですがskkservの実装によってはUTF-8を返すものもあるようです。
    • SKKServ設定画面のテストボタンは設定中のskkservにバージョン取得コマンドを試します。正常な応答があれば「skkservへの接続に成功しました」と表示されます。

    現状は以下の制限があります。

    • 同時に1サーバーまで接続可能です。
    • TCP接続が切断されたり1秒以内に送信できなかったり1秒以内に応答がなかった場合は取得できなかったものとして扱います。
    • 常にファイル辞書よりも変換候補は後に出るようにしています。
      • 並び替えのUIで迷ったために先送り。将来並び替えできるようにすると思います。

    動作確認はyaskkserv2でのみ行っています。

    アンインストール

    現在アンインストールする手順は用意していないためお手数ですが手動でお願いします。
    今後、dmg内にアンインストーラを同梱予定です。

    手動で行うには、システム設定→キーボード→入力ソースから「ひらがな」「ABC」を削除後、以下のファイルを削除してください。

    • /Library/Input Methods/macSKK.app
    • ~/Library/Containers/net.mtgto.inputmethod.macSKK

    FAQ

    Q. Visual Studio Code (vscode) で C-j を押すと行末が削除されてしまいます

    A. C-j がVisual Studio Codeのキーボードショートカット設定の editor.action.joinLines にデフォルトでは割り当てられていると思われます。Cmd-K Cmd-S から editor.action.joinLines で検索し、キーバインドを削除するなり変更するなりしてみてください。

    Q. Wezterm で C-j を押すと改行されてしまいます

    A. macos_forward_to_ime_modifier_maskCTRL を追加することでIMEに C-j が渡されてひらがなモードに切り替えできるようになります。 SHIFT も入れておかないと漢字変換開始できなくなるので、 SHIFT|CTRL を設定するのがよいと思います。

    Q. 標準Terminal / iTerm2で C-j を押すと改行されてしまいます

    A. Karabiner-Elementsで C-j をかなキーに置換することで対応することができます。作者は以下のようなComplex Modificationsを ~/.config/karabiner/assets/complex_modifications/macskk.json に配置しています。将来 https://github.com/pqrs-org/KE-complex_modifications に配置して簡単にインストールできるようにしようと思っています。

    {
        "description": "macSKK for Terminal/iTerm2",
        "manipulators": [
            {
                "conditions": [
                    {
                        "bundle_identifiers": [
                            "^com\\.googlecode\\.iterm2",
                            "^com\\.apple\\.Terminal"
                        ],
                        "type": "frontmost_application_if"
                    },
                    {
                        "input_sources": [
                            {
                                "input_source_id": "^net\\.mtgto\\.inputmethod\\.macSKK\\.(ascii|hiragana|katakana|hankaku|eisu)$"
                            }
                        ],
                        "type": "input_source_if"
                    }
                ],
                "from": {
                    "key_code": "j",
                    "modifiers": {
                        "mandatory": [
                            "left_control"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "japanese_kana"
                    }
                ],
                "type": "basic"
            }
        ]
    }

    Q. Ghosttyでq/lキーでモードを切り替えてもq/lが入力されてしまう / C-j を押すと改行されてしまう

    Ghostty v1.1.0で、q/lなどで入力モードが変更されたかどうかをGhostty側で判定してくれるようになりました。ただしOS側の現在の入力モードが変わったかどうかをチェックしているため、切り替え前と切り替え後の入力モードを両方ともmacOSのキーボード設定で有効にしておく必要があります。
    例えばmacSKKの「ひらがな」だけを入れている場合、qでカタカナモードに変更してもOSでの入力モードは「macSKKのひらがな」のままと認識されてしまいqがそのまま入力されてしまいます。同様にmacSKKの「ABC」を入れていないと、lを入力してもモードが変わってないとGhosttyには解釈されてlがそのまま入力されてしまいます。
    https://zenn.dev/mtgto/articles/macskk-karabiner-settings-for-ghostty も参考にしてください。

    Q. Visual Studio Code (vscode) のターミナルやClaude Code拡張でaiueoがひらがなにならない・qlのモード変更でキーが入力されてしまう

    xterm.js利用の問題と思われます。 #356

    入力メニューにある「1文字目を未確定扱い (互換性)」を有効にすることで aiueo のようなローマ字1文字からなるひらがなの入力ができるようになります。あくまで一時的な回避策 (ワークアラウンド) なので、aiueo のあとは他の文字を打つかEnterが押されないと入力が確定されないままとなります。

    Q. アプリによってq/lキーでモードを切り替えてもq/lが入力されてしまう / C-jで改行されてしまう

    #119 と同じ問題と思われます。
    v0.20.0ではKitty, LINE, Alacrittyについて「空文字挿入」というワークアラウンドを初期設定でもっています。

    空文字挿入の設定は、アプリが最前面にあるときに入力メニューから設定可能です。
    またmacSKKの設定内の「互換性の設定」からも可能です。

    Q. OS標準の入力ソース ( 日本語ABC ) を削除してmacSKKだけにしたい

    日本語 の設定で入力モードの英字を有効にしてから ABC, 日本語 の順に削除するとmacSKKだけにしたりできるようです。
    参考: https://zenn.dev/yoshiyoshifujii/articles/78798db6472bf4

    Q. ターミナルで キーボード入力のセキュリティを保護 iTerm2で Secure Keyboard Entry を有効にすると入力メニューで無効化される

    macOSの日本語入力システムは、ユーザーライブラリ (~/Library) とシステムライブラリ (/Library) の二種類の配置場所があるのですが、 Secure Keyboard Entry が有効なアプリケーション内で日本語入力システムを使用できるようにするにはシステムライブラリにインストールされている必要があるようです。

    参考: #351

    v2.0.0からシステムライブラリへのインストールが可能にできるように変更しました。システムライブラリへのインストールをお試しください。

    開発

    コントリビュートのガイドを .github/CONTRIBUTING.md に用意しています。

    Xcodeでビルドし、 ~/Library/Input MethodsmacSKK.app を配置してからシステム設定→キーボード→入力ソースで ひらがな (macSKK) などを追加してください。

    macOS 14以降ではApp Sandboxの制限が強くなりました。すでにリリース版macSKKを使っている環境で開発版のmacSKKを使用すると起動時に 「"macSKK"がほかのアプリからのデータへのアクセスを求めています。」 というダイアログが表示されることがあります。これはリリース版で署名に使用しているTeam IDと異なるProvisioning Profileを使用している (もしくはAd hoc署名を使っている) 場合に同じユーザー辞書ファイルにアクセスすることで発生します。この状態で「許可」を選んでしまうとリリース版のmacSKKが逆に読み込めなくなるなどの想定しない問題が発生する可能性があります。お手数ですがBundle Identifierを変更するなどを検討してください。

    バージョンアップ

    X.Y.Z 形式のバージョン (MARKETING_VERSION) とビルド番号 (CURRENT_PROJECT_VERSION) の更新が必要です。

    ビルド番号

    メジャー、マイナー、パッチ、どのバージョンアップでも1ずつインクリメントしてください。
    Xcodeから手動でやってもいいし、agvtoolでもいいです。

    agvtool next-version

    MARKETING_VERSIONの更新

    Info.plistCFBundleShortVersionStringで管理するのではなくpbxprojにMARKETING_VERSIONで管理する形式だとagvtool next-marketing-version が使えないみたいなのでXcodeで手動で変えてください。

    リリース

    • CHANGELOGを記述
    • バージョンアップ
    • make clean && make release
    • GitHubのReleaseを作成、dmgとdSYMsをアップロード、CHANGELOGをコピペ

    ライセンス

    macSKKはGNU一般公衆ライセンスv3またはそれ以降のバージョンの条項の元で配布されるフリー・ソフトウェアです。

    詳細は LICENSE を参照してください。

    Visit original content creator repository

  • argbash-docker

    argbash-docker

    Remarks from accetto

    Some time ago I’ve cloned the original argbash repository, because the original Docker image available on the Docker Hub has been outdated at that time.

    Later I’ve added two wrapper utilities that make using the dockerized argbash even more convenient. They are pretty straightforward and the embedded help should be probably sufficient, but I’ve added also the following description page.

    From time to time I’ll merge the new updates from the original argbash repository.

    The original README for the Docker image can be found here.

    You can build the argbash-docker image from the project’s root directory like this:

    docker build -f ./docker/Dockerfile -t accetto/argbash-docker .

    You can also download the image from the Docker Hub repository accetto/argbash-docker.

    Enjoy using argbash, it’s a nice tool. The credit goes to the original author(s).

    The original README content follows.


    Build Status Documentation Status

    argbash logo

    • Do you write Bash scripts that should accept arguments?
    • But they don’t since arguments support is a daunting task, because …
    • getopt is discouraged, getopts doesn’t support long options, there is no widely-accepted Bash module to do the task and some solutions don’t work on all platforms (Linux, OSX, MSW)…

    Give Argbash a try and stop being terrorized by those pesky arguments! With Argbash, you will get:

    • Fast, minimalistic declaration of arguments your script expects (see below for supported argument types).
    • Scripts generated from definitions once that can be used on all platforms that have bash.
    • Definitions embedded in few lines of the script itself (so you can use Argbash to regenerate the parsing part of your script easily).
    • Ability to re-use low-level Argbash-aware scripts by wrapping them by higher-level Argbash-aware ones conveniently, without duplicating code.
    • Easy installation (optional). Just grab a release, unzip it, go inside and run cd resources && make install (you may want to run sudo make install PREFIX=/usr for a system-wide installation).
    • Documentation and examples.

    Make your existing script powered by Argbash in a couple of minutes. Explore various Argbash flavours:

    Flavour Target group
    Argbash online Use it if you want to try Argbash without installing it and you have permanent access to the Internet.
    Argbash CLI Install the package to have argbash ready locally all the time.
    Argbash Docker Pretty much like Argbash CLI, but you don’t have to install it, you just download the image.

    What it is

    Argbash is not a parsing library, but it is rather a code generator that generates a bash library tailor-made for your script. It lets you to describe arguments your script should take and then, you can generate the bash parsing code. It stays in your script by default, but you can have it generated to a separate file and let Argbash to include it in your script for you. In any case, you won’t need Argbash to run the script.

    Argbash is very simple to use and the generated code is relatively nice to read. Moreover, argument definitions stay embedded in the script, so when you need to update the parsing logic, you just re-run the argbash script on the already generated script.

    So by writing few comments to your script and running the Argbash’s bin/argbash over it, you will get a bash script with argument parsing. See the simple example source template and simple example script for the result. If you are not into long reading, let bin/argbash-init generate the template for you.

    Following argument types are supported:

    • Positional arguments (defaults supported, possibility of fixed, variable or infinite number of arguments),
    • optional arguments that take one value,
    • boolean optional arguments,
    • repeated (i.e. non-overwriting) optional arguments,
    • incrementing (such as --verbose) optional arguments and
    • action optional arguments (such as --version, --help).

    Following outputs are available:

    • Bash scripts, tailor-made bash parsing libraries.
    • POSIX scripts that use getopts, also tailor-made.
    • Bash completion.
    • docopt-compliant usage message.
    • Manpage output using rst2man.

    The utility has been inspired by Python’s argparse and the shflags project.

    Read the docs (latest stable version) for more info

    Requirements

    • bash that can work with arrays (most likely bash >= 3.0) (the only requirement for users – i.e. people that only execute scripts and don’t make them)
    • autom4te utility that can work with sets (part of autoconf >= 2.63 suite)
    • basic utilities s.a. sed, grep, cat, test.
    Visit original content creator repository
  • snake

    A Multi-Player Snake game in sdl

    ScreenShots

    menu game multiplayer paused game over

    build dependancies

    • wxWidgets
    • SDL2
    • SDL2_image
    • SDL2_ttf
    • SDL2_mixer
    • cmake
    • git

    Building in linux

    git clone github.com/SL-Pirate/snake
    cd snake
    mkdir build
    cd build
    cmake ..
    make

    To Run the program

    do sudo chmod +x ./snake

    • This needs to be done only once!
    • after this is done just execute the snake binary from a command line or a graphical file manager.

    Building for windows

    Setting up building environment for windows

    1. Download and install wxWidgets from their official website

    2. Add the path_to_the_root_of_your_wxWidgets_folder to your system environment variables under the name wxWidgets

    3. Download the development packages of

      • SDL2
      • SDL2_image
      • SDL2_ttf
      • SDL2_mixer

      corresponding to your compiler

    4. Extract the development package of SDL2 and rename the directory as SDL2

    5. Extract the development package of SDL2_image to the same folder and rename it as SDL2_image

    6. Extract the development package of SDL2_image to the same folder and rename it as SDL2_ttf

    7. Extract the development package of SDL2_mixer to the same folder and rename it as SDL2_mixer

      Now your directory should look like this

      {BaseFolder}
      ├── SDL2
          ├── cmake
          ├── include
          ├── lib
          etc...
      .......
          SDL2_image
          ├── cmake
          ├── include
          ├── lib
          etc...
      ........
          SDL2_ttf
          ├── cmake
          ├── include
          ├── lib
          etc...
      ........
          SDL2_mixer
          ├── cmake
          ├── include
          ├── lib
          etc...
      
    8. Add the path_to_the_root_of_your_SDL2_BaseFolder to your system environment variables under the name SDL2

    Compiling

    • if using MinGW32-gcc
    git clone github.com/SL-Pirate/snake
    cd snake
    mkdir build
    cd build
    cmake .. -G "MinGW Makefiles"
    make
    • if using msvc
    git clone github.com/SL-Pirate/snake
    cd snake
    mkdir build
    cd build
    cmake --build ..
    Visit original content creator repository
  • Ti.Android.Animator

    Ti.Android.Animator

    A newer version of @Animecyc Android TitaniumAnimator

    A drop-in animation replacement for Titanium. This module’s aim is to mimick as much of the Titanium animation module as possible with the addition of new timing functions and better performance. As of right now the only properties that can be animated are: rotate, transform, top, bottom, left, right, width, height, opacity, color and backgroundColor. The transform property is not supported at this time.

    If you are animating views that don’t contain any sort of transparency you will see performance gains when animating large or otherwise complex view groups.

    Support

    • Android: 7.0+

    Usage

    Download it here

    var Animator = require('ti.android.animator');
        
    var mainWindow = Ti.UI.createWindow({
    	backgroundColor : 'white'
    });
        
    var animationView = Ti.UI.createView({
        	backgroundColor : 'red',
        	width : 100,
        	height : 100
    });
    
    animationView.addEventListener('click', function () {
    	Animator.animate(animationView, {
    		duration : 1000,
    		easing : Animator.BOUNCE_OUT,
    		width : 150,
    		height : 150,
    		backgroundColor : 'blue',
    		opacity : 0.5,
    		bottom : 0
    	}, function () {
    		Animator.animate(animationView, {
    			duration : 1000,
    			easing : Animator.BOUNCE_OUT,
    			width : 100,
    			height : 100,
    			backgroundColor : 'red',
    			opacity : 1,
    			bottom : null
    		});
    	});
    });
    
    mainWindow.add(animationView);
    
    mainWindow.open();

    Rotations

    If you need to perform a rotation you can pass the rotate property which accepts a float. The rotate property is the angle you wish to rotate to; A positive value will result in a counter-clockwise rotation, while a negative value will result in a clockwise rotation.

    Once a rotation has been performed subsequent rotations will be performed from its last rotation angle. To simplify multiple rotations you can pass values > 360. For example to do two complete rotations you can pass a value of 720.

    Layout Support

    When animating a complex layout (such as a vertical layout inside a vertical layout) it may be necessary to specify which parent to propogate the animimations from, you can do this by setting parentForAnimation and passing the proxy that holds the views that should animate. This is especially useful in cases where you are animating inside of a Ti.UI.ScrollView.

    Easing Functions

    The below easing functions can be accessed as you would any other Titanium constant. Assuming the above usage example you can access all of these by passing the below name to the module, such as in: Animator.ELASTIC_IN_OUT

    • LINEAR (default)
    • QUAD_IN
    • QUAD_OUT
    • QUAD_IN_OUT
    • CUBIC_IN
    • CUBIC_OUT
    • CUBIC_IN_OUT
    • QUART_IN
    • QUART_OUT
    • QUART_IN_OUT
    • QUINT_IN
    • QUINT_OUT
    • QUINT_IN_OUT
    • SINE_IN
    • SINE_OUT
    • SINE_IN_OUT
    • CIRC_IN
    • CIRC_OUT
    • CIRC_IN_OUT
    • EXP_IN
    • EXP_OUT
    • EXP_IN_OUT
    • ELASTIC_IN
    • ELASTIC_OUT
    • ELASTIC_IN_OUT
    • BACK_IN
    • BACK_OUT
    • BACK_IN_OUT
    • BOUNCE_IN
    • BOUNCE_OUT
    • BOUNCE_IN_OUT

    Visit original content creator repository

  • DNA-Sequencing

    Note : All the Rendered Juypter Notebooks(in nbviewer) for better view are availabe by clicking on the links embedded below. Also some links might not work so you can direcly click here and paste the link of the notebook you want to render

    DNA Sequencing is the process of determining the nucleic acid sequence – the order of nucleotides in DNA. It includes any method or technology that is used to determine the order of the four bases: Adenine(A), Guanine(G), Cytosine(C), and Thymine(T).
    DNA Sequencing may be used to determine the sequence of individual genes, larger genetic regions (i.e. clusters of genes or operons), full chromosomes, or entire genomes of any organism. DNA sequencing is also the most efficient way to indirectly sequence RNA or proteins.

    N|Solid

    Read Alignment Algorithms Covered :

    • Online Algorithms:

      The algorithm in which the text ‘T’ (in our case the reference genome) is not pre-processed, and it doesn’t matter if the pattern ‘P’ is pre-processed or not.

    • Offline Algorithms:

      The algorithm in which the text ‘T’ is pre-processed, and it doesn’t matter if the pattern ‘P’ is pre-processed or not.

      We use the term k-mer to refer to a substring of length k. For each offset that the index reports back, that’s called an index hit. When P matches within T, we’ve been calling that a match, or an occurrence. But, an index hit may or may not correspond to a match, it’s just a hint that we should look harder in that particular region of T. So, not all index hits lead to matches, because we don’t know whether the rest of P matches where it should within T. We have to do more character comparisons. And, this additional work that we do is called verification.

      This kind of data structure is called a multimap. It’s a map because it associates keys, k-mers, in this case with values, offsets in the genome. And it’s a multimap because a k-mer may be associated with many different offsets in the genome.

      In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

    Need for Approximate Matching Algorithms :

    • We need algorithms that can do approximate matching. Allowing for differences between the pattern and the text. One of the reason we might expect differences between the read and the reference is because of sequencing errors. Sometimes the sequencer will make mistakes. It will miscall a base in the sequencing read. And when that happens, that base might no longer match the reference genome.

    • We want to be able to talk about the distance between two strings. In other words, we want to be able to describe how different they are, how many differences there are. But we have to define exactly what we mean by distance.

      • So the first kind of distance we’ll define is called Hamming Distance. So if you have two strings, X & Y, that are of the same length, we can define the hamming distance between X and Y as the minimal number of substitutions we need to make to turn one of the strings into the other.

      • Another is Edit Distance(AKA levenshtein Distance) between two strings equals the minimal number of edits required to turn one string into the other. Where a single edit could be a substitution, or it could be an insertion or a deletion. (In this case X & Y could be of different length)

      • Approximate Matching Algorithm using Pigeonhole Principle (and Boyer Moore) : The Pigeonhole Principle states that if items are put into containers, with, then at least one container must contain more than one item. In our case we will split pattern ‘P’ (k+1) times when we are looking for an approximate match of upto ‘k’ mismatches, that means even if we have ‘k’ mismatches in ‘k’ partitions of pattern ‘P’, still there will be atleast one partition which will exactly match with the reference genome, which we can later confirm by verification as stated in indexing techiques.

      • Global Alignment: Calculating a global alignment is a form of global optimization that “forces” the alignment to span the entire length of all query sequences. By contrast, local alignments identify regions of similarity within long sequences that are often widely divergent overall. An attempt is made to align the entire sequence (end to end alignment) Finds local regions with the highest level of similarity between the two sequences. A global alignment contains all letters from both the query and target sequences. It penalises the Substitution/ Insertion/ Deletion differently than editDistance.

      • Overlaps: Overlap–layout–consensus genome assembly algorithm: Reads are provided to the algorithm. Overlapping regions are identified. Each read is graphed as a node and the overlaps are represented as edges joining the two nodes involved. The algorithm determines the best path through the graph (Hamiltonian path).

      • Shortest Common Superstring: A shortest common supersequence (SCS) is a common supersequence of minimal length. In the shortest common supersequence problem, two sequences X and Y are given, and the task is to find a shortest possible common supersequence of these sequences.

    Visit original content creator repository